Waiting for Christmas

Well not quite, but it seemed like that.

My replacement hard disk arrived on Tueday so I spent all night juggling disks and partitions. I moved around 70GB of data around and now have my 160GB hard disk as /home. The next step is to move the rest of the system onto the 60GB disk that used to be /home without doing a reinstall. If my calculations are correct, this shouldn’t be too bad. I’ve never done this before but it should essentially be a case of booting from a live CD, mounting the partitions and moving the data across as I did before with /home. I will need to edit /etc/fstab and /boot/grub/menu.list and then make sure that whatever will be primary master hard disk has grub on it. I will also double check that /boot/grub/device.map makes sense for how the disks are layed out.

The next morning, after just over a week of waiting, my broadband connection got upgraded to 2Mb. Woo! In that afternoon I downloaded Fedore Core 3, FreeBSD 5.4 for Sparc, OpenBSD 3.7 for Sparc, BeOS Developer Edition 1.1, Windows XP SP2 and Windows Services for Unix (both free via uni ;)), VM Ware Workstation 5.0 for Linux and Crossover Office 4.2. Most of this is just to play with :). In a week I will get Debian Sarge for Sparc and x86 and Fedora Core 4 provided there aren’t any further release delays.

I’m getting close to sorting out my uni mess. I have now been passed on to a 4th person who is the Associate Dean of the school. Can’t get much higher without a resolution. I also have a doctors note to back up my claims. With a bit of luck this will all be resolved by Wednesday morning. It looks like I will be allowed to finish my project over the summer and my remaining modules next year. God damn it’s been a long haul to sort all of this out, nearly 2 months. At times I thought it would all just fall apart and I would end up debt-ridden and unqualified. Thank fuck it’s nearly over and I have a new job.

My current todo list is 50 items strong. They’re not all critical to be honest and a lot are just little personal projects, but at least 8 require either immediate attention or attention within a week and probably another 10 or 15 are for my project. Meh.

Well anyway, I have to go. Item #51 is revise for my exam tomorrow afternoon.

Webcams and PHP assignments

Hmm I seem to have gone from 3-a-day topic based posts to once every few days, all-in-one posts. Maybe I’m getting lazy, or maybe it’s 3:30am again and I realise that I have something to blog about when really I should go to sleep and wait until the morning.

Well my PHP assignment is going a bit wrong and I have to submit it by 7pm today (today in the after ‘it’s after 00:00am’ sense, not the ‘new day when you wake up’ sense…)

I have to create an Apache Log Viewer thingy which takes user input via an html form for start and end days and times and then produces wonderfully detailed reports on various things from the logs. Which is fine except I don’t really know PHP and I’m a weak programmer. Plus we haven’t been taught more than basic syntax, commenting and variable manipulation in this module.

So, my thing is going ok, we were given an extension because several facilities weren’t working that we were supposed to use and I have all of my form and log file reading working ok except for one thing.

My form values are being POSTed fine across to the results page which does all of the validation before doing any calculations and whatever on them. I can echo them out no problem, except that as soon as I try to assign $_post[“whatever”] to any kind of variable or manipulate it with any kind of function, all I get is the same values every time, no matter what I enter into the form:


This is just the output of me echoing the variables’ content after trying to do anything with them. Same every time regardless of what I enter. The first 3 are the start values for day of current month, hour and minutes, the second 3 are the same for end times and the final one is a report interval in minutes. I have to produce separate reports for each interval of the specified size for the time between the start and end times. Apart from all being wrong, the minute based ones are 00 while the rest are 01.

I don’t know what the hell is wrong. All I have done with them before this is check that they are in the right range (day is not less than 1 or more than number of days in the month, minutes between 0 and 59 etc), I can still echo the posted variables correctly after this, as soon I try to do anything else they go weird and I get the same values as above each time.

I need to put them into 2 digit day or time format, eg 00-09 and then 10+ and so on but I can’t touch them because I get the above output, I can’t think why this could be, unless it’s because they’re strings and I have to cast them to ints, longs or some kind of date/time type, but I thought PHP did this for you. It would also be nice to find a checktime function, like checkdate that just checks that your values are valid times and formats them according to your whims. I’ll have to play with strftime more. Until I can solve my weird variable problem and format my days and times to be 2 digit I can’t do any date/time analysis or create separate time based reports, which means I’ll struggle for a D. Shit. Maybe I have this all wrong.

On another note, I’ve been playing with my webcam today. I’ve never really bothered with it much before because I hadn’t had much luck with it under Linux until I started using Ubuntu, even though it is supported. It’s a Philips webcam so how much longer it remains that way I don’t know.

