php 5.2 to 5.3 migration
Fri, 08/13/2010 - 23:32 — sandipThe new release of PHP 5.3 brought many important additions and changes to PHP. Although longly awaited, some of the changes are not backwards compatible. Thus, code that worked fine with 5.2 may produce warnings or fail in 5.3.
Quick research shows that most prominent applications had to be patched or changed, even though minimally, to work cleanly with 5.3. To help people to convert their web applications to 5.3, I present here a migration script that would allow you to inspect your applications for potential migration problems.
Creating a VPN in Minutes Using Remobo
Wed, 08/11/2010 - 05:05 — david23Remobo is a free software which can be used to replace the paid versions of existing difficult to use VPN setups
as it can create a VPN instantly and securely. It lets you login easily and add users to your buddy list, and create a secure network for you.
easy php-fpm install via yum
Tue, 08/10/2010 - 14:10 — sandipOn CentOS, php-fpm can be easily installed via CentALT yum repository. This requires epel repository too and will pull down any dependencies if needed.
-
Install EPEL release:
rpm -Uvh http://download.fedora.redhat. com/pub/epel/5/x86_64/epel-rel ease-5-3.noarch.rpm
rpm -Uvh http://centos.alt.ru/repositor y/centos/5/x86_64/centalt-rele ase-5-3.noarch.rpm
yum --enablerepo=CentALT --enablerepo=epel install php-fpm
The default settings should work quite well.
Bring up the service via:
/etc/init.d/php-fpm start
Varnish HTTP accelerator
Thu, 08/05/2010 - 09:04 — sandipA basic Varnish installation consist of Varnishing sitting in from of your web server (referred to as back-end), clients will interact solely with Varnish and never know there is a back-end web server (nor should they have access to the back end directly). When a request comes in to Varnish for a page that is being cached over a standard HTTP connection Varnish will either service this directly to the client (without sending a request to the back-end) from Varnish’s cache if exist or if not in cache will send a request to your web back-end over its TCP socket via an HTTP request...
GCstar is a free open source application for managing your collections. Detailed information on
Wed, 08/04/2010 - 02:21 — david23GCstar is a free open source application for managing your collections. Detailed information on each item can be automatically retrieved from the internet and you can store additional data, such as the location or who you’ve
lent it to. You may also search and filter your collection by many criteria.
expect script for ssh password prompt
Fri, 07/16/2010 - 10:15 — sandipBelow is a sample expect script to handle ssh password prompt should you not get the ssh keys to be working between hosts:
#!/usr/bin/expect -f
set host XXX
set user XXX
set password XXX
set remote_path XXX
set local_path XXX
# disables the timeout, so script waits as long as it takes for the transfer
set timeout -1
# call rsync
spawn rsync -av -e ssh $user@$host:$remote_path $local_path
# avoids that if the output is to large, the earlier bytes won't be fotgotten
match_max 100000
# we're expecting the password prompt, we use a pattern so it can be anything that contains password: or Password
expect "*?assword:" { send "$password\r"}
# send a newline to make sure we get back to the command line
send -- "\r"
# wait for the end-of-file in the output
expect eof
- sandip's blog
- Login or register to post comments
Show swap label
Thu, 07/15/2010 - 11:43 — sandipblkid can be used to display the swap label:
# blkid /dev/md2
/dev/md2: TYPE="swap" LABEL="SWAP-md2"
- sandip's blog
- Login or register to post comments
smartctl notes
Thu, 07/15/2010 - 10:25 — sandipBelow is a list of smartctl commands I frequently use to quickly verify disk health and status, specially when you have smartd logging errors to messages log file.
-
Print all SMART (Self-Monitoring, Analysis and Reporting Technology) information for drive /dev/sda (Primary Master).
smartctl -a /dev/sda
smartctl --smart=on /dev/sda
smartctl -i /dev/sda
smartctl -c /dev/sda
smartctl -H /dev/sda
smartctl -A /dev/sda
smartctl -t offline /dev/sda
smartctl -t long /dev/sda
smartctl -l selftest /dev/sda
smartctl -l error /dev/sda
There are more examples in man smartctl.
Non-desctructive read-write badblocks disk check
Wed, 07/14/2010 - 17:14 — sandipBelow command can be run on unmounted partitions to do a disk check of badblocks. Use -p if you need to automatically fix issues. Single "c" will only do a badblock read test.
e2fsck -vfcc -C 0 /dev/sdb4
"-C 0" -- displays progress
"v" -- verbose output
"f" -- force check
"cc" -- read-write test
- sandip's blog
- Login or register to post comments
- Read more
Pinguy OS:A Ubuntu-Fork
Tue, 07/13/2010 - 07:58 — david23This is a OS I have been working on since Ubuntu 10.04 Beta 2. I thought it’s about time I released it and get some criticism on it.There isn’t any 32-bit version as most people should have a 64-bit processors as they have been around for for a few years now.