Category: Command Line

Run Webserver with current folder as root

Different ways to run a webserver using the current directory as root. Useful to serve static files.

Pass Command Line Arguments to npm

If you want to pass command line arguments to `npm` scripts, use the `–` separator.

Screen Mirroring from Android phone to Linux

Use [scrcpy](https://github.com/Genymobile/scrcpy)(screen copy) to mirror an Android device – and see/use it from your linux system.

Install and Configure Docker

Install Docker on Ubuntu and Configure it to use a non-default directory.

Remote Port Forwarding using SSH Tunnel

If you want someone on the internet to access a service/port on your local system(and you have access to a remote server), you can use SSH Tunnel to do this.

Rename Images Based on Exif Date

Renames all the files in the current folder based on the Exif date of that image. You’ll need the ‘jhead’ command tool – use apt-get to install it.

Database Data to Download Variables

Gets data from a MySql database, splits the data into separate columns, then uses one column in a URL to download something – and uses other column to name the file thats downloaded

Search Wikipedia from Command Line

Get the intro paragraph of any wikipedia article using this trick… dig +short txt “<keyword>”.wp.dg.cx

Encrypt/Decrypt files using GPG

Encrypt/Decript files in linux #Encypt… gpg -c <Source File> #Decrypt… gpg <Encrypted File>

Compress the Big Files

Compress the big image files