How to generate a very nice colored desktop background with the command line.

The Linux command line is very useful and it can even generate you a nice wallpaper image using just the shell and ImageMagick. The example below will generate a 3440×1440 pixels wallpaper image using just the random data from /dev/urandom. ┌─[jason@jason-desktop]─[~/Documents] └──╼ $mx=320;my=256;head -c "$((3*mx*my))" /dev/urandom | convert -depth 8…

Read More

Youtube-dl automatic update not working.

The updates for youtube-dl do not work anymore on Ubuntu, but it can be updated manually. Download the script here: https://youtube-dl.org/downloads/latest/youtube-dl. Then copy the script over the top of the existing one in /usr/bin and then make sure it has the executable flags 755. This is very easy. Download it…

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]…

Read More

Very interesting shell scripting example.

This simple shell script will pick a random sentence from a text file. This is made up of multiple sentences from parts of the text file merged into one long sentence. words.sh1 2 3 4 5 #!/bin/sh   numwords=$(shuf -i 14-88 -n 1) words=$(shuf -n $numwords 122-0.txt | cut -d$”…

Read More

How to configure bash to have nice auto-completion.

Put this code in your ~/.inputrc file to enable nice auto-completion in the bash shell prompt. ~\.inputrc1 2 3 4 5 6 7 8 9 10 $include /etc/inputrc set completion-ignore-case on set completion-query-items -1 set show-all-if-unmodified on set show-all-if-ambiguous off set colored-completion-prefix on set colored-stats on set visible-stats on "\C-j":…

Read More

How to easily get information about your CPU on Linux.

Getting information about your CPU on Linux is very easy. There are many ways to do this. The cpufreq app is one good way to get the current CPU frequency. 4.4 Thu Jun 04 jason@Yog-Sothoth 0: $ cpufreq-info -f -m 988 MHz4.4 Thu Jun 04 jason@Yog-Sothoth 0: $ cpufreq-info -f…

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 |…

Read More

Very useful bash shell tips for Ubuntu.

There are some tips for Ubuntu that are not as well known as they should be. One tip is searching the bash history. Press Control-R and a prompt will appear. (reverse-i-search)`sudo’: sudo apt-get install libxml2-utils(reverse-i-search)`sudo’: sudo apt-get install libxml2-utils Type a search like “sudo” for example, and the first search…

Read More

Very nice bash shell prompt and other useful Linux information.

Very nice bash shell prompt This is a very useful Linux shell prompt with color. export PS1="\[\033[38;5;165m\]\d\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;51m\]\W\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;84m\]\H\[$(tput sgr0)\]@\[$(tput sgr0)\]\[\033[38;5;229m\]\u\[$(tput sgr0)\]:\l>\[$(tput sgr0)\]\[\033[38;5;231m\]\\$\[$(tput sgr0)\] "export PS1="\[\033[38;5;165m\]\d\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;51m\]\W\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;84m\]\H\[$(tput sgr0)\]@\[$(tput sgr0)\]\[\033[38;5;229m\]\u\[$(tput sgr0)\]:\l>\[$(tput sgr0)\]\[\033[38;5;231m\]\\$\[$(tput sgr0)\] " This prompt will look like this. Mon Mar…

Read More

How to use the command line to change GTK settings easily.

The settings used by the file chooser in MATE or Gnome can be changed easily with the command line. The gsettings utility makes this easy. This example will alter the Firefox file chooser, it will have directories listed first, in descending order, sorted by date modified. gsettings set org.gtk.Settings.FileChooser sort-column…

Read More

Some very useful VIM tricks for the Linux/UNIX user.

VIM is a very useful and versatile editor for Linux. This is how to use it to its full potential. Some great VIM tricks to help for a Linux user or programmer. To read the output of a command into a text file, use the :r command in the command…

Read More