How-to VPN for Mac OS X 10.4 Tiger

Creating a VPN connection for Mac OS X 10.4 Tiger

  1. Open your Applications folder.
  2. Click on Internet Connect.
  3. Click on the VPN icon. A small option window will open.
  4. Select the L2TP over IPsec or PPTP option and click Continue. The small option window will close.
  5. Select Edit configurations in the Configurations drop down menu.
  6. When the large option window opens, type in the following:
    • Description: (a connection name)
      Note: It is recommended to use a memorable name, such as <location name> VPN.
    • Server Address: <VPN Server DNS name or IP Address>
    • Account Name: Your Account name
  7. Select the Password option for User Authentication.
  8. Click OK and then Connect. A small window will open.
  9. Type your Banner password in the Please enter your password field and click OK.

When connected you will see “Status: Connected to <ip address of location>”

Another VPN how-to with screenshots: https://www.publicvpn.com/support/MacOS10.4pptp.php

Fresh GENTOO on old hardware

I’ve been trying to build a cross-compiler for x86, x86_64, PPC, PPC64 and ARM so I can built a DISTCC cluster… This hasn’t been going so well…

I tested on Gentoo and found the cross compiler there worked so I figured I’d spend a day and install Gentoo on a couple of older PCs… Spent a week on it =/

Machine #1: PowerMac G4 [PPC 1GHz, 384 MiB Ram, 80GB Disk]
Machine #2: PowerEdge 6450 [Quad Pentium 3 700MHz XEON, 1GiB Ram, 16GB Disk]

First Problem: The new minimal install CDs don’t seem to work on these so I use the old 2008 minimal CDs which boot fine.

Second Problem:
* ERROR: sys-apps/portage-2.1.9.25 failed:
* IO Failure -- Failed 'touch .unpacked' in /var/tmp/portage/sys-apps/portage-2.1.9.25
*
* Call stack:
* ebuild.sh, line 2320: Called ebuild_main
* ebuild.sh, line 2227: Called dyn_unpack
* ebuild.sh, line 746: Called die
* The specific snippet of code:
* touch "${PORTAGE_BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in ${PORTAGE_BUILDDIR}"
*

Imagine that… /bin/touch is broke?!

The fix: http://forums.gentoo.org/viewtopic-p-6521257.html
Copied from external site:

mv /bin/touch /bin/oldtouch
echo '#!/bin/sh' > /bin/touch
echo 'echo -n >> "$1"' >> /bin/touch
chmod +x /bin/touch

After you get the system going, move the old touch back – It’s an issue with the old kernel on the boot cd and coreutils (i think)… the new kernel works fine.

Third Problem:

After a reboot, neither machine will finish the init process and the process is extremly slow. Then I noticed they kept repeating this message:
“caching service dependencies…”
There was also notices about the time being newer than it should be… So my time was in the future when I was setting up the Gentoo servers…

The fix:

find . -print0 | xargs -0 touch

(I had to undo my touch fix above to make this work.)

Fourth Problem:

The PPC Machine wouldn’t boot – it couldn’t find it’s root. Come to find out, in /dev I had no hdX or sdX devices…

> e2fsck_check_if_mount: Can't check if filesystem is mounted due to
> missing mtab file
> fsck.ext3: Device or resource busy while trying to open /dev/hda4
> Filesystem mounted or opened exclusively by another program?

I left this line in on the kernel setup:

General setup  --->    �
[ ] enable deprecated sysfs features to support old userspace tools 

After I unchecked that, the machine ran with no probelm. The udev package creates these devices, but becuase the kernel was trying too… well, noone got along until I fixed the kernel. http://forums.gentoo.org/viewtopic-t-841573-start-0.html, http://forums.gentoo.org/viewtopic-t-854350-start-0.html

Fith Problem:

When I isntalled yaboot, it wouldn’t run… again it was because the new yaboot doesn’t like the old kernel… The fix was simple… Run the yaboot from the live cd specifying the –chroot /mnt/gentoo or –config /mnt/gentoo/etc/yaboot.conf

Sixth Problem:

On the PowerEdge 6450 server, after I installed Gentoo, the kernel would freeze on “BIOS data check”. After some google’ing I found that if I added “nobd” to lilo then it would auto skip the BIOS data check… Within lilo.conf you can set ‘suppress-boot-time-BIOS-data‘ in the global options. There maybe a kernel setting in make menuconfig but I haven’t looked hard enough. (This machine takes several minutes to boot so I REALLY don’t want to mess with this.)

