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
ssh -t bastion -L localhost:port:remotehost:port | |
use jconsole, visualvm, zmc, etc. | |
-L [bind_address:]port:host:hostport | |
-L [bind_address:]port:remote_socket | |
-L local_socket:host:hostport | |
-L local_socket:remote_socket | |
Specifies that connections to the given TCP port or Unix socket on the local (client) host are to be forwarded to the given host and port, or Unix | |
socket, on the remote side. This works by allocating a socket to listen to either a TCP port on the local side, optionally bound to the specified | |
bind_address, or to a Unix socket. Whenever a connection is made to the local port or socket, the connection is forwarded over the secure channel, |
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-machine start | |
eval $(docker-machine env default) | |
docker ps |
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
The full scale (which is explained) is: | |
10 - Wrote the book on it (there must be a book) | |
9 - Could have written the book, but didn't. | |
8 - Deep understanding of corner cases and esoteric features. | |
7 - Understanding and (appropriate) usage of most lesser known features. | |
6 - Can develop large programs and deploy new systems from scratch. | |
5 - Can develop/deploy larger programs/systems using all basic (w/o book) and more esoteric features (some w/ book, some without) | |
4 - Can develop/deploy medium programs/systems using all basic (w/o book) and a few esoteric features (w/ book). Understands enough about internals to do nontrivial troubleshooting. | |
3 - Can utilize basic features without much help, manage a small installation competently. |
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
CREATE TABLE employees (company varchar, name varchar, age int, role varchar, primary key (company, name, age)) with clustering order by (name desc, age asc); |
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
upstream foo_backend { | |
server 127.0.0.1:8080; | |
} | |
server { | |
listen 443 ssl; | |
ssl_certificate /etc/nginx/ssl/foo.com.bundle.crt; | |
ssl_certificate_key /etc/nginx/ssl/foo.com.key; | |
ssl_ciphers RC4:HIGH:!aNULL:!MD5; | |
ssl_prefer_server_ciphers on; |
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
// Reset the index to the desired tree. | |
git reset <specific sha> | |
// Move the branch pointer back to the previous HEAD. | |
git reset --soft HEAD@{1} | |
git commit | |
git push origin master |
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
# By commit hash | |
git for-each-ref --sort=-committerdate refs/heads/ | |
# By name, date. | |
git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(authorname) %(refname:short)' |
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
# Get a list of existing remote branches | |
git fetch origin | |
# Checkout the branch from that branch | |
git checkout -b branch_name origin/branch_name | |
git pull origin branch_name | |
git push origin branch_name # yields 'Everything up-to-date' |
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
rm -rf _deploy | |
mkdir _deploy | |
cd _deploy | |
git init | |
git remote add origin [email protected]:username/username.github.io.git | |
git pull origin master | |
cd .. | |
bundle exec rake deploy |
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
Array.prototype.myinject = function () { | |
var obj = Object(this); | |
var base; | |
var callback; | |
if (arguments.length === 2) { | |
base = arguments[0]; | |
callback = arguments[1]; | |
} else if (arguments.length === 1) { | |
callback = arguments[0]; |
NewerOlder