Posted by joseph on November 25, 2011 ·
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:
Posted by joseph on November 23, 2011 ·
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.
Posted by joseph on November 22, 2011 ·
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.
Posted by joseph on November 5, 2011 ·
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
Posted by joseph on October 16, 2011 ·
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?
Posted by joseph on June 16, 2011 ·
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 [...]
Posted by joseph on April 28, 2011 ·
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
Posted by joseph on February 25, 2011 ·
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 [...]
Posted by joseph on January 21, 2011 ·
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 [...]
Posted by joseph on December 5, 2010 ·
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():