Category: programming
-
Python – Simple Websockets Example using Flask and gevent
Below is a simple Websockets Echo Server using Flask and gevent 🙂 Installation requirements.txt – easily build all depencies cat > requirements.txt
-
Python – Spynner Installation in Ubuntu
Spynner is a stateful programmatic web browser module for Python with Javascript/AJAX support based upon the QtWebKit framework. Quick Install # build LibQt4 dependencies sudo apt-get build-dep -y libqt4-dev # install python Qt4 library sudo apt-get install -y python-qt4 # x11 sudo apt-get install -y libxtst-dev xvfb x11-xkb-utils # fonts sudo apt-get install -y xfonts-100dpi…
-
Python – Performance Tests of Regular Expressions
Regular Expressions: To Compile or not to Compile ? When using regular expressions one often has to decide whether to compile the expressions before applying them. Below is a simple test I ran and the results. tee ./regextest.py python regextest.py python regextest.py ————————————————– 1 calls in 0.194 ms – compiled_once 1 calls in 0.124 ms…
-
pylibmc – Kestrel Queue Client – Simple Test using Memcache Protocol
Installation pylibmc is a great Python client for memcached written in C. sudo pip install pylibmc Mini Benchmark cat > kestrel-benchmark.py
-
beanstalkc – beanstalkd queue – python client library
Installation beanstalkc is a c-based python client library for beanstalkd. Installation using PIP Installer The library and dependencies can be easily install using the pip installer sudo pip install PyYAML sudo pip install beanstalkc Installation directly from Github This can useful if the pip installed library is too old and required new functionality/bug fixes are…
-
Apache Cassandra CQL3 – Installation and Tests using Python
Installation using PIP # install python-pip sudo apt-get install -y python-pip # install cql driver sudo pip install cql Manual Installation from the Sources # download path mkdir -p ~/build/python-cql cd ~/build/python-cql # download git clone https://github.com/pcmanus/python-cql cd python-cql sudo python setup.py install Query Example # create and move to diretory mkdir -p ~/build/python-cql cd…
-
pycassa – Gettting started with Apache Cassandra using python
Install easy_install and pip # install easy_install sudo apt-get install -y python-setuptools # install python-pip sudo apt-get install -y python-pip Install pycassa sudo pip install pycassa Test pycassa cat > cassandra_test.py
-
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…
-
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…
-
Linux – Install Eclipse IDE
The easiest way to install Eclipse in Ubuntu is through the standard repository sudo apt-get install -y eclipse Unfortunately, this install an outdated version. Currently the version 3.8.0 gets installed, although the latest stable version is 4.2.1. The eclipse team does have a Debian PPA as well, ppa:eclipse-team/debian-package. Adding this PPA doesn’t change anything and…