Now both machines have Gentoo installed and are running a system update with modified CFLAGS (to take advantage of altivec, mmx, sse and so forth.)

Reason of post: So next time I do this I can quickly see how to fix these errors =P

QEMU PPC and slackware – part 2

Now I have Slackintosh 12.1 installed… I reboot to find it can’t boot. It just has the OpenFirmware header and stalls. I have no clue if yaboot even works on QEMU for PPC… =/

In the meantime I am using this to boot the Slackintosh image:

qemu-system-ppc.exe -cpu G4 -M mac99 -m 512M
 
-hda IMAGEslack.qcow2
  -cdrom ISOslackintosh-12.1-dvd-install.iso
  -kernel KERNELSLACKKERN
  -initrd KERNELSLACKINITRD
  -append "root=/dev/hda3 ro video=ofonly"
  -net nic,vlan=0,macaddr=52-54-00-EA-B0-9A,model=pcnet
  -net user,vlan=0,restrict=no,hostfwd=tcp:127.0.0.1:2222-:22

This lets me boot with no problems and I can ssh into 127.0.0.1:2222 and get access to the emulated Slackintosh. (Using -net user... doesn't allow internal network access, but allows internet access which is what I need at the moment. With SSH being open on the local box I can move files in an out with no issues.)

Next: recompile Slackware 13.1 sources...
Todo: attempt to use QUIK instead of YABOOT for booting the image

QEMU PPC and slackware – part 1

So, I got bored one weekend and got my PowerPC 1GHz custom built Mac out… It currently has Gentoo installed and I prefer Slackware so I got the idea: “Let’s port Slackware over to PowerPC!”… Of course it’s been done before with the Slackintosh project but it hasn’t been updated in a year and I want Slackware 13.1 to have my linux pcs to be in sync.

Idea 0: Install Slackintosh 12.1 then update the sources… I can’t get the CD to boot =/ no go…

Idea 1: Compile Slackware 13.1 Sources on Gentoo (this does require manually installing pkgtools.) — Well this is NOT straight forward as Gentoo does some things differently. (ex. GNAT, LTO, and other packages can’t be found when comipiling GCC… They do exist on Gentoo though.) – That is put aside for the moment…

Idea 3: Install Slackintosh in QEMU and copy packages via SSH to the PowerPC box and then upgrade (after recompiling the upgrades…) — This is in progress…

QEMU and Slackintosh: Well, the CD doesn’t boot here either BUT I extracted vmlinux and initrd from the ISO and I can boot QEMU that way so I can install Slackintosh in QEMU.

QEMU Command:

qemu-system-ppc -cpu G4 -M mac99 -m 512M
  -kernel KERNELVMLINUX
  -initrd KERNELINITRD
  -append "cdroot root=/dev/ram0 ramdisk_size=25600 rw"
  -net nic,model=pcnet,macaddr=52:54:00:12:34:58
  -net user,restrict=no,hostfwd=tcp:127.0.0.1:2222-:22
  -boot order=ncd -hda IMAGEslack.qcow2
  -cdrom ISOslackintosh-12.1-dvd-install.iso

This forces QEMU to run as a NewWorld PowerMac – not my exact model, but close enough.

PS – the normal command with a good CD Image is this:
qemu-system-ppc -boot order=d -cdrom ./iso/image.iso

This is slow to install but o-well… It is emulated =D

Updated: 2/19/2011 – removed -net tap… as -net user… is all i need for network access currently.

Video Streaming in Linux

Listed below are the different applications/projects for steaming video and audio.

  • MythTV – untested
  • FreeVo – untested
  • VLC – untested
  • ffserver (ffmpeg) – untested
  • Darwin Streaming Server – untested
  • mpeg4-ip – untested (does it still exist?)
  • IceCast – Audio Only
  • ShoutCast – probably won’t test, but may if I get bored… – Audio Only
  • fuppes – untested – to play videos on PS3 and such

As I test, I’ll do a review or something…

VirtualBox – Create a VM Headless

The steps I take to create a new virtual machine; in this case, a windows server machine:

VBoxManage createvm --name "WINSRV08R2" --register
VBoxManage modifyvm "WINSRV08R2" --memory 1024 --acpi on
VBoxManage modifyvm "WINSRV08R2" --boot1 dvd --nic1 nat
VBoxManage storagectl "WINSRV08R2" --name "IDE Controller" --add ide
   --controller PIIX4
VBoxManage createvdi --filename "WINSRV08R2.vdi" --size 10000 --register
VBoxManage registerimage dvd /home/image.iso

VBoxManage storageattach "WINSRV08R2" --storagectl "IDE Controller"
   --port 0 --device 0 --type hdd --medium "WINSRV08R2.vdi"
VBoxManage storageattach "WINSRV08R2" --storagectl "IDE Controller"
   --port 1 --device 0 --type dvddrive --medium /home/image.iso
# VBoxManage modifyvm "WINSRV08R2" --dvd none

Now that the machine is created, we need to start it and turn it off – here are the commands to do so:

VBoxHeadless --startvm "WINSRV08R2"
VBoxManage controlvm "WINSRV08R2" acpipoweroff

I post this as a reference to myself as I have to keep looking for this online.

Notification via Email of IP Address Changes

Since I’ve moved I have a smaller DSL ISP that like to keep short dhcp leases. I found out quickly that on each router reset I get a new IP Address. Over the last few weeks it’s gotten even better… Now intermittently my PPPoE loses connection and is forced to reconnect. (My TV is on the same line and it’s been flaking out too so I know it’s not my router… It could be my modem so I’ll keep an eye on it.

Because I like to connect to my home PCs from anywhere, I need to know my IP address and when it changes. Last night, while watching to see if the tornados were coming to my house, I sat down and began to write a shell script that would detect my current IP and see if it has changed.

The script is pretty simple really… Here is what it does:

  1. Check to see if there is an IP address already recorded
  2. If yes – get and md5sum on the file and then move it to another file
  3. Get my current external IP address and save it to file
  4. Caclulate the md5 on that new file
  5. Check the two md5 sums and see if they match
  6. Do they match? Do nothing
  7. They don’t match? Lets send an e-mail to let me know

I also had a couple of bottlenecks. The first is that I couldn’t get sendmail to send an e-mail from my box… To get around this, I made a PHP script and put it on a web server. Now when I go to send the e-mail I call ‘wget -qO- “myurl?key=1&ip=${MYIP}” | grep cat.

The second concern is that I am calling an external page to find my external IP address. I’m afraid they might think I am spamming them so I created another php script to return my external IP address and posted it on my web server as well.

Now everything is working and I’ve setup an hourly cron job to run the script.

The shell script:

#!/bin/sh
cd ~
# curl -s checkip.dyndns.com | grep -Eo “[0-9]+.[0-9]+.[0-9]+.[0-9]+”
# curl -s www.whatismyip.com | grep -Eo “[0-9]+.[0-9]+.[0-9]+.[0-9]+”
# curl -s www.info66.net/whatsmyip.php | grep -Eo “[0-9]+.[0-9]+.[0-9]+.[0-9]+”
# MYIP=`curl -s www.ipchicken.com | grep -Eo “[0-9]+.[0-9]+.[0-9]+.[0-9]+”`
MYIP=`curl -s www.info66.net/whatsmyip.php | grep -Eo “[0-9]+.[0-9]+.[0-9]+.[0-9]+”`
MD5_LST=”"
OLD_IP=”"
if [ -f ExtIp.txt ]; then
    MD5_LST=`md5sum ./ExtIp.txt`
    OLD_IP=`cat ./ExtIp.txt`
    mv ./ExtIp.txt ./PrevExtIp.txt
fi
echo $MYIP > ./ExtIp.txt
MD5_NOW=`md5sum ./ExtIp.txt`
echo ” Ip: ${MYIP}”
echo ” Now: ${MD5_NOW}”
echo ” Lst: ${MD5_LST}”
if [ "${MD5_NOW}" != "${MD5_LST}" ]; then
    echo “IP Address Changed to ${MYIP} from ${OLD_IP}”
    wget -qO- “http://www.webserver.web/email.php?key=abcdef&ip=${MYIP}” | cat
fi

whatsmyip.php

<?php
	$ip = "";

	$ip = $_SERVER['REMOTE_ADDR'];

	echo "<h1>Your IP Address Is: " . $ip . " </h1>";
?>

email.php

<?php
    $key = "";
    $ip = "";
    $to = "";
    if ( !empty($_GET['ip']) ) {
      $ip = $_GET['ip'];
      $message = "My new IP is " . $_GET['ip'] . "...";
    } else {
      $message = "This is a test";
    }
    if ( !empty($_GET['to']) ) {
      $to = $_GET['to'];
    } else {
      $to = to@email.com;
    }

    if ( !empty($_GET['key']) ) {

           $key = $_GET['key'];

       } else {

           $key = “”;

       }

 

       $subject = “My New IP Address: “ . $ip;

       $headers .= “From: from@address.comrn”;

       $headers .= “Reply-To: from@address.comrn”;

       $headers .= “Return-Path: from@address.comrn”;

       $headers .= “X-Mailer: PHP/” . phpversion() . “rn”;

       $headers .= “MIME-Version: 1.0rn”;

       $headers .= “Content-Type: text/html; charset=”iso-8859-1″n”;

       $headers .= “X-Priority: 1 (Higuest)n”;

       $headers .= “X-MSMail-Priority: Highn”;

       $headers .= “Importance: Highn”;

 

       if ( $key == “abcdef” ) {

              // This $key is just a safety check so people can’t

              // use this as span so easily

              $status = mail($to, $subject, $message, $headers);

       } else {

              $status = 0;

       }

 

       if ($status) {

              echo “Successrn”;

       } else {

              echo “Failedrn”;

       }

?>

My setup: Clock sync using NTP on Slackware

I’m setting up one server on my network as a time server and the other servers will synchronize against it. I’m using ntp servers from this URL: http://tycho.usno.navy.mil/ntp.html.

My Server Setup:

ntpd server: SlackNode10 with an IP of 192.168.1.210
ntpdate client: SlackNode00 thru SlackNode09

ntpd server setup

My /etc/ntp.conf

server  now.okstate.edu         # Stratum 1: Oklahoma State University, Stillwater, OK
server  tick.uh.edu             # Stratum 2: University of Houston, Houston, Texas
server  192.168.1.0             # local clock
fudge   192.168.1.0 stratum 10

driftfile /etc/ntp/drift
multicastclient                 # listen on default 224.0.1.1
broadcastdelay  0.008
restrict default noquery nomodify
restrict 192.168.1.0 mask 255.255.255.0
restrict 127.0.0.1

Start the ntpd service

# ntpdate -u now.okstate.edu
# chmod +x /etc/rc.d/rc.ntpd
# /etc/rc.d/rc.ntpd start

ntpdate clients setup

My /etc/cron.hourly/ntpdate.sh

#!/bin/sh
/usr/sbin/ntpdate -s -u 192.168.1.210
/sbin/hwclock --adjust
/sbin/hwclock --systohc
exit 0

.

Slackware 13 – Install Virtual Box

This was pretty simple… Download the “All distributions” build. (My PC is 32 bit and I have not tested the 64 bit install – i’d imagine it being the same…)

# sh ./VirtualBox-3.1.6-59338-Linux_x86.run
# sh /etc/rc.d/rc.vboxdrv start

If the compile failed on setup (your linux src dir (/usr/src/linux) must be up to date with the running kernel so it can compile the drivers.) and after you setup you linux sources you just run this:

# sh /etc/rc.d/rc.vboxdrv setup
# sh /etc/rc.d/rc.vboxdrv start


Then you good to go… =D

Virtual Box is WAY easier to setup than VMWare AND you don’t need the pesky PAM gunk =D

Install Windows from a USB Drive

Background:

I have several pcs and servers at my house. Most don’t have CD/DVD Rom drives because they don’t need them 98% of the time. This other 2% of the time isn’t worth the money when a DVD drive could be connected temporarily but why when you can install from USB drives? Here are the instructions on how to go about doing this.

How to:

  1. Insert your 4Gb+ USB drive
  2. run “diskpart” – you may need to download this tool from Microsoft
  3. type “list disk” and identify the USB drive (remember the Disk ###)
  4. type “select disk 3″ where 3 is the disk number from above
  5. type “clean” so that it removes everything from it (wipes the partition table on the USB drive)
  6. type “create partition primary” to create a new partition
  7. type “active” to make this partition bootable 
  8. type “format fs=ntfs quick” to perform a quick format of the drive
  9. type “assign” to mount the drive and allow access to it via explorer
  10. now you can exit diskpart
  11. See Extra if this doesn’t work
  12. copy over all files from the Windows DVD (I’ve tested with the free Windows Hyper-V Server R2 and with Windows 7 Enterprise x64)
  13. Now the USB drive can be used to install Windows (Your BIOS has to support and enable this)

Extra: (This allows it act like a “USB-ZIP” or “USB-SUPERFLOPPY” or “USB-FLOPPY” from Windows” as my BIOS doesn’t support USB-HDD directly – OK, I’m not sure how it works, but this allows me to boot it.)

  1. at a cmd prompt:
  2. type “<CDROM DRIVE LETTER>:” – ex. “D:”
  3. type “cd boot”
  4. type “bootsect.exe /nt60 <USB Drive>” – ex. “bootsect.exe /nt60 F:”