This file contains 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
//sample data | |
let yAxis = [5,15] | |
let xAxis = [140, 190] | |
let dataSet = [ | |
[140,150,15], | |
[160,170,10], | |
[170,180,8], | |
[180,190,5], | |
] |
This file contains 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
docker exec -it container_name kill -USR2 1 |
This file contains 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
res=0; for dir in $a; do val=$(du -s /dir_path | awk '{ print $1 }'); res=$(($val+$res)); done; | |
#The result is in KB by default |
This file contains 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
# 1 - Report file system disk space usage | |
# note: -h: human readable. print sizes in power of 1024. | |
$ df -h | |
# would print: | |
# Filesystem Size Used Avail Use% Mounted on | |
# udev 7.7G 0 7.7G 0% /dev | |
# tmpfs 1.6G 9.0M 1.6G 1% /run | |
# /dev/nvma1n1p1 59G 34G 25G 59% / |
This file contains 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
let states = { | |
'red': {'nextSlot':'green', 'await':10000, 'exec':function(element){ | |
element.className = 'red' | |
setTimeout(function(){ | |
element.className = '' | |
states.green.exec(document.getElementById(states.red.nextSlot)) | |
}, states.red.await) | |
}}, | |
'green': {'nextSlot':'yellow','await':10000, 'exec':function(element){ |
This file contains 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
git blame -L 2014,+20 -- <file path> |
This file contains 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
scp -r -i mykey.pem [from_directory_or_file] [host_name]:[destination_location] |
This file contains 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
redis="redis-cli -h host_name" \ | |
$redis keys "*matching_key_pattern*" | awk -F':' '{print $2}' | awk '!x[$0]++' | xargs -I{} $redis zadd temp-user_ids {} {} |
This file contains 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
$ awk '!x[$0]++' | |
#which is a shorthand for: | |
$ awk ' !seen[$0] { print $0 } 1 { seen[$0]++ }' |
This file contains 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
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
location ^~ /endpoint { | |
alias /home/www/html; | |
try_files $uri $uri/ @nested; |
NewerOlder