Linux Optimization

Shrink, compact Virtualbox disk images vdi and safe disk space

When I create a new Virtual Machine in Virtual Box, I always choose "Dynamically expanding storage".

And when I first install the gest OS (usually Windows to run iTunes) it starts very small, just Windows 7 and iTunes on it. (My iTunes library is usually on another disk).

Vmstat monitor system memory usage cache and CPU

With today's big disks and extremely powerful CPUs out there, memory is probably the more expensive resource.
When it comes to Virtual Hosts, also CPU power could be a problem, I have been running this site at Linode for a year now with no big problems, the only ones were because of some lack of memory, which caused the CPU usage to scale up, until I needed to restart the server.

Because of that experience I was investigating about vmstat. you can read vmstat man page at any time.

First let's check how memory works in Linux, memory is made of two components, the physical memory and swap memory (Disk), as you may know the disk is slower than the physical memory of your server so we all want to avoid memory paging or memory swapping.

vmstat - man page

VMSTAT(8) Linux Administrator's Manual VMSTAT(8)

NAME
vmstat - Report virtual memory statistics

SYNOPSIS
vmstat [-a] [-n] [delay [ count]]
vmstat [-f] [-s] [-m]
vmstat [-S unit]
vmstat [-d]
vmstat [-p disk partition]

Manage you wireless and wired connections with wicd

There are a lot of wireless manager software available for Linux, some of the most common ones are:

NetworkManager, which is the default for Ubuntu
KwifiManager, which is the KDE's default one

I used to use wifi-radar, but now I am using wicd.

Move polipo's cache directory to its own partition

If you are running

polipo and run out of disk space you have two options, one is to reduce the space polipo is using in /var/cache/polipo/ thus, fine tunning cache server or to change the cache directory to its own partition. Here we will see this second option

ps - How to check the running processes on Linux

ps, is a Linux command tool, that lets you view the current running processes, it is very useful when you are trying to kill a process or to view which applications other users are running (if you are the admin).

You may use it to check your own applications, some other user's application or a full list of the applications running on the operating system, you may also combine it with grep.

running it alone with no atributes

ps

Manage your wifi networks and profiles with wifi-radar

I have been traveling the last two weeks, and I have found how useful is wifi-radar on my Linux powered laptop.

I have an IBM Thinkpad T30 with an Aironet Wifi internal card (for the records)

iftop - Check and analyze your traffic

Introduction

iftop is a real good utility both for your own PC/Laptop and for your server and specially good for the latter and even better if this server is acting as the main router in your premises.