Commandline tips
Do you think you know all great commands on the command-line? Then you have to take a look at this site. It’s a overview of the most used and most popular commands for linux.
Do you think you know all great commands on the command-line? Then you have to take a look at this site. It’s a overview of the most used and most popular commands for linux.
If you have a busy PostgreSQL database you may want to know which query takes up most of the time of the postmaster. To create a nice overview of slowest and most frequent queries you can use pgFouine.
This PHP script can parse a PostgreSQL log and create different reports.
The command I usually use:
./pgfouine.php -from "- 1 week" -memorylimit 512 -file <logfile.log> -logtype stderr -title 'PostgreSQL analyze' -report db-report.html= overall,bytype,hourly,slowest,n-mosttime,n-mostfrequent,n-slowestaverage, n-mostfrequenterrors -format html-with-graphs
If you have a linux system with ImageMagick, you can easily resize and auto orientate pictures with a bash script.
Just create a file called resize.sh with the following content:
#!/bin/bash size=$1 path=$2 list=`find $path*` for file in $list; do echo $file convert -auto-orient -resize $size $file $file done exit 0
And give it execute rights.
When you call “./resize.sh 1024 /home/user/pictures/” every picture in /home/user/pictures will be auto-orientated and scaled to a max height or width of 1024 pixels. The auto-orientate is done by looking at the exif info.
Looking for alternatives for Photoshop, Word, Excel, Visio etc? Try this website. You can search for commercial applications and find open source alternatives.
On my work I use a HP laptop with Ubuntu Intrepid. With Ubuntu and some nice applications you have a good platform for developing (web) applications.
These are the applications I use:
If you have CentOS running on a HP server you can install the HP support pack. On the HP site download the Redhat version.
First of all you need some rpm packages, this should be enough:
yum install rpm-build rpm-devel net-snmp glib kernel-devel compat-libstdc++-296 make gcc
Than you have to edit the /etc/redhat-release file. First make a backup of the original file. Than place the following line in it:
Red Hat Enterprise Linux ES release 5
The version number must match the CentOS version, in my case this was CentOS 5.2.
After this you can easily start the installation by typing: ./install<versie>.sh -nui.
If you have a ext3 volume on LVM you can easily change this volume.
When you want to extend a volume you can do this with lvextend.
To extend a volume with 10GB do the following:
[[email protected] ~]# lvextend -L+10G /dev/<volgroup>/<volume> Extending logical volume <volume> to 14.88 GB Logical volume <volume> successfully resized
After this you have to extend/resize the filesystem:
[[email protected] ~]# resize2fs /dev/<volgroup>/<volume> resize2fs 1.39 (29-May-2006) Filesystem at /dev/VolGroup00/os is mounted on /; on-line resizing required Performing an on-line resize of /dev/VolGroup00/os to 3899392 (4k) blocks. The filesystem on /dev/VolGroup00/os is now 3899392 blocks long.
That’s all!
You can do this without any problems on a live root file system.
This dutch site has a great overview of all popular dutch news and blog RSS feeds. It reads the feeds and shows the latest additions.
The snmp deamon logs a lot to the syslog deamon on CentOS. Especially when you have some monitoring with the snmp protocol.
You can change this by editing the init options of snmpd. This options can be found in /etc/init.d/snmpd. Search for the rule starting with “OPTIONS=”
Example:
OPTIONS="-Ls d -Lf /dev/null -p /var/run/snmpd.pid -a"
You have to change this to:
OPTIONS="-LS 0-4 d -Lf /dev/null -p /var/run/snmpd.pid -a"
This says that you want to log everything with a priority above debug to the syslog deamon.
In CentOS and other Redhat distro’s you also can create a file /etc/snmp/snmpd.options and put the options line there.
A online storage service with nice clients for Windows, Apple and Linux. And a very neat webinterface!
2GB storage for free, 50GB for 99,- dollar per year.