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 | |
| # Called by "git push" after it has checked the remote status, | |
| # but before anything has been pushed. | |
| # | |
| # If this script exits with a non-zero status nothing will be pushed. | |
| # | |
| # Steps to install, from the root directory of your repo... | |
| # 1. Copy the file into your repo at `.git/hooks/pre-push` | |
| # 2. Set executable permissions, run `chmod +x .git/hooks/pre-push` |
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
| ssh [remote_username]@[remote_address] mysqldump -u[mysql_remote_user] -hlocalhost -p[mysql_remote_password] [mysql_remote_database] > /tmp/mydump && mysql -u[mysql_local_user] -p[mysql_local_password] [mysql_local_database] < /temp/mydump |
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 Queue = function(){ | |
| return (function(q,p,n,d,e){ | |
| return { | |
| enqueue : e=function(fn){ | |
| q.splice(++p, 0,fn||n); | |
| }, | |
| dequeue : d=function(){ | |
| return (q.shift()||n).call(null, function(){d()},p=-1) | |
| } | |
| } |
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 flags = (function(masks, flags){ | |
| return function(flag, active){ | |
| (active == 1 && (flags|=masks[flag])) || (active == 0 && (flags&=~masks[flag])); | |
| return !!(flags & masks[flag]); | |
| } | |
| })({ | |
| 'state_1' : 0x1, | |
| 'state_2' : 0x2, | |
| 'state_3' : 0x4, | |
| },0x0) |
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
| ssh [remote_username]@[remote_address] mongodump --host 127.0.0.1 --db [database_name] --out /tmp/mydump; | |
| scp -r [remote_username]@[remote_address]:/tmp/mydump /tmp/mydump && mongorestore --host 127.0.0.1 --db [database_name] /tmp/mydump/[database_name]/ |
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
| openssl dgst -md5 /path/of/filename.ext | |
| openssl dgst -sha1 /path/of/filename.ext | |
| openssl dgst -ripemd160 /path/of/filename.ext |
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
| git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
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(text, input) { | |
| input | |
| .attr('id', 'input_injector') | |
| .appendTo('body') | |
| .val(text) | |
| .css({ | |
| 'position': 'absolute', | |
| 'top': '0', | |
| 'left': '0', | |
| 'height': '100%', |
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
| mongo localhost/<database> --quiet --eval "DBQuery.shellBatchSize = Infinity;db.<collection>.find().shellPrint()" > ~/<filename.json> | |
| mongoimport -d <database> -c <collection> <filename.json> |
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
| cat ~/.ssh/id_rsa.pub | ssh username@hostname "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" |
OlderNewer