Author: Gugu Ncube
-
Python – pyinotify – Observe Files and Directories – open, close, delete
sudo pip install pyinotify Example a@a:~$ vim notify_test.py import pyinotify class MyEventHandler(pyinotify.ProcessEvent): def process_IN_ACCESS(self, event): print “ACCESS event:”, event.pathname def process_IN_ATTRIB(self, event): print “ATTRIB event:”, event.pathname def process_IN_CLOSE_NOWRITE(self, event): print “CLOSE_NOWRITE event:”, event.pathname def process_IN_CLOSE_WRITE(self, event): print “CLOSE_WRITE event:”, event.pathname def process_IN_CREATE(self, event): print “CREATE event:”, event.pathname def process_IN_DELETE(self, event): print “DELETE event:”, event.pathname def…
-
Apache Bench – Installation and Tests
Apache Bench is a cool tool to fire several http call against a server. Installation sudo apt-get install -y apache2 Simple Benchmark Example ab -n100000 -c1000 http://localhost:8080/ -n = total number of calls -c = number of concurrent requests Example: Multiple Apache Bench Calls With Increasing Concurrency cat > ab.sh solr_results.log for C in 2…
-
Selenium – Solving the “Can’t load the profile” Exception
I had a wierd “Can’t load the profile” exception in a selenium script that simply would go away. Turns out the reason is a version problem between the selenium server and python library Exception Error a@a:/home/dev/code$ python selenium_test.py Traceback (most recent call last): File “/home/dev/code/selenium_test.py”, line 905, in main() File “/home/dev/code/selenium_test.py”, line 56, in main…
-
LuxIO – Installation and Test of the NoSQL key value database
Lux IO is a small performant key value storage. It is B+-tree based and is quite space efficient and fast for large data sets. I tested it on my laptop with 20 million strings. Installation cd /tmp wget http://luxio.sourceforge.net/luxio-0.2.2.tar.gz tar xvf luxio-0.2.2.tar.gz cd luxio-0.2.2/ sed -i ‘s//\n#include /g’ util.h #add line “include ” in util.h…
-
Kyoto Cabinet – Installation with Lua, compression using zip, lzo and lzma
Install Kyoto Cabinet # http://torum.net/2010/01/kyotocabinet-alpha-release/ ulimit -u unlimited #zlib compression sudo apt-get install -y zlib1g-dev build-essential #lzma compression sudo apt-get install -y lzma liblzma-dev #lzo compression sudo apt-get install -y liblzo2-dev sudo apt-get remove -y libtokyocabinet-dbg libtokyocabinet-dev tokyocabinet-bin libtokyocabinet9 sudo apt-get install -y xz-utils #lua #sudo apt-get install -y build-essential lua5.2 liblua5.2-0 liblua5.2-0-dbg liblua5.2-dev sudo…
-
Kyoto Tycoon – Installation with Lua and Memcached Protocol
Prepare Install Kyoto Cabinet Installation #kyototycoon, works with lua 5.1 not 5.2 or later! mkdir -p /tmp/build cd /tmp/build version=”0.9.56″ wget http://fallabs.com/kyototycoon/pkg/kyototycoon-$version.tar.gz tar xvzf kyototycoon-$version.tar.gz cd kyototycoon-$version #./configure –with-kc –enable-lua #error fix #ktdbext.h:274:29: error: ‘getpid’ was not declared in this scope # append line #include #http://code.google.com/p/modpagespeed/issues/detail?id=420 if [ “`grep ‘include ‘ ./ktdbext.h`” == “” ]…
-
Ubuntu – Add and Delete a PPA
Add a PPA Example: ppa:e2defrag/ppa sudo add-apt-repository -y ppa:e2defrag/ppa sudo add-apt update Remove a PPA Example: ppa:e2defrag/ppa sudo add-apt-repository -y ppa:e2defrag/ppa –remove sudo add-apt update
-
Apache Solr 4 – Getting Started
Download Server # set version and base directory version=”4.4.0″ basedir=~/build/solr # create directory for Solr server binaries mkdir $basedir cd $basedir # download solr binaries > 70 MB wget http://apache.mirror.clusters.cc/lucene/solr/$version/solr-$version.zip # extract zip file unzip -oq solr-$version.zip # move versioned directory mv solr-$version solr Start Server # set base directory basedir=~/build/solr cd $basedir/solr/example/ # start…
-
Lucene 4 – Getting Started – Demo File Search
Download Lucene and Index Files # set lucene version version=”4.4.0″ # set base directories basedir=~/build/lucene/lucene-$version indexdir=$basedir/data/index # create direct for Lucene code and binaries mkdir -p $indexdir cd $basedir/.. # download lucene if [ ! -e lucene-$version.zip ]; then wget http://apache.imsam.info/lucene/java/$version/lucene-$version.zip fi; # extract unzip -oq lucene-$version.zip # create directory to save the search index…