Archive : Programming

RSS feed
Check HTTP header on multiple servers

Check HTTP header on multiple servers

How can we dump the HTTP header for a specified URL? It’s not difficult since linux has such tools to do that, below is an example:
Limit the size of Subversion commitment

Limit the size of Subversion commitment

Has your subversion repository ever been abused by massive commitments? If not, I should say that you are lucky. Never mind that someday you might be abused as it’s hard to predict what the non-Ops are working on and trying to do.
Regular expressions in Bash 3

Regular expressions in Bash 3

Since version 3 which released in 2004, Bash acquired a regular expression operator “=~”, but I never noticed it, probably because grep sed or other commands works alternatively well. The regular expression is the same as egrep,  you can find more details from man egrep.
Check services status in Nagios by Nagcheck

Check services status in Nagios by Nagcheck

I just created a script Nagcheck to read services status in Nagios. It reads all the nagios settings, parse them, then create a report based on what you ask for. With this script, you can do the following things: List the notification disabled (or enabled) hosts
Python: initialize a list

Python: initialize a list

I met this issue last week, and finally got a proper way to handle it. We normally init a list like this “list=[]“, then how can we initialize a python list with a string variable?
Synchronize subversion repositories with inotify-tools

Synchronize subversion repositories with inotify-tools

How can I keep two subversion repositories synchronized on the fly? As a known issues that system administrators may face, there’re serval ways to achieve that: svnsync – As part of the official toolset, it would be a good solution. Anyway I will not use it. SVK – Did not check it [...]
Query domain name whois info by Python

Query domain name whois info by Python

In one of our former post, we give an example on how to query IP whois info by Python, here is an example on how to query whois information for a domain name. #!/usr/bin/python #encoding = utf8
Upgrade and downgrade RubyGems

Upgrade and downgrade RubyGems

RubyGems  is a package management framework for Ruby. You need to have an installation of RubyGems before applying the following changes to your system. To make sure whether you have installed RubyGems or not, run this command: joseph@admon:~$ gem -v 1.5.2 See Gem for information on RubyGems (or ‘ri [...]
MongoDB init script on Ubuntu

MongoDB init script on Ubuntu

By default, MongoDB does not supply any auto start/stop scripts for instance management. Here we’ll share a smart script to do so. It’s tested OK on ubuntu servers, and should work on Debian too. All you need to do are two steps: 1, Create a configuration file for MongDB, which is located [...]
Generate random Chinese character in Python

Generate random Chinese character in Python

This is a python script that can be used to generate random Chinese characters. Funny script! #!/usr/bin/python import random def rand_ch_ch():
© 2006-2011 Admon Home. All rights reserved.