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
IFS="$(printf '\n\t')" | |
mkdir -p ~/.ssh | |
if ! [[ -f ~/.ssh/authorized_keys ]]; then | |
echo "Creating new ~/.ssh/authorized_keys" | |
touch ~/.ssh/authorized_keys | |
fi | |
if type "curl" > /dev/null; then |
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 docker stop $(sudo docker ps -a -q) | |
sudo docker rm $(sudo docker ps -a -q) |
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
var regExp = /_test_/; | |
db.getMongo().getDBNames().filter(function(name){ | |
return name.match(regExp) | |
}).forEach(function(name){ | |
print(name); | |
var thedb = db.getMongo().getDB( name ); | |
thedb.dropDatabase(); | |
}); |
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
# rsync -aAXvzh --progress --delete --ignore-errors --delete-excluded <path> <remote_host>:<remote_path> | |
rsync -aAXvzh --progress --delete --ignore-errors --delete-excluded --exclude={"/home/*/.cache/*","/home/*/Movies/*","/home/*/Music/*","/home/*/.Skype/*"} -- " /home /root /etc remote_host:~/backups/`hostname` |
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
location /monit { | |
proxy_pass http://127.0.0.1:2812; | |
proxy_set_header Host $host; | |
rewrite ^/monit/(.*) /$1 break; | |
proxy_ignore_client_abort on; | |
} |
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
#!/bin/sh | |
HOMEDIR=${PWD} | |
if [ -f .nodbs ] ; then | |
echo ".nodbs flag present, db import skipped"; | |
exit 0 | |
fi | |
for d in */ ; do |
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
find -type d -name "p-env" -exec rm -rf "{}" \; |
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
import java.security.NoSuchAlgorithmException; | |
public class BcryptHashPassword | |
{ | |
public static void main(String[] args) throws NoSuchAlgorithmException | |
{ | |
String originalPassword = "secretpasswd"; | |
String generatedSecuredPasswordHash = BCrypt.hashpw(originalPassword, BCrypt.gensalt(10)); | |
System.out.println(generatedSecuredPasswordHash); | |
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
import cStringIO | |
import os | |
def application(environ, start_response): | |
headers = [] | |
headers.append(('Content-Type', 'text/plain')) | |
write = start_response('200 OK', headers) | |
input = environ['wsgi.input'] | |
output = cStringIO.StringIO() |