Archive : Programming

RSS feed
Convert audio file from WAV to MP3

Convert audio file from WAV to MP3

This an example on converting audio file from wav format to mp3 with the help of Sound eXchange( a.k.a SOX ), and Lame Aint an MP3 Encoder (a.k.a. Lame). Before using this script, please make sure you have both sox and lame installed. (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; [...]
Best Practices for Speeding Up WebSite

Best Practices for Speeding Up WebSite

The Exceptional Performance team from Yahoo.com identified a number of best practices for making web pages fast. The list includes 34 best practices divided into 7 categories. (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); [...]
10 things you might not know about PHP

10 things you might not know about PHP

As the original version is no longer available at rightbrainnetworks.com, let me forward it here, it worths a careful read especially for LAMP administrators. PHP is simultaneously the most infuriating and joyful languages I’ve ever worked with. I say “infuriating” primarily because the function [...]
Bash shell fork() bomb

Bash shell fork() bomb

I just tried the famous shell fork() bomb on my Laptop, which is running Debian lenny. (I dare to do this because I’m going to shut down my laptop.) Please note that do NOT run it on your production server! (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) [...]
Backup disk partition tables

Backup disk partition tables

In storage environment, the file system reliability is almost a common issue. As for my understanding, when a ext3 file system is under use, its integrity is keeping broken day by day, as most of the threaded applicatons cannot take fully control of data blocks. After a long time running, fsck becomes [...]
Find dead softlink files by shell

Find dead softlink files by shell

Symbolic linked files are commonly used in Linux system. For example some service inital scripts are stored in /etc/init.d and linked to /etc/rc0.d, /etc/rc1.d, /etc/rc2.d, /etc/rc3.d, /etc/rc4.d, /etc/rc5.d and /etc/rc6.d, so that the system is able to control related services in different runlevel. (function(d, [...]
Query IP whois info in python

Query IP whois info in python

This is a simple python script  based on some former rwhois code. It shows us an easy way on how to get detailed information about a specific IP address: joseph@e54:~$ python ip-whois.py 94.75.214.11 ====== whois.arin.net OrgName: RIPE Network Coordination Centre OrgID: [...]
Generate MAC Address by Scripts

Generate MAC Address by Scripts

In virtualized environment, we sometimes need to generate MAC address for each virtual machine at the time of creation. Since is a nearly unlimited amount of numbers on the same subnet, it is almost impossible that we would get the same MAC address. In the follwing paragraph, we’ll show you how [...]
List keys that of same values from a Perl Hash

List keys that of same values from a Perl Hash

Suppose that we have a hash like this: my %thehash = ( "abc" => {'a', 'office', '123'}, "cax" => {'s', 'domain', '254'}, "adm" => {'s', 'atwork', '254'}, "tec" => {'s', 'domain', '294'}, "ued" => {'s', 'domain', '254'} ); (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; [...]
Deal with readonly variables in bash

Deal with readonly variables in bash

As we know there’s a kind of read-only variables in bash in common linux system, typically $BASH_COMPLETION and $BASH_COMPLETION_DIR are both readonly variables. This post will focus on the following two topics, how can we set readonly variables in Bash, and how can we unset them. (function(d, [...]
© 2006-2008 Admon Home. All rights reserved.