(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
mongo --eval 'db.getMongo().getDBNames().forEach(function(i){db.getSiblingDB(i).dropDatabase()})' --port=27015 test |
// execute on ready state | |
jQuery.extend({ | |
getQueryParameters : function (str) { | |
return (str || document.location.search).replace(/(^\?)/, '').split("&").map(function (n) { | |
return n = n.split("="), this[n[0]] = n[1], this | |
}.bind({}))[0]; | |
} | |
}); |
// This will parse a delimited string into an array of | |
// arrays. The default delimiter is the comma, but this | |
// can be overriden in the second argument. | |
function CSVToArray( strData, strDelimiter ){ | |
// Check to see if the delimiter is defined. If not, | |
// then default to comma. | |
strDelimiter = (strDelimiter || ","); | |
// Create a regular expression to parse the CSV values. | |
var objPattern = new RegExp( |
// https://github.com/Monwara/node-logging/blob/master/logging.js | |
function prettyPrintObj(o, excludes) { | |
excludes = typeof excludes === 'undefined' ? EXCLUDES : excludes; | |
if (!o || typeof o !== 'object' || !Object.keys(o).length) { | |
return '*'.grey + ' ' + 'n/a'.green + '\n'; | |
} | |
var rows = []; |
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
# NEW WAY / EASY WAY | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb | |
sudo dpkg -i elasticsearch-1.1.1.deb |
Abbreviations
M- means hold the META or EDIT or ALT key down while typing . If there is no META, EDIT or ALT key, instead press and release the ESC key and then type in quick succession.
How do I switch between windows?
You can press M-n/M-p to go to the next/previous window, or M-N where N is 1-9. You can also press M-w to bring out a list of all the windows. In the window list, you can select a row and press return to go to that window.
How can I close a window?
#!/bin/sh | |
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
set -e | |
# Must be a valid filename | |
NAME=foo | |
PIDFILE=/var/run/$NAME.pid | |
#This is the command to be run, give the full pathname | |
DAEMON=/usr/local/bin/bar |
#!/bin/bash | |
# | |
# httpd Startup script for the Apache HTTP Server | |
# | |
# chkconfig: - 85 15 | |
# description: The Apache HTTP Server is an efficient and extensible \ | |
# server implementing the current HTTP standards. | |
# processname: httpd | |
# config: /etc/httpd/conf/httpd.conf | |
# config: /etc/sysconfig/httpd |