Skip to content

Instantly share code, notes, and snippets.

du -hc --max-depth=1
@balamaci
balamaci / SSH tunnel
Last active January 2, 2016 09:08
SSH tunnel for mysql
ssh -p 3333 -L local_port:remote_host:remote_port user@machine
- after a connection to 'machine' is established, all tunneled connections will be directed to the 'remote_host'.
1. ssh -p 3333 -L 3307:localhost:3306 sbalamaci@machine1.ocean.digital
2. ssh -p 3333 -L 3307:82.67.89.3:3306 sbalamaci@machine1.ocean.digital
it matters to which mysql interface the bind is done.
careful with testing the setup with mysql client connecting to 'localhost' as it will bypass network and connect through a socket file. So even if you messed the setup it will connect to a local mysql instance if available.
to be ran on server for desktop publishing.
x11vnc -safer -localhost -nopw -noxdamage -ncache 10 -once -display :0
@balamaci
balamaci / SCP_examples
Created November 10, 2012 16:27
SCP examples
Copy the file "foobar.txt" from a remote host to the local host:
$ scp your_username@remotehost.edu:foobar.txt /some/local/directory
Copy the file "foobar.txt" from the local host to a remote host:
$ scp foobar.txt your_username@remotehost.edu:/some/remote/directory
Copy the directory "foo" from the local host to a remote host's directory "bar":
$ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar
Copy the file "foobar.txt" from the local host to a remote host using port 2264: