Archive for the ‘SysAdmin’ Category

January 6, 2012 0

Installing Hubot as a Campfire bot on Ubuntu 10.04.2

By in SysAdmin

sudo apt-get install python-software-properties sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs nodejs-dev redis-server #check to see if node installed node -v #install npm curl http://npmjs.org/install.sh | sudo sh #verify npm install npm -v cd /tmp git clone https://github.com/github/hubot.git cd hubot npm install sudo npm install -g coffee-script make test sudo cp -R [...]

Tags: , ,

October 13, 2011 0

Multiprocessing SNMP with Python

By in Fun, SysAdmin

I’ve written a ton of snmp monitoring scripts and they all suck because they are blocking and take “too long” to return results for a large amount of hosts. So how would we make this process faster and make us happier? multiprocessing is a package that supports spawning processes using an API similar to the [...]

October 12, 2011 1

Compiling Netsnmp for Ubuntu with Python Bindings

By in SysAdmin

apt-get install gcc apt-get install libperl-dev apt-get install python2.7-dev Download the netsnmp source: wget http://downloads.sourceforge.net/project/net-snmp/net-snmp/5.7.1/net-snmp-5.7.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fnet-snmp%2Ffiles%2Fnet-snmp%2F5.7.1%2F&ts=1318446955&use_mirror=surfnet tar xzvf net-snmp-5.7.1.tar.gz cd net-snmp-5.7.1 ./configure –with-python-modules Answer the questions make make install ldconfig akonkol@cmg005:/home/akonkol/net-snmp-5.7.1# python Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) [GCC 4.5.2] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. >>> import netsnmp >>>

August 17, 2011 0

Tweeting from a Django Application

By in Fun, Nothing, SysAdmin

It’s easy to get your application to start setting twitter status updates in django. Create a twitter account twitter.com Create a twitter “application’ and get your keys dev.twitter.com/apps Click on “settings” and set the access to read and write easy_install python-twitter Use this template Whenever you save a “Post” object, the def send_tweet method will [...]

Tags: ,

August 9, 2011 0

Using Javascript/Jquery Regex with match groups

By in Nothing, SysAdmin

I’m building custom syntax/markup for an editor I am building. The particular markup would look something like this: %[--- This is part of the /etc/apache2/sites-available/example.com ---]% And I want to turn it into <div class="filerule">This is part of the /etc/apache2/sites-available/example.com</div> So first I need to match: %[--- This is part of the /etc/apache2/sites-available/example.com ---]% And [...]