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

Nagios: monitoring virtual Windows servers

I would like to propose one of the ways of monitoring of OS Windows server, which is installed on a Linux server as a virtual one. For this purpose, we will use Nagios and the program for Windows – NSClient++. First of all we need to install program NSClient++ on the virtual machine. During the…
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/ 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 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.

DRBD split-brain solution in primary/primary setup

Recently one of our customers DRBD cluster has detected split-brain: This is  primary/primary cluster. And to fix this issue we had to perform manual procedures since we don’t use automatic recovery feature. According to the DRDB official documentation the solution is next. The problem is drbdadm doesn’t have  ‘–discard-my-data’  option and exits with error: The…
Read more

RPM: last installed packages

1. To get list of last installed RPM packages you can simply use next command: 2. To get list of packages installed sorted by size use: Didn’t find the answer to your question? Ask it our administrators to reply we will publish on website.