wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-name=windows --domains {domain-name} --no-parent {http://domain-name/}
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. Login in to the server | |
----- Performed only once -------- | |
2. Ensure SSH is installed | |
$ ssh -v | |
3. Setup default identity | |
a) $ ssh-keygen | |
(Choose the default location i.e. ~/ssh/id_rsa) | |
(Dont enter any passphrase) |
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
#!/bin/bash | |
if [[ ! -d .git ]]; then | |
echo "Fatal error: not a git repository" | |
exit 1 | |
fi | |
if [[ $# < 1 ]]; then | |
git status | |
exit 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
import json | |
import sys | |
from pprint import pprint | |
jdata = open(sys.argv[1]) | |
data = json.load(jdata) | |
print data["db_name"] | |
print data["mysql"] |
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
#!/bin/bash | |
# Initialize Global Variables | |
db_name= | |
mysql_root= | |
server_ip= | |
server_user= | |
server_pass= | |
server_path= | |
project= |
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
function cfDecodeEmail(encodedString) { | |
var email = "", r = parseInt(encodedString.substr(0, 2), 16), n, i; | |
for (n = 2; encodedString.length - n; n += 2){ | |
i = parseInt(encodedString.substr(n, 2), 16) ^ r; | |
email += String.fromCharCode(i); | |
} | |
return email; | |
} |
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
top -b1 -n1 | grep Z | |
ps -A -ostat,ppid | grep -e '[zZ]'| awk '{ print $2 }' | uniq | xargs ps -p | |
kill $(ps -A -ostat,ppid | grep -e '[zZ]'| awk '{ print $2 }') |
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
kill $(ps aux | grep 'ssh-agent' | awk '{print $2}') |
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
var allowPaste = function(e){ | |
e.stopImmediatePropagation(); | |
return true; | |
}; | |
document.addEventListener('paste', allowPaste, true); |
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
#!/bin/bash | |
## reference: https://unix.stackexchange.com/questions/40638/how-to-do-i-convert-an-animated-gif-to-an-mp4-or-mv4-on-the-command-line | |
ffmpeg -i IMG_a.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video_a.mp4 |