Jul 282013
 

Article By Oussama Krifa

Accessing your home computer (I’ll call it server on this article) from a remote location (that I’ll call client) outside the local network, can be very interesting, for example, listening to streaming music played by MPD, managing downloads in the bittorrent client Transmission through its web interface, controlling the machine via SSH … However, before accessing your server remotely, you must know the “address” or IP (Internet Protocol address), but generally at home they are provided dynamically, through the Internet Service Provider, so it’s not so easy to know the IP of your home server.
We will see how to automatically update the DNS name on a domain name server (DynDNS) with the current IP address of the server thanks to ddclient. Continue reading »

Flattr this!

Jul 112013
 

On server it’s useful to monitor, and collect, data about the use of your bandwidth, in the past I’ve wrote an article about “Monitor your bandwidth from the Linux shell” and I’ve also presented 4 useful tools that you can use to have a real time monitoring of the bandwidth:

IPTState : This software is a top-like interface to your netfilter connection-tracking table. Using iptstate you interactively watch where traffic crossing your netfilter/iptables firewall is going, sort by various criteria, limit the view by various criteria. But it doesn’t stop there: as of version 2.2.0 you can even delete states from the table!

pktstat displays a real-time list of active connections seen on a network interface, and how much bandwidth is being used. Partially decodes HTTP and FTP protocols to show what filename is being transferred. X11 application names are also shown.

NetHogs is a small ‘net top’ tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process. NetHogs does not rely on a special kernel module to be loaded. If there’s suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this. This makes it easy to indentify programs that have gone wild and are suddenly taking up your bandwidth.

IPTraf is a console-based network statistics utility for Linux. It gathers a variety of figures such as TCP connection packet and byte counts, interface statistics and activity indicators, TCP/UDP traffic breakdowns, and LAN station packet and byte counts.

They are all good I suggest to read my old articles to have a small introduction about them, today I want to show you vnstat, this small program has something more than the others, it can show real time statistics, but the feature that this small program shines it’s its ability to collect data over a long period of time.
Continue reading »

Flattr this!

Jun 282013
 

Sometime it happen that the command df and the command du report different results such as:

df -h /tmp
Filesystem            Size  Used Avail Use% Mounted on
/dev/vzfs             16G   12G   4G  75%  /tmp

While a du command show somethign different such as:

du -hs /tmp/
10G	/tmp/

There are usually different reason when this happen.
Continue reading »

Flattr this!

Jun 192013
 

Sometimes it’s useful to write a bash script that do something like “Do this job, if it’s still running after XX second kill it”, how to implement this in a normal bash environment ?

Nothing simpler: Use the timeout shell command to achieve this.
From its info page:

timeout runs the given COMMAND and kills it if it is still running after the specified time interval

Let’s see how to use it.

Continue reading »

Flattr this!

Jun 142013
 

I’m in the process of re-installing ArchLinux on my new Dell Latitude 6530, this is because at the end of the first installation I noticed that while running fdisk -l I received a message like this one (that’s not my original disk, but the message was the same):

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    39070079    19535008+  83  Linux
<strong>Partition 1 does not start on physical sector boundary.
</strong>/dev/sda2        39070080    46877669     3903795   82  Linux swap / Solaris
/dev/sda3   *    46877670   144536804    48829567+  86  NTFS volume set
<strong>Partition 3 does not start on physical sector boundary.
</strong>/dev/sda4       144536805  1250263727   552863461+  86  NTFS volume set
<strong>Partition 4 does not start on physical sector boundary.</strong>

I “shrinked” the original Windows 7 to 40 GB with Gparted live and created the partitions during the installation of ArchLinux with cfdisk so what’s wrong with these operations ?

Continue reading »

Flattr this!