ldap search function

2014-08-25 2 min read bash Learning
First you will need the ldap search utility. The client for ldap search comes in openldap-clients, so you need to install that first: sudo yum install openldap-clients Now, that you have installed it, try to find something in some open ldap server, example: ldapsearch -LLL -h db.debian.org -x -b "dc=debian,dc=org" "cn=Joao*" This should list couple of entries for you. Now, that you have ldapsearch working, lets define a function in . Continue reading

rfc2html – php script to view rfc with index and links.

2014-07-21 2 min read Learning Linux
If you have to keep viewing RFC’s and you miss index and links in RFC while viewing rfc, then you should check-out rfc2html. It is scrtip that takes plain text rfc and converts it to html. You can get the original code from sourceforge. However, I found some small issues with the script and have sent a mail to the authour about the same. In the meantime, you can use the diff below to fix the issue’s or download this diff file rfc2html. Continue reading

get the contents of whole site like some wiki or wikia

2014-02-24 1 min read Learning Uncategorized
For wikis and wikia, generally if you are trying to get some url mirror, then websucker.py is an excellent option. This script is in the python sources so, to get this tool, yumdownloader --source python Install the rpm downloaded in current directory and then go to ~/rpmbuild/SOUURCES. You should find a Python-*.tar.xz file here, just extract with tar xvf Python*.tar.xz and there you go, you should find the tool in Tools/webchecker/websucker. Continue reading

inotify -watch for file to change

2014-01-28 1 min read Learning Linux
Here is a simple command for you. It uses inotify tools. So first you need to install : sudo yum install inotify-tools and then you can try something like this: while true; do inotifywait -r -e modify --exclude=".swp" . && make; done Here, once the file changes, we are running make, but you can do anything you want. Related articles Development Server: Automatic Reload on Code Change Concurrent or lock access in bash script function

cgroups – use to control your cpu and memory

2014-01-06 2 min read Fedora Firefox Learning
cgroups is a kernel feature and with userspace utilities, we can use the feature to control the cpu and memory for per process. So, lets first install the required tools. sudo yum install libcgroup-tools Now, we need to enable the service. sudo systemctl enable cgconfig.service sudo systemctl enable cgred.service cgconfig.service is to enable configuration for cgroups and cgred.service is to enable configuration for cgroups for processes depending on the name. Continue reading

Fix typescript files generated with script command

2013-12-18 1 min read Learning Linux
Generally quite a lot of us would have used the script command. This generates the logs for the session. But the problem with the logs is that it contains a lot of un-readable characters. These characters are mostly from the color codes, and as such can be removed very easily with a single command: cat typescript | perl -pe 's/e([^[]]|[.*.*?[a-zA-Z]|].*?a)//g' | col -b > typescript-processed This assumes the input log file is named as typescript and the output is kept as typescript-processed. Continue reading
Older posts Newer posts