Skip to content

Instantly share code, notes, and snippets.

View henryonsoftware's full-sized avatar
🖥️
Slapping the keyboard until something good happens

Henry Bui henryonsoftware

🖥️
Slapping the keyboard until something good happens
View GitHub Profile
@henryonsoftware
henryonsoftware / cloudflare_waf_rule.txt
Last active September 8, 2024 05:25
cloudflare_waf_rule.txt
(cf.threat_score gt 15) or
(http.user_agent eq "") or
(lower(http.user_agent) contains "crawler" and not http.user_agent contains "ia_archiver") or
(lower(http.user_agent) contains "spider") or
(http.user_agent contains "AhrefsBot/") or
(http.user_agent contains "baidu.com") or
(http.user_agent contains "biggo.com") or
(http.user_agent contains "/bin/bash") or
(http.user_agent contains "DnyzBot/") or
(http.user_agent contains "DotBot/") or
@henryonsoftware
henryonsoftware / deploy.sh
Last active July 16, 2024 06:03
Laravel deploy script on Forge
# Go inside the site directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
$FORGE_PHP artisan down
git pull origin $FORGE_SITE_BRANCH
$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader
@henryonsoftware
henryonsoftware / install_selenium_on_homestead.md
Last active May 9, 2018 06:46
Install selenium on Homestead

Install selenium on Homestead vagrant box

All commands are in the terminal.

  1. Start vagrant box: vagrant up
  2. SSH into the Homestead Box: vagrant ssh from homestead directory
  3. Create a new folder for Selenium: mkdir selenium from the ~ directory
  4. Navigate to that folder: cd selenium
  5. Get Selenium: wget http://selenium-release.storage.googleapis.com/3.11/selenium-server-standalone-3.11.0.jar Note: This link comes from copying the link on http://docs.seleniumhq.org/download/
@henryonsoftware
henryonsoftware / xdebug_on_ubuntu.md
Last active May 27, 2024 18:25
Install xdebug on Ubuntu

Install Xdebug on Ubuntu.

Install xdebug

Run php -i and copy the output of the following command and paste it on https://xdebug.org/wizard.php. Follow the instructions there to install xDebug.

Example:

  1. Download xdebug-2.6.0.tgz: wget http://xdebug.org/files/xdebug-2.6.0.tgz

  2. Unpack the downloaded file with tar -xvzf xdebug-2.6.0.tgz

@henryonsoftware
henryonsoftware / xdebug_on_centos.md
Last active April 16, 2018 08:02
Install xdebug on CentOS

Install Xdebug on CentOS

You need to install PHP’s devel package for PHP commands execution

yum install php-devel
yum install php-pear

Next install GCC and GCC C++ compilers to compile Xdebug extension yourself.

yum install gcc gcc-c++ autoconf automake

<?php
public function checkIdol($name)
{
if ($name == '') {
$this->error = "Tên không được để rỗng";
return false;
}
$validate = $this->validation($name);
if (!$validate) {
<?php
public function checkIdol($name)
{
if ($name != "") {
$validate = $this->validation($name);
if (!$validate) {
$this->error = "Tên không hợp lệ";
return false;
} else {
$dien_vien = DienVien::where('ten', 'likes', $name)->get();