Well anyway, I wanted to record a video clip. Couldn’t. XawTV will display the stream but won’t save it to disk. Back to Windows to give the old driver CD a whirl. Installed the utils that came with the camera way back when and recorded an extremely long clip without a problem, no dropped frames or anything, apart from that I had let it run too long and the software stopped recording at 4GB. It occured to me that this was a home-user product from the Win98 era, quick check on FAT32 file sizes and yep I was right. Max file size is 4GB. Obviously to prevent the software hanging and the OS having to intervene to stop itself going down too, the video capture app cuts the file off at 4GB. Shame, what I wanted to record would have been about 45GB. Don’t know why it didn’t get the max file size from the OS or the filesystem type. Win2k had just come out at the time (ie NTFS – 16 terrabyte max file size). There are no newer versions of this software available either unless I’m paying I guess and it’s an OEM product, probably tied to the camera model like some optical drive manufacturers do with copies of Nero.

So I’ll have to put more work in on XawTV, I’d much prefer to use Linux anyway, Windows was just a case of having to make it work quickly. I just want to be able to use it as a cheap and nasty ‘capture a moment’ type device that is easily portable with no file size problems.

After this I decided to play with setting up a webcam page on my desktop’s Apache server. I’ve been interested by this idea for a long time. I came across some useful links by chance today. I used the webcam utility (can’t find a link, you try searching google for linux webcam utility) and this tutorial and I was up in minutes. Delighted.

Whether the drinkycam ever goes live to the world is another question. I don’t really fancy having my every move publicly available (unless there was money or sex involved…) and I don’t want to have to remember to turn it around everytime I get dressed/undressed, go to sleep, pick my nose, scratch my arse or whatever people do without thinking about it when nobody is around.

In the mean time, I have to go to sleep, have a look at the Video 4 Linux resources and the Webcam Howto.


Hideously disconnected 4am thoughts

This is going to be random…

First of all I’m in a whirlwind. I have so much uni work to do I don’t know what I’m going to do. After a serious period of inactivity I’ve actually started and made some progress with my uni assignments. The major ones at the moment are my Web Based Information Systems PHP assignment and my dissertation draft report, both conveniently due on 8th April. Shit.

WBIS has been slow since I am pretty much learning PHP from scratch. Thankfully Jono from Open Advantage, Wolves LUG and LUG Radio gave me a 2 days beginners course in using LAMP in January (people looking for a pre-configured version of Apache, MySQL and PHP, Perl and a host of other stuff with a nice installer for Linux, Windows, Mac OS X and Solaris should check out XAMPP). The bad thing about this is that I haven’t been able to make the most of what I learned until this assignment and I’ve pretty much had to start from scratch. Fortunately the one thing that has stuck in my head is the syntax. My knowledge of available functions is pathetic however. I discovered late last night as my girlfriend slept beside me that I have spent about a week trying to use drop down boxes to limit user input so that I didn’t have to faff with various date formatting and then validation, when there is a function that checks if a date is valid called checkdate() which will pretty much (I assume, haven’t had chance to try it yet) take any input and give you a yes or no on whether the input is a date and whether it is a valid date (ie it picks up Feb 29th on a non-leap year). I also spent a day trying to work out how to get PHP to give me the first and last line of a ~500MB log file so I could explode them and work out the first and last date/time entries. In dispair I posted to the Wolves LUG mailing list asking if there were PHP functions similar to the Unix head and tail commands and was informed that I should use head and tail from within PHP. A quick google and there I was with shell_exec(). I’ve been going for a week and I have a week to go, I still haven’t got a D grade :-/ I’ve still got to do all the DNS lookups and chart drawing in PHP and if it it takes me a week to get a web form that doesn’t link to it’s results page yet… I just wish I had someone sitting on my shoulder to assist when I get stuck. It would speed me up by 100% easily. My girlfriend (not computer literate at all) has had to endure hours of relentless ranting about things she doesn’t understand, which usually culminates in me explaining the intricate details of things she will never understand, or need to. I know quite a lot about programming theory for an almost non-programmer and she just looks at me like a light that went out. Poor girl.

Oh, btw the way when I say I have been working on something for x units of time, you should take for granted that this time is liberally sprinkled with cigarette smoking, head scratching and frustrated swearing…

I’m really enjoying this assignment though, I haven’t written any code in maybe 2 years, I’m a terrible programmer, mainly because I’ve never taken the time to sit and learn any language properly, just enough to hack an assignment pass together and forget about. As a consequence I’ve started tentatively rewriting my site in php, I’ll do the lot before it goes live, it’s too big a job to do in public. Just working with the raw code lays bare how bad all of these WYSIWIG web editors are at writing html. I’m a real beginner at this but I can see how bad it is. Bascially Frontpage and Dreamweaver have made paragraph, font, bold and whatever else tags with alignment added for good measure to pretty much every individual item of text on every page. I’ve cut the page sizes (in KB) by around a third while keeping the same layout. Appalling.

