This command will capture a screenshot of the desktop and save it to the home directory. [email protected]:~$ import -window root "$HOME/$(date ‘+%y%m%d_%T’).png"[email protected]:~$ import -window root "$HOME/$(date ‘+%y%m%d_%T’).png" This is how to do this with the scrot utility. [email protected]:~$ scrot Desktop-%H:%M:%S-%d-%[email protected]:~$ scrot Desktop-%H:%M:%S-%d-%m.jpg Characters preceded by a ‘%’ are interpreted by strftime(2). See man strftime for …

This is a nice script to build a custom PS1 that looks awesome and is simple too. export PROMPT_COMMAND=__prompt_command function __prompt_command() { local EXIT="$?"   local DEFAULT=’\[\e[0m\]’   local RED=’\[\e[0;31m\]’ local GREEN=’\[\e[0;32m\]’ local DARK_GRAY=’\[\e[0;90m\]’ local PURPLE=’\[\e[0;35m\]’ local YELLOW=’\[\e[0;33m\]’   PS1="\n${GREEN}\t${DEFAULT} "   if [ "$EXIT" != "0" ]; then PS1+="${RED}$EXIT${DEFAULT} " else PS1+="$EXIT${DEFAULT} " fi …

Search and replace on the bash shell is very useful for various one-liner shell commands. The below example shows how to replace a # character with a * character. [email protected]:/mnt/c/Users/johnc/Documents$ cat ip.c | sed ‘s/#/*/gi;’ *include <stdio.h>   int main() { printf(".");   return 0; }[email protected]:/mnt/c/Users/johnc/Documents$ cat ip.c | sed ‘s/#/*/gi;’ *include <stdio.h> int main() …

To list all non-free Linux packages that are installed on your Linux Mint system, use this one-liner. This prints out a list of all non-free packages that are installed on a system. [email protected] ~ $ dpkg-query -W -f ‘${Section}/${Package}\n’ | grep -E ‘^(contrib|multiverse|non-free|partner|restricted)/’ | sort contrib/kernel/virtualbox-guest-dkms contrib/misc/virtualbox-guest-utils contrib/x11/[email protected] ~ $ dpkg-query -W -f ‘${Section}/${Package}\n’ | …

This one-liner will convert binary numbers to decimal. Very easy to do in the bash shell. [email protected]:~$ echo "$((2#01110100011000010110101101))" [email protected]:~$ echo "$((2#01110100011000010110101101))" 30508461 This is how to convert binary to Hexadecimal. [email protected]:~$ printf ‘%x\n’ "$((2#1111111))" [email protected]:~$ printf ‘%x\n’ "$((2#1111111))" 7f These very useful one-liners should make converting number values even easier.

Dragonfly BSD. One very secure operating system.This is running in qemu, the emulator for PC operating systems. It is a live CD and has the option to install the operating system or use the system as root. Once logged in you can use gcc and vi, all the familiar UNIX/GNU tools. I could get to …

Generate secure passwords for your user accounts The pwgen command will generate a set of random passwords that may be used to secure your user account. Type this command to install this utility. [email protected]:~# apt-get install [email protected]:~# apt-get install pwgen Now we can generate a few passwords. [email protected]:/mnt/c/Users/johnc$ pwgen -s -v 79lZrgzb ctklTCV3 zX3nDCQr FXk5g7V8 …

The new Windows 10 bash shell is not very impressive once you get it installed. I have tried it and I could not ping websites even though Microsoft Edge could access the Internet. It is possible to install packages if these lines are added to the /etc/hosts file. 91.189.91.14 archive.ubuntu.com 91.189.92.201 security.ubuntu.com91.189.91.14 archive.ubuntu.com 91.189.92.201 security.ubuntu.com …

Windows 10 is getting a bash shell in the summer release. This is a couple of months away. But here are a couple of screenshots from developers I have found on the web that show what this will look like. Here a person is installing the bash shell using CMD. Now this is the bash …

Apparently, the Linux bash shell is coming to Windows 10. This will offer a fully functional Linux bash prompt in the Windows app store, a good alternative to Powershell. This is in partnership with Canonical who work on the Ubuntu Linux distribution. As long as this offers tools such as dig, wget, and whois, it …

The shuf command for Linux allows a command-line user to select a given number of random words from a wordlist. [[email protected] ~]$ shuf -n 8 /usr/share/dict/words amphivasal thoracically U. bluet Dabih thioamid taxiing convictism[[email protected] ~]$ shuf -n 8 /usr/share/dict/words amphivasal thoracically U. bluet Dabih thioamid taxiing convictism This can be used to generate a word …