Skip to content

Instantly share code, notes, and snippets.

View clarencetw's full-sized avatar
🏠
Working from home

Clarence clarencetw

🏠
Working from home
View GitHub Profile
@clarencetw
clarencetw / MacFileRemoverForSVN
Created April 2, 2016 01:12 — forked from cillosis/MacFileRemoverForSVN
Remove ._. and .DS_* files from folder on Mac OS X
find . -type f \( -iname "._*" \) -exec svn delete {} \;
find . -type f \( -iname ".DS_*" \) -exec svn delete {} \;
var FB = require('fb');
var readline = require('readline');
FB.options({
appId: '',
appSecret: '',
redirectUri: ''
});
Content-Type: multipart/mixed; boundary="==BOUNDARY=="
MIME-Version: 1.0
--==BOUNDARY==
Content-Type: text/cloud-boothook; charset="us-ascii"
# Install nfs-utils
cloud-init-per once yum_update yum update -y
cloud-init-per once install_nfs_utils yum install -y nfs-utils
curl -X POST -H 'Authorization: Bearer [access_token]' -F 'message=foobar' https://notify-api.line.me/api/notify
const { performance: perf } = require('perf_hooks');
function test() {
};
let code = {
domain: 'abcdef.com',
account: 'ab@abc.com'
}
const a = ['a', 'b'];
const b = ['b', 'c'];
Array.prototype.diff = function(a) {
return this.filter(function(i) {return a.indexOf(i) < 0;});
};
console.log("A diff B: ", a.diff(b));
console.log("B diff A: ", b.diff(a));
time-format %H:%M:%S
date-format %d/%b/%Y
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
@clarencetw
clarencetw / goaccess-install-and-use-1
Last active July 27, 2019 07:54
goaccess-install-and-use
echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list
wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install goaccess
$ goaccess -a -d -f /var/log/nginx/access.log -p /etc/goaccess.conf -o /var/www/goaccess/report.html
$ zcat -f /var/log/nginx/access.log* | goaccess -a -d -p /etc/goaccess.conf -o /var/www/goaccess/report.html