The assignment I’m doing means I have to learn to use a language that fits in with my idea of the kind of things I need to know, which is that to be a good Linux sysadmin, I need a scripting language and some decent web coding to start the money rolling in when I finish uni. I think I’m going to have to fix Windows machines for ~£20 a throw when I leave uni so I have some money while I wait for my first proper job. I’m very good at hardware and software issue resolving to be honest. It’s a valuable skill to have.

I have been surprised to see that my html is pretty good, if basic. I’ve never sat and learned html, it’s amazing how much you pick up without noticing. Not that it’s hard of course. I’m certainly no web guy like Jono or Aq though. The good thing about this assignment though is that it will be easily portable to my project as an end-user style log reporting web interface for a black box internet firewall appliance. It will also be very easy to move to different log files so I will be able to display simplified log information for a range of network services to the kind of person that just wants to see if it works and if anyone has done anything nasty to their machine.

My draft dissertation is in a worse state. Because I’ve spent all my time on the PHP assignment, I’ve hardly touched my report and I now need around 8,000 fully researched words in a week. Fuck.

In other news… I bought a V Festival ticket. I went last year, it should be great. I just missed the selling out of the tickets though, we had a power cut and my alarm reset so I didn’t get to the box office, I tried to get one online but they were all sold out so like last year, I had to pay probably a third on top of the retail price to get one from ebay.

I’ve been scan reading some blogs tonight, trying to get my unread count down below 2,000 (I’m subscribed to a lot of Planets). I’ve decided that I should get up to date with some cool Mozilla Firefox extensions, like Google and ebay search extensions. I read some stuff the other day but I lost the link, so I can’t say what. It was a list of cool Firefox search extensions with feature comparisons. If anyone knows what this blog link is please let me know. It mentioned an academic one for searching ACM etc.

I finally wiped the evil that was my OEM Windows XP Home installation from my laptop and installed a preview of Ubuntu Hoary, prompted by the need for mobile tools to do my PHP assignment like Bluefish, gFTP, Apache and PHP to test it in a disconnected environment (ie my girlfriends house). It’s great apart from the installer barfed on my 2GB /var partition while downloading updated packages, so I reorganised the partitions and redid the remaining steps only to see it refuse to install GRUB. I lost about 3 hours to that and had to leave it overnight and finish up in the morning. It’s been great ever since though, I’m using it now. It sometimes feel a little sluggish but it’s a 1GHz Celeron with 256MB SDRAM, so it’s going to feel that way whether I run Windows or Linux.

I have to say, I really like Bluefish and I think gFTP is the best FTP client I’ve used on any platform.

As it went so well and it’s so close to official release time, I upgraded my main workstation from Warty to Hoary, I wanted the newer Bluefish, Gnome and Firefox and also an end to the boot slowing PCI hotplug errors that seem to be common to Warty, along with the ACPI_Power_Off called message that signifies that my machine isn’t going to power itself off. It went ok, there are a few cosmetic issues like a missing Home icon in Nautilus (fixed by a dist-upgrade about 8 hours after this post), a new Debian submenu that I don’t want and a load of KDE packages I didn’t ask for (now removed). The major bitch is that I seem to have done it at a time when various PHP packages including the apache module have been held back and can’t be installed due to dependency issues, so now I’ll have to do my assignment on my laptop until it’s fixed (fixed by a dist-upgrade as above). Xorg, which was my big fear works fine with my ATI card. I can now play Tuxracer and Tuxkart without extraneous polygons making it unplayable 🙂 I also seem to have been infected by Gnometris at a time when I could do with it the least. I had to uninstall Wolf ET and Bygfoot for this very reason. Hopefully the PHP stuff will be ok in a day or 2.

Incidentally someone has taken the last free release of Tuxracer and built on it to make Planet Penguin Racer. Sure to be worth a few wasted hours. As should Thunder and Lightning, a flight sim similar to FlightGear, with added aerial combat.

I still have to decide if I’m more productive in Linux or Windows. I think the main issue is my motivation to do the work, but after moving to Ubuntu as my main OS, I set off at a trail-blazing pace for a few days, citing the joys of Open Office.org‘s turned-on-by-default word auto-completion as a major factor, but I’ve really done little written work since, I’m not sure of this is environmental or just whether I don’t really want to do the work. On this note I have to say I am really looking forward to seeing Open Office.org 2.0 hitting my desktop and hopefully, that of many other people besides.

On the topic of work again, I’m really stuck with the practical side of my project a (Linux) black box Internet firewall appliance, with local network serving (web, mail, Samba, DNS, DHCP etc) capability and web admin interface (yes I am aware of the risks of having a firewall do this kind of thing). All that remains is spam/virus mail filtering (ClamAV and Spamasassin), firewall/NAT, web interface and a specialised kernel. Oh and probably tying fetchmail into the mail system.

