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"

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%   /
/dev/disk0s4   410G   4.7G   405G     2%  1147839 98859403    1%   /Volumes/TEMP STORAGE

Get the geometry of your hard disk with the hdparm utility.

[email protected]:~/Documents$ sudo hdparm -g /dev/sda

 geometry      = 60801/255/63, sectors = 976773168, start = 0

Update the whole repository information after the initial installation of Gentoo.

[email protected] ~ $ sudo emerge --sync

Then update Portage.

[email protected] ~ $ emerge --oneshot portage

After those commands, you are free to install any required software for your Gentoo instance.

[email protected] ~ $ emerge openvpn mc nmap htop

This will install Midnight Commander, OpenVPN and the very useful htop and nmap port scanning tool.

This is how to get information about your Linux user.

[email protected] ~ $ w
 03:00:47 up  1:00,  1 user,  load average: 0.03, 0.03, 0.06
ec2-user pts/0     02:53    7.00s  0.01s  0.00s w

The Linux command line user may also use the who am i command to get information like this.

No comments have been made. Use this form to start the conversation :)

Leave a Reply