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

Get some nice system information in real time with a nice utility.

There are many ways to get system information with various Linux utilities. But apps like neofetch are nice. The gotop utility for Ubuntu is a good way to display real-time system information in an Xterm. Install this nice utility this way. 4.4 Sat Feb 15 jason@Yog-Sothoth 0: $ sudo snap install gotop4.4 Sat Feb 15 … 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 => (0x00007fff171ff000) libc.so.6 => /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 => (0x00007fff171ff000) libc.so.6 => /lib64/libc.so.6 (0x00007fe56ef58000) … Read more

How to get a nice waveform display with the MPV media player on Linux.

Play a music file in your terminal with a nice visualization, using this one-liner. This is very nice way to get a simple animation whilst playing a music file. MPV does support a massive amount of playing options, and using a visualization while playing music is another hidden feature. mpv –config=no –quiet –vo=tct –lavfi-complex='[aid1]asplit[ao][a1];[a1]avectorscope=r=25:m=lissajous_xy:bc=200:gc=100:rc=75:bf=5:gf=3:rf=1:zoom=2[vo]’ https://www.gnu.org/music/markushaist-free-software-song.oggmpv … Read more

Get information about your Macintosh machine using the command line.

Get the current status of your battery with this command. deusexmachina:~ jason$ sudo systemstats | grep "Battery Power" Battery Power: -8095 mW (-15.5 %/hr) Battery Power: -8034 mW (-15.6 %/hr) Battery Power: -6774 mW (-13.3 %/hr) Battery Power: -8080 mW (-15.3 %/hr) Battery Power: -7866 mW (-15.3 %/hr)deusexmachina:~ jason$ sudo systemstats | grep "Battery Power" … Read more

How to play a movie with mpv in your terminal window.

This command will display an image in your terminal. Very useful for viewing images without using an external image viewer. mpv –no-config –pause –vo=tct https://stallman.org/rms.jpgmpv –no-config –pause –vo=tct https://stallman.org/rms.jpg Play a movie in your terminal window with mpv. 4.4 Thu Nov 29 jason@Yog-Sothoth 0: $ mpv –no-config –vo=tct fc4.mp44.4 Thu Nov 29 jason@Yog-Sothoth 0: $ … Read more

Get nice system information on Macintosh OS with the command line.

Get information about apps installed on your Macintosh PC with the lsappinfo command. Use grep as shown below to find out information about a certain app, i.e Firefox in this case. deusexmachina:~ jason$ lsappinfo | grep Firefox 24) "Firefox" ASN:0x0-0x2a02a: bundle path="/Applications/Firefox.app" executable path="/Applications/Firefox.app/Contents/MacOS/firefox" 26) "FirefoxCP WebExtensions" ASN:0x0-0x2c02c: bundle path="/Applications/Firefox.app/Contents/MacOS/plugin-container.app" executable path="/Applications/Firefox.app/Contents/MacOS/plugin-container.app/Contents/MacOS/plugin-container" parentASN="Firefox" ASN:0x0-0x2a02a: (inferred) … Read more

How to create a Dot Matrix banner with Linux and many other cool tricks.

The factor command for Linux will find the prime factors of any number that is entered as STDIN. Look below for an example. 4.4 Thu Aug 30 jason@Yog-Sothoth 0: $ factor 2018 2018: 2 1009 Use this command to create an old-fashioned Dot-Matrix printer banner. This is very useful if there is a Dot-Matrix printer … Read more

How to ssh into a Linux machine easily from your Ubuntu PC.

SSH is a great way to connect to a remote Linux server over a network. This is how to use SSH easily yourself. Firstly, install SSH on the remote machine to allow remote connections if it is a server you are setting up. sudo apt install sshsudo apt install ssh Then run this command on … Read more

Useful tips for a programmer on a Macintosh machine. Install GCC.

How to install the GCC compiler for Macintosh programming on a Macintosh Air. This simple command will install the GCC compiler collection and the make command on a Macintosh. This enables programming console apps on a Macintosh machine. These instructions are for Macintosh OSX Sierra. May not be the same on an older Macintosh machine. … Read more

How to get information about a window on your Linux desktop.

Getting detailed information about a window on your Linux desktop is very easy. The Xwininfo command is very useful for getting this information. Run the command and then click a window to get detailed information about a window. jason@jason-desktop:~$ xwininfojason@jason-desktop:~$ xwininfo Absolute upper-left X: 498 Absolute upper-left Y: 47 Relative upper-left X: 4 Relative upper-left … Read more

How to change the Virtual Terminal font in Debian and Ubuntu easily.

To change the font in the Virtual Terminal in Debian or Ubuntu/Linux Mint, run this command. sudo dpkg-reconfigure console-setupsudo dpkg-reconfigure console-setup This lets you select the various character sets and fonts to customize your virtual terminal. jason@jason-desktop:~$ sudo dpkg-reconfigure console-setup [sudo] password for jason: Your console font configuration will be updated the next time your … Read more

How to print out a list of all BBC news headlines with the command line. This is very cool.

This simple one-liner will print out all of the news headlines from the BBC news website in a simple text format. This is useful if you want to do something with a list like this. Or if you just want a listing to see if there is anything interesting happening. Updated command for 2017, as … Read more

How to add a Red Hat Linux 7.2 subscription after installation.

To add a subscription after installing Red Hat Enterprise Linux 7.2, type this command as root. [root@localhost jason]# subscription-manager register –username USERNAME –password "PASSWORD"[root@localhost jason]# subscription-manager register –username USERNAME –password "PASSWORD" This will setup your Red Hat subscription. Then enter this command. This will refresh all of the information on your machine. [root@localhost jason]# subscription-manager … Read more

Some interesting and useful Linux commands and BASH tricks.

A useful awk implementation to count the number of entries in the /etc/passwd file. john@deusexmachina:~$ sudo awk -F: ‘{ print $1 }’ /etc/passwd | wc -l 34john@deusexmachina:~$ sudo awk -F: ‘{ print $1 }’ /etc/passwd | wc -l 34 And the quintessential “Hello World” in Awk. john@deusexmachina:~$ awk ‘BEGIN { printf "%s, %s\n", "Hello", "World!" … Read more

How to toggle the caps lock key with the command line in Linux Mint.

Disable the caps lock key in the command lineDisable caps lock in the GUI Disable the caps lock key in the command line The Caps Lock key may be toggled using the command line. The xdotool utility will do this for you. Firstly, install the utility. jason@jason-virtual-machine ~ $ sudo apt install xdotooljason@jason-virtual-machine ~ $ … Read more