Skip to content

Instantly share code, notes, and snippets.

View zipizap's full-sized avatar

zipizap

View GitHub Profile
zipizap@lnxp:/tmp$ ./a.sh
Handler for CTRL-C is defined - press CTRL-C or wait 5 seconds to continue
^C------- handler_CtrlC -------
>> Control-C was pressed. Exiting
zipizap@lnxp:/tmp$
zipizap@lnxp:/tmp$
zipizap@lnxp:/tmp$
zipizap@lnxp:/tmp$
zipizap@lnxp:/tmp$
zipizap@lnxp:/tmp$ ./a.sh
zipizap@lnxp:/tmp/depth0$ tree --charset ascii
.
|-- A_depth1
| `-- A_depth2
| `-- A_depth3
|-- B_depth1
| `-- B_depth2
| `-- B_depth3
`-- C_depth1
`-- C_depth2
$env | grep VAR
# nothing
$ VAR1="my_v1" VAR2="my_v2" bash -c 'env | grep VAR'
VAR1=my_v1
VAR2=my_v2
# the command after VAR1 and VAR2 has those vars defined in its environment
# but the vars only exist in the environment of that command, and not in the
# "outside" environment, as can be seen:
#######################################
## Add these lines into ~/.tmux.conf
#######################################
# set correct term
set -g default-terminal "screen-256color"
# and add an alias into ~/.bashrc
# alias 'tmux'='TERM=xterm-256color tmux'
# see http://unix.stackexchange.com/questions/1045/getting-256-colors-to-work-in-tmux
# The text
#
$ echo 'the lazy dog jumped the impossible river'
the lazy dog jumped the impossible river
# The text dumped in hexadecimal
#
$ echo 'the lazy dog jumped the impossible river' | od -ct x1
0000000 t h e l a z y d o g j u m
74 68 65 20 6c 61 7a 79 20 64 6f 67 20 6a 75 6d
source $BYOBU_PREFIX/share/byobu/keybindings/common
source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.screen.disable
escape "^Aa"
register x "^A"
bindkey "^A"
LOCAL_LISTENING_PORT=12345
REMOTE_USER="zipizap"
REMOTE_SERVER="my.server.com"
ssh -N -D $SOCKS_LISTENING_PORT $REMOTE_USER@$REMOTE_SERVER sleep 60
java -Dhttp.proxyHost=YourProxyIpOrUrl.com -Dhttp.proxyPort=8080 -Dhttps.proxyHost=YourProxyIpOrUrl.com -Dhttps.proxyPort=8080 -Xmx800m -jar minecraft.jar
#Add this to /etc/fstab
/dev/sda1 /Windows ntfs-3g defaults,uid=1000,gid=1000,dmask=027,fmask=137 0 0
#Run command as user_x, within a login environment
sudo -u user_x -i echo This is my command and should not be quoted