Simple Command Line Network Monitor For Linux

One Comment Written by Etienne Laurin on 2010/02/19 in Code.

Here is a small shell script that displays the amount of data your computer is downloading. The numbers indicate the approximate bytes per second.

#!/bin/bash

i=eth1
n=1

if [ "$1" != "" ]; then i="$1"; fi
if [ "$2" != "" ]; then n="$2"; fi

width=`stty size | cut -f 2 -d ' '`
max=`expr $width - 10`
startt=`date +%s`

a=`cat /sys/class/net/$i/statistics/rx_bytes`
b=$a
while sleep $n; do
	v=`expr $a - $b`
	if [ $v -gt $max ]; then
		max=$v
		echo -n '^[[1m'
	fi
	printf '%8s ' $v
	echo -n '^[[1m'
	seq -s = 0 `dc -e "$v $width 9 - * $max / p"` | sed 's/[^=]//g;'
	echo -n '^[[0m'
	b=$a
	a=`cat /sys/class/net/$i/statistics/rx_bytes`
done

Download source


Wise men write lists

No Comments Written by Etienne Laurin on 2010/02/14 in Faith.

and live by the lists they write!

Wise men know best how to summarise their own words into short and meaningful lists. But what completes their ascension to wisdom is the meaning they give to their words in the lives they live. I do not yet have a list of my own, but I would like to share a few lists that wise men have written.

Ghandi — Seven Blunders of the World

  • Wealth without work
  • Pleasure without conscience
  • Knowledge without character
  • Commerce without morality
  • Science without humanity
  • Worship without sacrifice
  • Politics without principle
  • Rights without responsibilities

Musashi – Strategies

  • Do not think dishonestly.
  • The Way is in training.
  • Become aquainted with every art.
  • Know the Ways of all professions.
  • Distinguish between gain and loss in worldly matters.
  • Develop intuitive judgement and understanding for everything.
  • Perceive those things which cannot be seen.
  • Pay attention even to trifles.
  • Do nothing which is of no use.
My Heart Burns Like Fire

Soyen Shaku, the first Zen teacher to come to America, said: “My heart burns like fire but my eyes are as cold as dead ashes.” He made the following rules which he practiced every day of his life.
  • In the morning before dressing, light incense and meditate.
  • Retire at a regular hour. Partake of food at regular intervals. Eat with moderation and never to the point of satisfaction.
  • Receive a guest with the same attitude you have when alone. When alone, maintain the same attitude you have in receiving guests.
  • Watch what you say, and whatever you say, practice it.
  • When an opportunity comes do not let it pass by, yet always think twice before acting.
  • Do not regret the past. Look to the future.
  • Have the fearless attitude of a hero and the loving heart of a child.
  • Upon retiring, sleep as if you had entered your last sleep. Upon awakening, leave your bed behind you instantly as if you had cast away a pair of old shoes.

The Bag of Spuds

No Comments Written by Etienne Laurin on 2010/02/04 in Music.

Four months ago I started learning to play Irish Traditional Music on the tin whistle. After I had hinted about it, my family offered me a wonderful Feadóg whistle for my birthday.

I started my lessons on the wonderful Bro Steve’s Tin Whistle Pages and other online ressources. It wasn’t enough for me so I got Grey Larsen’s Essential Guide from the library.

Since I don’t play with anyone else, I rely on online radio to find new tunes to learn and to play along with. The most recent tune I grabbed off the radio is The Bag of Spuds. It happens to be Clare McKenna‘s version. It sounds different from the two versions of the tune avaiable on thesession.org. It has a few more notes and a lot of ornamentation.

Slowing down a tune helps to figure out the added notes and ornamentations. To do so I use the command line music player mplayer with its -speed switch and the scaletempo audio filter:

mplayer -af scaletempo=stride=10:overlap=.30:search=5 -speed 0.5

Now, beginner that I am, I can transcribe the ornamentations and try to play them.


AtnNn.com on archive.org

No Comments Written by Etienne Laurin on 2010/02/04 in Meta.

Looking for old versions of this website? You don’t need acccess to my backup files, because archive.org has you covered:

http://atnnn.d2g.com/ (2002)

http://atn.ath.cx/ (2002, 2003, 2004)

http://www.atnnn.com/ (2004, 2005, 2006, 2007, 2008)