The firewall I will probably do in Guarddog, not a problem, I just need to finish the rest first. A kernel and fetchmail I will do at the end if I have time. The web interface is in progress, thanks to my other assignment. The problem I have is that probably since Christmas time I’ve been trying to find a simple to read guide on tying ClamAV and Spamassassin into a Postfix mail system on Debian. There doesn’t seem to be such a document. I’ve read quite a lot (not enough as it seems to be written in Hebrew to my eyes) on the subject and still don’t have a a good understanding of what I have to do. A lot of the things I’ve read seem to be for Red Hat 8.0. And Debian do things differently. I had to abandon Cyrus-IMAP for this reason. Mail filtering is pretty core to my project, I wish someone would just fall from the sky and show me how to make it work, but I guess I’m just going to have to sit and read all of the ClamAV, Spamassassin and Postfix docs and work out what applies and what doesn’t. As if I wasn’t short of time already.

I think all this uni stuff adds up to the fact that I’m in deep shit and if I don’t fail, I’ll be lucky to get a reasonable degree at all. 6 years and �25,000 of graduate debt doesn’t seem worth it for a 3rd class degree and a crap job.

I think I’m near the end now. Aside from uni work, I have no money. Which is bad, I’m having to live off my Barclaycard at a highest-in-the-country ~19% APR. And it’s my best friend’s girlfriend’s birthday this weekend. My friend Lindsay is coming from London for the weekend, Chris wants me to accompany him on a night out, all on the same night and another friend, Rebecca who I used to work with is having a birthday drink on Sunday. Sadly I don’t have enough money for my friend’s girlfriend’s birthday as they’re taking a train to Birmingham (£30 return taxi fair), going for a meal and a night out. I feel bad but I just can’t make my empty pockets stretch to that. My friend from London is visiting her mum for her birthday which I can afford (ie no cost ;)), but I’m not sure if I can stretch to a night out afterwards with Chris or Rebecca. I’m back at uni after Easter on Monday so Sunday night will be panic night. Sorry to everyone who loses out (ie is pissed off at me for not going to their thing), but I just don’t have any money for these things, nor do I have the time to take out to do them. Saturday night is the one night I do take out for chilling (aka partying), but I’ve hardly been out in weeks with the cash shortage, so much so that when I bumped into Chris and Holdsworth almost by chance the other day, they hugged me like a long lost friend and looked at me with amazement that I was in front of them.

On one or 2 final notes. I attended the Wolves LUG meeting on Wednesday briefly, which was cool because I haven’t been able to go for some time. And also, I ought to trumpet LUG Radio Live once again. Linux stuff, Linux people, Linux jokes, getting drunk with Linux people and playing LAN games like Wolf ET are all up for the taking on June 25th 2005 at the Molineux Stadium, Wolverhampton, UK. Tickets are £5, people are coming from as far as France, Canada, Sweden and erm… Wolverhampton to be there. I am, are you? Read the Lug Radio Live forum, people are even trying to help you find a hotel in the area.

Speaking of events, Aq asked me at the LUG meeting if I was planning to go to What The Hack. I certainly am, it will be my first proper computer festival, in the music festival kind of way (ie sitting in a field with a laptop and a load of stoned geeks). I just have to raise some cash.

I think thats it. It’s 5:45am. If you read this before 3pm Friday 1st April 2005, I’ll add all of the links in later… I’ll also probably fix the typos and add all of the other things that my Swiss-cheesed brain had forgotten. I still have about 6 unwritten/unfinished articles waiting to be posted on here, some of which as are actually quite intelligent, unlike this one. This is just a bulk update.

It’s been a while since I last said anything useful on here so, this accounts for the last 2 weeks of blog inactivity, sorry to give it all to you at once, in no particular order and without suitable headings. God help Google when it tries to pull anything useful out of this lot for search results.

Oh, ok, that reminded me, one last thing. The search terms people use that have caused people to read my site and my blog are hilarious and quite impressive all at the same time. The impressive ones are the stuff about Linux, networks and computers in general, I never thought people would actually use them as any kind of authoritive resource (thats not say that they did). The funny ones include ‘Does Posh Spice take it up the arse?‘, ‘Prague Street Prostitutes‘, ‘ ‘most scorpios are murdered‘, ‘hopeless bastard‘, ‘world record ejaculation’, ‘world record for semen swallowed‘ and a worrying amount of hits for ‘ladyboy‘. I might link to the relevent pages when I get up so you can all read it again and see what pages people actually got.

Shit, I just did a word count on this post, about 2,600. That would do for one of my assignments.

I’m going to bed, goodnight 😀