(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
:
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 |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
#!/bin/bash | |
readonly PROGNAME=$(basename "$0") | |
function clean_empty_folders(){ | |
local PROC_ID="$$" | |
local PROC_LS="$(ps -e aux | grep "${PROGNAME} -" | grep -v -e "${PROC_ID}" | awk '{print $2}')" | |
if [ "$(echo ${PROC_LS} | wc -l)" -gt 0 ]; then | |
kill -9 ${PROC_LS} 2> /dev/null |
gcloud computer instance create
methodgcloud compute images create example-image --source-disk example-disk --source-disk-zone ZONE
#!/bin/bash | |
ARRAY=() | |
while read -r line; do | |
ARRAY+=("$line") | |
done <<< "$(find /tmp -type f)" | |
echo "${ARRAY[@]}" |