start new:
tmux
start new with session name:
tmux new -s myname
| –ctrl a c -> create new window | |
| –ctrl a A -> set window name | |
| –ctrl a w -> show all window | |
| –ctrl a 1|2|3|… -> switch to window n | |
| –ctrl a ” -> choose window | |
| –ctrl a ctrl a -> switch between window | |
| –ctrl a d -> detach window | |
| –ctrl a ? -> help | |
| –ctrl a [ -> start copy, move cursor to the copy location, press ENTER, select the chars, press ENTER to copy the selected characters to the buffer | |
| –ctrl a ] -> paste from buffer |
| ========================================== | |
| BASH SCRIPTING ========================================== | |
| ========================================== TEST COMMAND | |
| ========================================== | |
| Invoke: bash [options] file | |
| Shebang: #!/usr/bin/env bash Test: test expression | |
| In script: [ expression ] | |
| ========================================== Alternate: [[ espression ]] | |
| LOOP Does not split string words | |
| ========================================== Does not expand pathglobs* |
| ANSI_X3.4-1968 ANSI_X3.4-1986 ASCII CP367 IBM367 ISO-IR-6 ISO646-US ISO_646.IRV:1991 US US-ASCII CSASCII | |
| UTF-8 | |
| ISO-10646-UCS-2 UCS-2 CSUNICODE | |
| UCS-2BE UNICODE-1-1 UNICODEBIG CSUNICODE11 | |
| UCS-2LE UNICODELITTLE | |
| ISO-10646-UCS-4 UCS-4 CSUCS4 | |
| UCS-4BE | |
| UCS-4LE | |
| UTF-16 | |
| UTF-16BE |
| FILE SPACING: | |
| # double space a file | |
| sed G | |
| # double space a file which already has blank lines in it. Output file | |
| # should contain no more than one blank line between lines of text. | |
| sed '/^$/d;G' |
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS:
Press minus + shift + s and return to chop/fold long lines!
SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.
apt-get install sshpass
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!