Langsung ke konten utama

Postingan

Menampilkan postingan dari April, 2019

Remote Port Forwarding

$ ssh -nNT -R 4000:localhost:3000 user@server.com The above command sets up an ssh tunnel between your machine and the server, and forwards all traffic from localhost:3000 (on your machine) to localhost:4000 (in the context of the server). So now you can connect to the locally running service on port 3000 on the server on port 4000. This trick is very useful because it allows you to be able to expose a locally running service through your server to others on the internet without having to deploy it / setup on the server.

Can't Use apt i.e. /boot is 100% full

1. Get the list of kernel images Get the list of kernel images and determine what you can do without. This command will show installed kernels except the currently running one $ sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r` You will get the list of images somethign like below: linux-image-3.19.0-25-generic linux-image-3.19.0-56-generic linux-image-3.19.0-58-generic linux-image-3.19.0-59-generic linux-image-3.19.0-61-generic linux-image-3.19.0-65-generic linux-image-extra-3.19.0-25-generic linux-image-extra-3.19.0-56-generic linux-image-extra-3.19.0-58-generic linux-image-extra-3.19.0-59-generic linux-image-extra-3.19.0-61-generic 2. Prepare Delete Craft a command to delete all files in /boot for kernels that don't matter to you using brace expansion to keep you sane. Remember to exclude the current and two newest kernel images. From above Example, it's sudo rm -rf /boot/*-3.19.0-{25,56,58,59,61,65}-*