Some very useful bash shell tips.

The bash shell has some very useful features when using the command line. This can make using the command line much faster. For example, if you forget to type sudo before a command, this can be fixed this way. jason$ fdisk -l /dev/sda fdisk: cannot open /dev/sda: Permission deniedjason$ fdisk…

Read More

Useful Linux tips for the desktop.

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

Read More

Useful shell tips. How to search and replace characters or words with the bash shell.

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. jason@DESKTOP-R72SPS3:/mnt/c/Users/johnc/Documents$ cat ip.c | sed ‘s/#/*/gi;’ *include <stdio.h>   int main() { printf(".");   return 0; }jason@DESKTOP-R72SPS3:/mnt/c/Users/johnc/Documents$ cat ip.c | sed…

Read More

Useful grep tricks and tips for the Linux user.

The grep command on Linux is very good for filtering text to find certain strings. This is mostly used for filtering the output of a command to narrow down what the user is looking for. Find all instances of a word in a text file. jason@DESKTOP-R72SPS3:/usr/share/X11$ grep "dark" rgb.txt 47…

Read More

Linux Mint tips and tricks for making the best use of your system.

How to upgrade to a newer Linux Mint release. https://community.linuxmint.com/tutorial/view/2. How to update and upgrade your packages. Type this in a terminal window. sudo apt-get update && sudo apt-get upgradesudo apt-get update && sudo apt-get upgrade This command will update the package repositories and download and install package updates over…

Read More

Useful tips and tricks for the UNIX VIM editor.

When in command mode, press the u key to undo the last change to a file. Press U to undo last change(s) on a line. To open a file at a certain line, start it like this: vim +567 file.txt. This will open the file file.txt on line 567. Using…

Read More

Firefox tips and tricks for habitual Internet users.

To open the Firefox developer tools, press Ctrl-Shift-K. This is good if you have Firebug installed, as F12 will open it instead. To take a full-page screenshot of a web site, press Shift-F2 and then type this command and hit press ENTER. screenshot –fullpagescreenshot –fullpage This will be saved in…

Read More

How to do a SQL injection attack against Damn Vulnerable Web App.

Damn Vulnerable Web App is a PHP web application that is deliberately vulnerable. This is used to learn how to attack websites by exploiting various vulnerabilities in the software. In this example, I am showing you how to use an SQL injection attack to get information out of the database….

Read More

Some useful tips for Linux Mint users.

To open a new virtual terminal to enter commands, use the Ctrl-Alt-F2 key combination and enter your username and password. This is a virtual terminal where you can control your system with a distraction free full-screen terminal. There are key combinations to switch between virtual terminals, read more here: http://www.tldp.org/LDP/GNU-Linux-Tools-Summary/html/virtual-terminals.html….

Read More

Very useful computing tips for the Internet user.

If you click a link in Google and the forum post you wanted to read requires a login to view, click back and then click the green drop down arrow at the end of the link, then click the cached option. This will open a cached version of the forum…

Read More

Misc UNIX tips for the desktop UNIX or Linux user.

Get your uptime with the uptime command on Linux. Last login: Tue Oct 28 13:55:23 on ttys000 iMac05:~ admin$ uptime 11:24 up 111 days, 20:38, 2 users, load averages: 0.35 0.16 0.14Last login: Tue Oct 28 13:55:23 on ttys000 iMac05:~ admin$ uptime 11:24 up 111 days, 20:38, 2 users, load…

Read More

Cool Linux tricks and hacks for the desktop and server user.

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…

Read More

How to see free memory on a Linux machine with the free command.

The free command in Linux is used to show the amount of free memory in Linux. The example below shows the default usage of this command. ubuntu@ip-172-31-0-140:~$ free total used free shared buffers cached Mem: 602736 294680 308056 16928 17632 146320 -/+ buffers/cache: 130728 472008 Swap: 0 0 0ubuntu@ip-172-31-0-140:~$ free…

Read More

How to make the best use of apt on Ubuntu and Linux Mint.

This is how to automatically remove unneeded packages on your Linux Mint system. jason@jason-desktop:~$ sudo apt-get autoremove [sudo] password for jason: Reading package lists… Done Building dependency tree Reading state information… Done The following packages will be REMOVED: libglib2.0-0:i386 libgstreamer-plugins-base0.10-0 libgstreamer-plugins-base0.10-0:i386 libgstreamer0.10-0 libgstreamer0.10-0:i386 liborc-0.4-0:i386 libpgm-5.1-0 libpoppler57 libpth20 libsndio6.0 libzmq3 qtdeclarative5-qtfeedback-plugin…

Read More

How to increase the size of a Virtualbox VDI disk image on a Macintosh computer. And other useful tips.

How to expand a VDI disk image on a Macintosh computer: http://mithunme.wordpress.com/2013/07/08/how-to-increase-the-disk-size-of-a-ubuntu-vdi-on-mac/. This would also be applicable to a Linux machine. A very useful tip. How to add a standard user to the /etc/sudoers file on a Macintosh computer: http://mithunme.wordpress.com/2013/02/10/adding-a-standard-user-to-etcsudoers-in-mac-os-x/. This is also applicable to a Linux machine. How to…

Read More