@keyframes flip-rotate-5-3-60 {
0%, 1.5% { margin-top: 60px; }
1.5%, 19.7% { margin-top: 0px; }
22.7%, 39.4% { margin-top: -60px; }
42.4%, 59.1% { margin-top: -120px; }
62.1%, 78.8% { margin-top: -180px; }
81.8%, 98.5% { margin-top: -240px; }
100% { margin-top: -300px; }
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function p () { | |
if (last != "") { | |
month = substr(last, 1, 7) | |
day = substr(last, 9, 2) | |
print "mkdir -p", month"/"day | |
file = month"/"day"/production.log" | |
print "file="file | |
print "test -f $file && file=${file}.2" | |
printf "%s production.log", "tail -n+"NRs[last] | |
if (date != "") { |
Suppose you have these logs:
access.log
api.access.log
api.error.log
frontend.access.log
frontend.error.log
services.access.log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND | |
13:17:18 154 be/3 root 0.00 B/s 0.00 B/s 0.00 % 0.15 % [jbd2/xvda1-8] | |
13:17:19 4935 be/4 root 3.92 K/s 3.92 K/s 0.00 % 0.09 % python /usr/sbin/iotop -botqqq --iter=3 | |
13:17:24 154 be/3 root 0.00 B/s 11.79 K/s 0.00 % 1.59 % [jbd2/xvda1-8] | |
13:17:24 2696 be/4 root 0.00 B/s 3.93 K/s 0.00 % 0.00 % nginx: worker process | |
13:17:26 4960 be/4 root 0.00 B/s 3.93 K/s 0.00 % 0.00 % sudo su | |
13:17:27 981 be/4 nobody 0.00 B/s 3.93 K/s 0.00 % 0.00 % nscd | |
13:17:29 154 be/3 root 0.00 B/s 19.66 K/s 0.00 % 0.38 % [jbd2/xvda1-8] | |
13:17:33 2696 be/4 root 0.00 B/s 3.93 K/s 0.00 % 0.00 % nginx: worker process | |
13:17:36 154 be/3 root 0.00 B/s 0.00 B/s 0.00 % 0.34 % [jbd2/xvda1-8] |
Move NAMES to first column
dpsa | awk 'NR==1{I=index($0,"NAMES");J=length($0);K=substr($0,I);L=substr($0,0,I-1)}NR==2{print K sprintf("%*s",length($0)-J,"") L}NR>1{print substr($0,I)substr($0,0,I-1)}' | less -XSF
Move NAMES after CONTAINER ID before IMAGE
dpsa | awk 'NR==1{A=index($0,"IMAGE");B=substr($0,0,A-1);C=index($0,"NAMES");D=substr($0,A,C-A-1);E=length($0);F=substr($0,C)}NR==2{print B F sprintf("%*s",length($0)-E,"") D}NR>1{print substr($0,0,A-1)substr($0,C)substr($0,A,C-A-1)}' | less -XSF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo bash -c 'sudo mkdir -p /opt/bin; curl -L https://github.com/docker/fig/releases/download/1.0.1/fig-`uname -s`-`uname -m` > /opt/bin/fig; chmod +x /opt/bin/fig' |
Get list of subject alternative names of a domain
lssan () {
[[ $# -ne 1 ]] && echo 'Usage: lssan <DOMAIN>' || {
openssl s_client -connect $1:443 -servername $1 </dev/null 2>/dev/null | \
openssl x509 -text -noout | grep 'X509v3 Subject Alternative Name' -A 1 | \
tail -1 | tr ',' '\n' | awk -F: '{print $2}'
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 443; | |
server_name t.cgh.io; | |
subs_filter_types text/html text/css text/javascript application/javascript; | |
subs_filter "(https:)?//([^.]+?)\.twimg\.com/" "//t.cgh.io/__twimg/$2/" r; | |
subs_filter "(https:)?//twitter\.com/" "//t.cgh.io/" r; | |
subs_filter "\"twitter.com\"" "\"t.cgh.io\""; | |
location ~ /__twimg/([^/]+)/ { | |
resolver 8.8.8.8; | |
proxy_pass https://$1.twimg.com; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watchgo() { | |
eval "$@ &; lastpid=\$\!;"; \ | |
fswatch -0 *.go | while read -d ""; \ | |
do pkill -P $lastpid; \ | |
eval "$@ &; lastpid=\$\!;"; \ | |
done | |
} | |
# watchgo "go run *.go" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(echo @echo ^%cd^%) > C:\WINDOWS\pwd.bat | |
(echo @copy %*) > C:\WINDOWS\cp.bat | |
(echo @move %*) > C:\WINDOWS\mv.bat | |
(echo @dir /d %*) > C:\WINDOWS\ls.bat | |
(echo @dir %*) > C:\WINDOWS\ll.bat | |
(echo @dir /b %*) > C:\WINDOWS\l.bat | |
(echo @del %*) > C:\WINDOWS\rm.bat | |
(echo @explorer %*) > C:\WINDOWS\open.bat | |
(echo @type %*) > C:\WINDOWS\cat.bat | |
(echo @more %*) > C:\WINDOWS\less.bat |