Linux: Get CPU Usage in percent

Hi there,

Here is how to get the linux CPU usage taken on a weighed across all CPU’s.

top -b2 -n2 -p 1 | fgrep “Cpu(s)” | tail -1 | awk -F’id,’ -v prefix=”$prefix” ‘{ split($1, vs, “,”); v=vs[length(vs)]; sub(“%”, “”, v); printf “%s%.1f%%\n”, prefix, 100 – v }’



By |March 20th, 2017|Linux|Comments Off on Linux: Get CPU Usage in percent

Zabbix Tricks

Zabbix is a very powerfull monitoring tool that is highly flexible and supports many hardware units. Here are some solutions i made in my use with the product.

By |April 20th, 2011|Apache, Linux, Zabbix|0 Comments

htaccess based 301 redirect of non-www to www

Of cause you want to make a proper 301 redirect from a to to avoid duplicate content and a bad standing at Google.

By |January 6th, 2011|Apache, Linux|0 Comments

How to parse Amazon S3 log format in php

If you want to parse / split the items in the Amazon S3 logformat in php, you need some regular expression magic. Here is my snippet.

By |July 9th, 2010|Linux|0 Comments

How to recompile / install vmware tools on Ubuntu 8.04 LTS

How to recompile / install vmware tools on Ubuntu 8.04 LTS

By |August 12th, 2009|Linux, vmware|2 Comments

Ubuntu 8.04 LTS 64 bit stalls on VMware

Stumbled upon another issue when running Ubuntu on wmvare today, it seems that a TSC clock bug in the 2.6.24 kernel. Short it goes out of sync when running with more than one cpu / vcpu.

By |August 12th, 2009|Linux, vmware|0 Comments

Missing network interface after cloning a Ubuntu template on ESX vmware server

I was cloning some Ubuntu 8.04 LTS machines from a template i made and everything went fine, except the kernel could not find my eth0 and mapped a new eth1.

By |August 12th, 2009|Linux, vmware|0 Comments

The Danish Joomla spider

Mission: To examine how many joomla sites there are in Denmark Many times i asked myself - how many sites actually runs joomla in e.g. Denmark and i've could't find the answer anywhere. Even extensive search on Google, posting in forums etc.

By |June 29th, 2009|Joomla, Linux|1 Comment

How to easily convert .ts files to Mpeg2 or DVD

So you finally got the recording features to work on your DreamBox, but you want more? 🙂
If you only want to view the MPEG livestream file (.ts) then use VLC player, which is the best player around.

But if you want to convert the .ts file to eg. Mpeg 2, or MPA/MPV format for later creation of DVD discs, read the following guides.


By |June 4th, 2009|Dreambox, Linux|28 Comments

Subversion with a working copy on a samba share

When having a working copy on a samba share, i used to get alot of “Failed to add ‘XXX’: object of the same name already already exists”. It seems that the problem lies on the samba configuration.


By |May 20th, 2009|Samba|0 Comments