RPM: building proctitle for PHP

Sometimes it’s convenient to change PHP script name, it allows to check if it’s running by typing just pstree. You can perform that with use of proctitle. Unfortunately there is no rpm for this package for Fedora 15. So to use it you need to build it. Firstly you need to download source package to…
Read more

RPM: how to build Redis library package for PHP

At Supportex we use Redis a lot. It’s extremely fast and doesn’t consume a lot of resources.  Besides it’s easy to use for developers (especially for those who worked with Memcache). Unlike Python which has only one mature client, PHP has various of them.  For instance, Predis, phpredis,  Rediska, etc. We prefer phpredis. It’s written…
Read more

Python: sorting dict by value

Probably one of the most often task while working with dictionaries in Python is sorting by value. That is how it can be done: Didn’t find the answer to your question? Ask it our administrators to reply we will publish on website.

Troubleshooting: Cannot open TUN/TAP dev /dev/net/tun

If you are getting error ‘Cannot open TUN/TAP dev /dev/net/tun‘ while starting OpenVPN server, it means that you should load ‘tun’ module which features TUN/TAP device driver: OpenVPN 2.1.1 i386-redhat-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Jan 26 2010 NOTE: the current –script-security setting may allow this configuration to call user-defined scripts LZO compression initialized…
Read more

Python: distribution systems world

At the very beginning Python packaging world may seem too confusing. But only at first sight. There are a lot of different packages package formats, libraries and tools for distributing and  packages management in Python world. There is also PyPI – the Python Package Index is a repository of software for the Python. Most often…
Read more

AWK: quick way to get squid users traffic usage

If you need quick and simple way to get squid users traffic usage you can use this script: Here is an example: [root@server ~]# head -n 50000 /var/log/squid/access.log | /usr/local/bin/traf.sh alice – size: 1532.08 Mb linda – size: 11.84 Mb cray – size: 9.30 Mb focus – size: 3.05 Mb santa – size: 0.96 Mb…
Read more

RPM: Bulding Python package for Redis

To build RPM package for Python library is really easy task if developer has kindly included setup.py file in it. Let’s build RPM for redis-py package by Andy Mccurdy. First of all we need archive with last version of redis-py. Unpack it. Change name of package to ‘python-redis’ since default value is ‘redis’ (and that is…
Read more

AWK: getting last column value

If you need to get value of last column in awk you can use built-in variable NF which means the number of fields in record. Or next, if you need next to the last field. And so on.