php 5.2 to 5.3 migration

(via devzone.zend.com)

The 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

(via www.ubuntugeek.com)

Remobo 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

On 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-release-5-3.noarch.rpm
  • Install CentALT release:
    rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm
  • Install via yum:
    yum --enablerepo=CentALT --enablerepo=epel install php-fpm
  • Look through and edit /etc/php-fpm.conf . The config options are well commented... also available at php-fpm.org
  • The default settings should work quite well.
  • Bring up the service via:
    /etc/init.d/php-fpm start

Varnish HTTP accelerator

(via blog.flip-edesign.com)

A 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

(via www.ubuntugeek.com)

GCstar 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

Below 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

Show swap label

blkid can be used to display the swap label:

# blkid /dev/md2
/dev/md2: TYPE="swap" LABEL="SWAP-md2"

smartctl notes

Below 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

  • Enable SMART on device.

    smartctl --smart=on /dev/sda

  • Get info about the device:

    smartctl -i /dev/sda

  • Show the capabilities of drive. Also provides status when tests are being carried out.

    smartctl -c /dev/sda

  • Basic health status:

    smartctl -H /dev/sda

  • Display attributes. The attributes to look out for failing disk is Reallocated_Sector_Ct, Reallocated_Event_Count, Current_Pending_Sector and Offline_Uncorrectable. Their RAW_VALUE should normally be "0".

    smartctl -A /dev/sda

  • Immediate offline test which updates attributes value. Good to run after a badblocks fsck check before checking on the attributes values.

    smartctl -t offline /dev/sda

  • Run a thorough long test if you see suspect attributes with -A option as mentioned above.

    smartctl -t long /dev/sda

  • Examine self-test log. Shows if tests failed or passed.

    smartctl -l selftest /dev/sda

  • Display most recent error log.

    smartctl -l error /dev/sda

There are more examples in man smartctl.

Non-desctructive read-write badblocks disk check

Below 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

Pinguy OS:A Ubuntu-Fork

(via www.ubuntugeek.com)

This 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.

Syndicate content
Comment