A nice shell prompt that is randomly generated each time it appears. _() { shuf -n 1 /usr/share/dict/words | sed "s/’s$//; s/.*/\l&/"; }; PS1="\[\e[1;31m\]$(_)\[\e[m\]@\[\e[1;35m\]$(_)\[\e[m\]\$ "_() { shuf -n 1 /usr/share/dict/words | sed "s/’s$//; s/.*/\l&/"; }; PS1="\[\e[1;31m\]$(_)\[\e[m\]@\[\e[1;35m\]$(_)\[\e[m\]\$ " Select a random word from a textfile with bash. ubuntu ~ $ shuf -n 1 /usr/share/dict/words pluckedubuntu ~ …

Get a comprehensive listing of all Arch Linux pacman mirrors. curl -s -L "https://www.archlinux.org/mirrorlist/?country=all&protocol=https&use_mirror_status=on" 2>&1 | sed ‘s/^.//’ > mirrorlistcurl -s -L "https://www.archlinux.org/mirrorlist/?country=all&protocol=https&use_mirror_status=on" 2>&1 | sed ‘s/^.//’ > mirrorlist A simple script to update your mirror listing on your Arch Linux system. #!/bin/bash echo "Fetching new sorted mirrorlist…" curl -s -L "https://www.archlinux.org/mirrorlist/?country=all&protocol=https&use_mirror_status=on" 2>&1 | sed …

Print the current date and time with Powershell. "{0:dddd – hh:mm:ss – d/M/yy}" -f (get-date)"{0:dddd – hh:mm:ss – d/M/yy}" -f (get-date) This is an example of what this will give you. PS C:\Users\jason> "{0:dddd – hh:mm:ss – d/M/yy}" -f (get-date) Tuesday – 08:42:05 – 30/1/18PS C:\Users\jason> "{0:dddd – hh:mm:ss – d/M/yy}" -f (get-date) Tuesday – …

There are a lot of obscure shell tricks for the bash shell that are useful for showing off shell tricks and making your shell usage easier. For a first example, run this command. ubuntu ~ $ ls -hulaubuntu ~ $ ls -hula Then run this and the previous command parameters will be applied again. ubuntu …

Using wild-cards to display various files in a folder with ls. I recently needed to check whether certain files were in the /usr/lib folder and I used the ls command to do this. to find all files related to the Perl programming language in the /usr/lib directory. ubuntu ~ $ ls /usr/lib/*perl* /usr/lib/libperl.so.5.18 /usr/lib/libperl.so.5.18.2   …

Get a nice urxvt windows with a fixed font and lovely colors. urxvt -fn "fixed" +sr +st -fg "#FFFFFF" -bg "#000033" -bd "#302c64" \ -ip +sb -title "*-Home-${HOME}-Shell-${SHELL}-Display-${DISPLAY}*" \ -tint DarkSlateGrey -fade 50 -fadecolor redurxvt -fn "fixed" +sr +st -fg "#FFFFFF" -bg "#000033" -bd "#302c64" \ -ip +sb -title "*-Home-${HOME}-Shell-${SHELL}-Display-${DISPLAY}*" \ -tint DarkSlateGrey -fade 50 …

This is the proper way to use grep. You do not need to use cat at all. This method works well and is one command, not two piping together. [email protected]:~/Documents$ grep apt-get ../.bash_history sudo apt-get update sudo apt-get install me-tv sudo apt-get update && sudo apt-get install xvst apt-get moo apt-get [email protected]:~/Documents$ grep apt-get ../.bash_history …

To list all the files installed by a certain Debian package, use this command. dpkg -L [PACKAGENAME]. For example. ubuntu ~ $ dpkg -L vim /. /usr /usr/bin /usr/bin/vim.basic /usr/share /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/vim /usr/share/bug /usr/share/bug/vim /usr/share/bug/vim/presubj /usr/share/bug/vim/script /usr/share/doc /usr/share/doc/vimubuntu ~ $ dpkg -L vim /. /usr /usr/bin /usr/bin/vim.basic /usr/share /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/vim /usr/share/bug /usr/share/bug/vim /usr/share/bug/vim/presubj …

Convert a Linux text file to DOS format with AWK. [[email protected]:~] cat dodo-ip.txt | awk ‘{sub(/$/,"\r")};1’ > dodo2.txt[[email protected]:~] cat dodo-ip.txt | awk ‘{sub(/$/,"\r")};1’ > dodo2.txt Convert a DOS text file to UNIX format. [[email protected]:~] cat dodo2.txt | awk ‘{sub(/\r$/,"")};1’ > dodo3.txt[[email protected]:~] cat dodo2.txt | awk ‘{sub(/\r$/,"")};1’ > dodo3.txt Get your Internet facing IP address from …

Hacking is something that a lot of us think in a negative way, but the truth of the matter is, there are a lot of positives that can come out of it as well. In this article, we’re going to take a look at 10 cool tricks that you can use if you’re thinking about …

Using the shellshock bash bug on an iMac. iMac04:~ admin$ env VAR1=’me() {echo "hello"}\ ‘ /bin/echo "hello" helloiMac04:~ admin$ env VAR1=’me() {echo "hello"}\ ‘ /bin/echo "hello" hello Getting free hard disk space easily. iMac04:~ admin$ df -Hla Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk0s2 89G 64G 25G 73% 15757422 6089307 72% …