How to have a blinking $ sign in your Linux prompt. This is very interesting indeed.

This is my current Linux shell prompt. This will show the current Github branch if you are in the folder containing a Git project. But I have added something cool. git_branch() { git branch 2> /dev/null | sed -e ‘/^[^*]/d’ -e ‘s/* \(.*\)/(\1)/’ }   PS1=’┌──[\[\033[38;5;160m\]\u\[$(tput sgr0)\]@\[$(tput sgr0)\]\[\033[38;5;75m\]\H\[$(tput sgr0)\]]─[\w]\n└──╼ $(git_branch) ╼ \[\033[34;5;9m\]\$\[$(tput sgr0)\] ‘git_branch() { … Read more

A much better way to save audio from Youtube with youtube-dl.

Saving music from Youtube is fun. I am going to show how to save in good quality using youtube-dl by itself. This command will do it in one go. youtube-dl -f 140 https://www.youtube.com/watch?v=eb-2ljQDYFU –embed-thumbnail –extract-audio –audio-format mp3youtube-dl -f 140 https://www.youtube.com/watch?v=eb-2ljQDYFU –embed-thumbnail –extract-audio –audio-format mp3 This is the command in action. This gets the music in … Read more

Some very useful Linux tips and tricks.

To read a file from the Internet using wget and print it in the terminal, use this command. ┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.mjh.nz/au/Brisbane/raw-tv.m3u8┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.mjh.nz/au/Brisbane/raw-tv.m3u8 View an image from the Internet with wget and the ImageMagik display utility. ┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.4cdn.org/g/1603231784644.png | display┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.4cdn.org/g/1603231784644.png … Read more

How to get information about a video file with the Linux command line easily.

Getting information about a video file on Linux with the command line is very easy. I will show how you can easily find the resolution of a video and the format. This example below will return the resolution of a video file. jason@jason-desktop:~/Videos$ ffprobe XR_3DA_2019_03_16_19_22_35_777.avi 2>&1 | grep -E ‘[[:digit:]]{3,}x[[:digit:]]{3,}’ | awk ‘{print $11}’ 1920x1080jason@jason-desktop:~/Videos$ … Read more

Set a very nice Linux shell prompt and very useful aliases.

This addition to your .bashrc file will give you a very nice shell prompt and colorful output of the ls command. This looks very stylish indeed. # set variable identifying the chroot you work in (used in the prompt below) if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi   … Read more

How to print a list of all ABC News articles with the Linux command line.

This one-liner will print a listing of all ABC News articles from the XML RSS feed. This is a very good way to extract text from an RSS feed or other XML files. curl -s http://www.abc.net.au/news/feed/2942460/rss.xml | grep ‘media:description’ | awk -F "[<>]" ‘{print $3}’; echo "$desc"curl -s http://www.abc.net.au/news/feed/2942460/rss.xml | grep ‘media:description’ | awk -F … Read more

How to read ID3 data from an MP3 file on Linux with the command line.

Reading ID3 data from an MP3 file on Linux is very easy with the ffmpeg suite. The ffprobe command can do this very easily. This example will return the title and artist of the MP3 file. 4.4 Mon Mar 02 jason@Yog-Sothoth 0: $ ffprobe -loglevel quiet -show_entries format_tags=artist,title 02\ Snake\ Hips.mp3 [FORMAT] TAG:title=Snake Hips TAG:artist=The … Read more

How to easily download whole albums and tracks from Bandcamp on Linux.

The Bandcamp website hosts a lot of music, and it is very easy to download music from the website easily on Linux. Firstly, install the Python pip3 addon. 4.4 Sat Jan 18 jason@Yog-Sothoth 0: $ sudo apt install python3-pip4.4 Sat Jan 18 jason@Yog-Sothoth 0: $ sudo apt install python3-pip Then, install the Python Bandcamp script. … Read more

Miscellaneous Linux commands. Some useful tips for the Linux BASH prompt.

The ldd command will print out a list of all libraries that an executable is linked against. This is the output for a simple “Hello World” command. 20:15:31 tux@linux-v415 ($ ldd ./a.out linux-vdso.so.1 =&gt; (0x00007fff171ff000) libc.so.6 =&gt; /lib64/libc.so.6 (0x00007fe56ef58000) /lib64/ld-linux-x86-64.so.2 (0x00007fe56f2e8000) 20:15:49 tux@linux-v415 ($20:15:31 tux@linux-v415 ($ ldd ./a.out linux-vdso.so.1 =&gt; (0x00007fff171ff000) libc.so.6 =&gt; /lib64/libc.so.6 (0x00007fe56ef58000) … Read more

Some very useful bash scripting tips for testing the output of a program.

This simple shell script will test your Internet connection and then tell you if it is up or not. wgetvar=$(wget -q –tries=3 –timeout=20 –spider http://google.com)   if [ $? -eq ‘0’ ] then echo "Internet is up." else #some logging echo "Internet is down.." fiwgetvar=$(wget -q –tries=3 –timeout=20 –spider http://google.com) if [ $? -eq ‘0’ … Read more

How to copy text to a pastebin easily, and some other very useful tips.

This command will copy text to a pastebin online using curl. 4.4 Mon Sep 16 jason@Yog-Sothoth 0: $ echo "This is a message I want to save online." | curl -F file=@- https://0x0.st/4.4 Mon Sep 16 jason@Yog-Sothoth 0: $ echo "This is a message I want to save online." | curl -F file=@- https://0x0.st/ This … Read more

Very useful Linux shell tips and tricks.

Add a new directory to the PATH to allow running an application from it without typing the full path every time you wish to run it. PATH=$PATH:/usr/local/binPATH=$PATH:/usr/local/bin Or you may have something like this in your .bashrc to add this every time you log in. PATH="/home/jason/perl5/bin${PATH:+:${PATH}}"; export PATH;PATH="/home/jason/perl5/bin${PATH:+:${PATH}}"; export PATH; This can also be set … Read more