Snapshot backup of linux system

The task at hand is provisioning a FC6 server, taking a snapshot backup, then restoring it.

The idea is to create a FC6 instance from CD install, just use all defaults, next, next, next, and you’ll and up with a partitioning scheme that looks like this:

/dev/sda1 /boot boot partition, ext3
/dev/sda2 VolGroup00
              LogVol00 / root partition, ext3
              LogVol01   swap partition

When you have it ready to capture, you shutdown, and boot with linux rescue. You’ll need another machine to provide NFS disk mounts. The idea is capture the backup to another server, over nfs, then restore it later.

Read moreSnapshot backup of linux system

Playing with Wake-On-Lan (WOL)

Pre-req:
+ Must have php5 with –enable-sockets

What is a magic packet?
It’s a udp packet sent through the broadcast address to all servers on the network (ie, all servers serviced by the broadcast address). It’s called magic, because the format of the message is so strange. A mac address looks like this, 00:30:1B:BA:FA:47, it’s a series of 6 hexidecimal numbers. The magic packet message is a 6 char header, then the mac address, converted to a character sequence, repeated 16 times.

Read morePlaying with Wake-On-Lan (WOL)

Net_IPv4 Coolness

Available from the PEAR website, http://pear.php.net/package/Net_IPv4, the Net_IPv4 package is pretty cool. Check this out:

<?php
require_once(“IPv4.php”);
$ip = $argv[1];
$netmask = $argv[2];

$ip_calc = new Net_IPv4();
$ip_calc->ip = $ip;
$ip_calc->netmask = $netmask;
$ip_calc->calculate();
$ip_calc->min = $ip_calc->network;
$ip_calc->max = $ip_calc->broadcast;
$ip_calc->min_long = $ip_calc->ip2double($ip_calc->network);
$ip_calc->max_long = $ip_calc->ip2double($ip_calc->broadcast);
$ip_calc->gateway = long2ip($ip_calc->max_long-1);

print_r($ip_calc);
?>

Read moreNet_IPv4 Coolness

Dell Inspiron 6000 and FC5 Wireless Experience

Wow, this took me a good two hours to figure out.

Luckily a had a wired LAN available to search Google to figure out how to get my Wireless card working. After installation of FC5, I could see “Intel Corporation Pro/Wireless 2200 BG” in my Network Configuration utility under the hardware section, but dmesg showed:

ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, git-1.1.1
ipw2200: Copyright(c) 2003-2006 Intel Corporation
ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
ipw2200: ipw2200-bss.fw request_firmware failed: Reason -2
ipw2200: Unable to load firmware: -2
ipw2200: failed to register network device

Read moreDell Inspiron 6000 and FC5 Wireless Experience

Connect to a Cisco VPN on Linux

Check out this: http://www.unix-ag.uni-kl.de/~massar/vpnc/, a more simple alternative to vphclient, see if you can get this working first.

yum install vpnc

Half way there. Next create a conf file at /etc/vpnc/my.conf (note, replace variables [var] with your values):

IPSec gateway [vpn_hostname]IPSec ID [group_name]IPSec secret [group_secret]# your username goes here:
Xauth username [username]# if you want to test rekeying specify nonzero seconds here:
#Rekeying interval 0

Read moreConnect to a Cisco VPN on Linux

Repeating same name parameters with nusoap

This article assumes you have a background with nusoap. Start by reading a nusoap tutorial or two, suggest http://www.zend.com/zend/tut/tutorial-campbell.php and http://www.scottnichol.com/nusoapprogwsdl.htm

I’m going to setup a soap server to except parameters. The method will do something silly, the point is to understand how to make a client with nusoap, when the server excepts repeating, same name parameters. This came up for me recently, and I struggled with it for hours, never did find a good explaination of it online, so I’m writing this for the next guy.

Read moreRepeating same name parameters with nusoap