Archive for the ‘Development’ Category

It all comes back

Tuesday, May 18th, 2010

Weird huh…

I have an idea for a project I want to do, probably not terribly exciting to most but it is to me.  It has been quite a while since I got my hands dirty with any kind of code, and I do miss the days when I would have my head deep in C repeatability banging my head against a -Wall until I found the typo (you see what I did there :D ).

The other thing I miss, well hard to miss what you never really got chance to do is OO.  Yup Object Oriented Programming.  Once the penny dropped at uni I loved it, and have always since wanted to play with classes more, so this project is going to be OO damnit!

Which leads me back to the title of this post.  Whilst pondering how to tackle the task at hand my old friend OO waved at me and makes a lot of sense.  I will be aquiring XML, breaking it into chunks and storing its gooey middle bits in a database.  The XML driver I will be using is heavily OO already so using OO myself only makes more sense.  So of I went to learn how to do OO in PHP (its a web project so shush), 5 minutes later and I had the syntax, now just the planning of objects to do.

Planning the objects is the most dull and interesting part for me, lots of pondering, trying to work out program flow whilst considering inheritance etc.  Which is where a lot of my uni work came back to me, I remember the fun I had building abstract classes to act as interfaces in objects allowing them to work with all kinds of magical objects later in life.  Once I get the free time I think I will be sat frantically scribbling with bits of paper and cards planning out my flow charts and object relationships (I might call one Maude :) )

Debian and VMware server “The path /usr/src/linux/include is a kernel header file directory, but it is not part of kernel source tree.”

Sunday, March 29th, 2009

Yeah a long name I know, but trying to get it stuck in Google so it will be most helpful.

I hit this snag and did a lot of trawling with little luck. Previously had no issues installing VMWare server, upgrade to Lenny, swap some hardware, decide to get it up and running and POOF! no dice!

Anyway I have solved it (huzzah!) and can finally goto bed :)

It seems that the error message is related to the lack of .config and or Makefile in the headers. So a .config or Makefile in /usr/src/linux/.

if you have installed your headers :

apt-get install linux-headers-$(uname -r)

have build-essential installed have set CC to be gcc-4.1 yet still you get grief, heres what I found.

If you look in the headers path, you will see .config and Makefile. Yet no joy!, look closer, the Makefile is a damn pesky SymLink!!! this goes for most if not all of the buggers. What you need along with the headers is:

linux-headers-2.6.26-1-common

which should reside in the same directory as your headers:

ls
linux-headers-2.6.26-1-686
linux-headers-2.6.26-1-common

The SymLinks point into files in there, for some reason (possibly my own stupidity) I didn’t have it, possibly deleted it in a fit of disk space recovery before starting the build.

Hopefully that will be of use for someone out there, if not, I am sure I will find it useful when I next cause myself grief :)

MySQL / PostgreSQL / Database snapshots ????

Wednesday, September 24th, 2008

Yeah, already heard “There be Dragons” (No not 32’s Miss Jenny :) ).

Anyway I think I have a plan to perform this, its most likely a bit of a hack, but involves no perversions of file systems or databases themselves and should in theory provide a consistent and reliable ’snapshot’ of a database for a point in time.

Alas it is most likely going to be a bit intensive for larger databases :) but I don’t have any of those so meh :) Its a purely academic idea with most likely very few real world applications.

So what is it?

Simple.. in stages!

  • Take a dump of your database at the day start
  • Each time interval you want a ’snapshot’ for, take another dump
  • Using the ’snapshot’ dump, generate a patch file against the day start database dump
  • Simple eh :) and you can see why not really applicable to a large database. Obviously day end run whatever patch files etc through bzip/gzip/tar combo ready to be slapped on tape.

    Now I just need to go play :)

    Update Tested… and it seems to work ! WIN! :) Pointlessly OTT db backups here I come :)

    ESXi Update

    Wednesday, August 13th, 2008

    Checked this AM and there it is patch. Run the update app and the update is downloaded locally and then uploaded to the server. Simple.

    Only gripe was that the updater claimed the update was applied, which it was, but never made mention of needing to restart the server. I had to manually restart the server, would have preferred a warning and then the standard “need to reboot to apply the update” type message.

    But as thats the only gripe, it’s not a huge one. If you read the KB articles as the patch notes say, you will know it’s needed. Just I expected the reboot to be automatic as implied.

    Still extremely impressed with the level of communication from VMware for the whole thing.

    Major issue with ESXi Update 2

    Tuesday, August 12th, 2008

    Seems VMware made a booboo, and have accidentally left in some expiry code into ESXi release. The bug prevents you from starting, resuming or vmotioning (?) a VM on the affected ESXi host.

    1st off, very very high praise to VMware for being 100% upfront and informing everyone about the issue, I got a very nice email from them explaining the issue and providing a link to their KB article and also to a static version of the article as it is oddly being battered right about now :)

    Seems the issue only affects VMs that are stopped or suspended, so I am not overly concerned at this moment as the VM this site is on and my mail server I have no intention on stopping any time soon. Suggested work around are to set the date back on the host to pre 12th August, which may cause problems for some hosts which have the VMs syncing time with the main host, if you don’t do this tho.. no foul.

    VMware have pulled the ESXi Update 2 binaries from download to stop people grabbing a borken version (which is very honourable and wise) and are planning to release a fixed set of install binaries in the next few hours (planning to post progress reports every 2 hours too!), with a patch coming later. They give the reason for this as being they can produce the fixed binaries faster than the patch, which make sense to me.

    Overall I have a nice warm fuzzy glow that VMware are out there looking out for their customers even if they are freebie scroungers like me. Of course I am sure they are not wanting to soil their excellent product (rightly so) and providing this level of after ’sale’ care just wins them more votes from me.

    Applause to VMware, hope you keep up the excellent standards.

    bad interpreter: Permission denied

    Friday, August 8th, 2008

    More as a reminder to myself than anything as I keep doing this :)

    Trying to run some script and get the following ? Trying to do an Apt-get install and it’s just barfing ?

    Check if you have set any of your mounts with the NOEXEC option in fstab :) on Debian apt will run some scripts in /var for example, so being overly paranoid in here will just bite you on the arse :)

    JFUK 07

    Sunday, October 7th, 2007

    Well, back at last from a fun weekend in Kent, I had net access there so should really have updated as it happened, but meh, I was doing other things.. so breif rundown

    Friday
    Was planning to try and get there early, however that didn’t happen to my bumping into of people I haven’t seen in years (litterally) in Warrington whilst mooching through shops for stuff. Time whizzes by when you are catching up :)

    So my Badge printing and general getting ready suffered a few hours and I ended up leaving (as in pulling of in the car at 20:20). The pilgramage to Rochester had begun! wasn’t doing too bad either with a nice high average MPH ;) .. However the joys of the UK motorways put pay to that. 1st, I like contraflow.. I dunno why, but I do.. so I try to always be in the magic fun lane… which meant I couldn’t get off the M1 onto the M25 at the appropriate Junction! BAH!, sorted that out next junction… at which point they decided the M25 didn’t need all of it’s lanes and reduced it to one GAH!. After that was fairly clear (around the 23:00 time now), so expecting to be at the Medway manor with time for some beer and games. Of course the motorway through otherwise, and they reduced the M25 back to 1 lane of static traffic after the Dartford crossing, and managed to obscure with a sea of unlit, un marked cones the Junction 2 BAHGAH!.. which ment J3.. and the M20.. RAAAHHH!!

    It was the 1st time I have cheered at seeing Rochester and got a warm glow :) I even managed to remember the route to the car park at the back of the building without a long detour through Medway this year. Big cheer as I entered the room and then sat down to some passmaking whilst worms and Jag banter was had (and beer).

    Saturday
    More to plan, went down, moved tables, setup the VR unit I have brought down for Gaz, it even worked almost the 1st time too!, setup the Wii.. discovered that Mr Moss has far too much of a natural gift at Wii bowling. Adjusted the VR Video interconnect cable to improve picture, fought off Nick H’s advances with his pricelist, people arrived, much tea was consumed, chats had etc etc etc.

    We even had people from Italy this year, so UK, Germany, France and Italy.. must see if we can get the Dutch over again too :)

    Voted on the evening meal, all you can eat Chinese won.. TRADITION! WIN! Back to the hotel and some website discussion, software compiling and plans are made :)

    Sunday
    Up a bit later, had Gaz kipping on our floor as the Hotel had stuffed up and forgotten our reservations! Nice.. we have gone there every year bar last.. More sedate day, spent a bit more time chatting to the peeps in the computer section. Really should spend more time in there. Will have to take less next time and mingle more. I almost got into the final for the Worms tourney too! tho a particularly stupid shot of my own removed that chance :)

    now back home, hot and sweaty after unloading, will be jumping in the shower and making more plans I think.

    SSL

    Wednesday, August 1st, 2007

    Well it’s been at the back of my mind for a while. I have a couple of boxes hosted at work which I use for my own email and webpages, and those of friends. It’s my own toys ISP in a sense, it has grown from a single box in Germany hosted by 1 & 1. I started it and did the initial config whilst I was back at VIA and noticing the downward nature of the spiral, planning to have something to fall back on should the day come when I would be without a job or some such.

    So a lot of it is built with the intent of it being so much more than it is (thankfully never been left high and dry so far :) ). As time has moved on I have hosted more and more sites and email for people, all for friends, all for free, to the point where I now have a mail server with 57 mail boxes, or around 101 email addresses :) Not a huge number, but well.. I like to fiddle. So I decided a while back that I would have a stab at some automation for the admin of these email boxes and maybe even the DNS I host for people, or the web etc.

    Last night I spent a lot of time pondering in the pub quiz, and think that it may be worth getting me an SSL cert instead of a self sign jobbie.. you know.. for giggles :) and WOW! they ain’t cheap are they :) £250 a year around abouts from people like VeriSign and Thwate. Arses… all hail google who also found somewhere offering them for £45 a year to £83 for 3 years.

    Bit of a random entry I know, but I need to post more or I will forget stuff, and those who I host for, now know I am actually working on this :)

    VLANs and their Taggery

    Saturday, February 17th, 2007

    Got a bit further with the ole switch config.. Tagged VLANs up and running, some ports in access mode, and the ports connecting to the router Linux box and general file server box tagged with the various networks they use. (over engineered? who me? :) )

    Alas problems have struck, as nice as it is that this is all working, it’s not without it’s horrible Ikkyness…

    Firing Tagged frames at devices who’s drivers assume there will be nothing bigger than 1500 .. ever.. just causes problems.. I have dropped the MTU to 1476 on concerned parties, which works but I was kinda hoping PMTU would sort this out for the rest of the things plugged in.. (Print servers, laptops, etc) but it seems not to be. for some Odd reason nothing seems to be having any luck with PMTU :( So I am having to manually set everything to 1476…

    Given the niceness and convenience that the tagging should bring, this hassle and horribleness leaves a bad taste in my mouth, I think I may simply have to lump the fact that I will need to use dual port card in my router and make some changes for other things :( ah well..

    Think I may have a quick look to see if I can get these NIC drivers patched to accept fatter MTU’s for the boxes with the tagging.

    Update Thankfully a bit of poking around has shown that the intel NIC’s I have don’t suffer the issues of the NIC in my router (Netgear Tulip based NIC), and the intel bumf says they happily support the increased Frame size for Tagging. so Woo..

    Bit of testing and yup, all happy there, so I will just redistribute my Intel NIC’s into the router and new file server as part of the decomissioning of this one. Just a bit of Rsync and copying of the maildirs to the new box and we should be rocking.

    gah! Building shared objects under OSX

    Monday, January 22nd, 2007

    Having fun compiling some of my old code that needs some work on my shiny Mac box.. then a careful re-read of man page for gcc :

    -shared
    Produce a shared object which can then be linked with other objects
    to form an executable. Not all systems support this option. For
    predictable results, you must also specify the same set of options
    that were used to generate code (-fpic, -fPIC, or model suboptions)
    when you specify this option.[1]

    This option is not supported on Mac OS X

    If only it was in bold in the man page and perhaps at the top! .. also an error more along the lines of “Not Supported” rather than “unrecognized option ‘-shared’” might have hinted me to read the END of the man page entry….

    time to go a mooching I think :)

    Update:
    Anyone interested the fix comes in the form of:

    “-bundle -flat_namespace -undefined suppress” without the -shared. This should give you a Mach-O bundle, which at least for me seems to give me a nice shared object I can use.

    1st Power figures in

    Saturday, January 13th, 2007

    Have got off me bum and put my power meter to use, (and installed a UPS)..

    Have updated my Power Saving Page with the figures and initial monthly Estimate of running costs.

    Book Recommendation

    Tuesday, November 14th, 2006

    Many moons ago I descovered an open source database, PostgreSQL. Over the years of playing with this I have decided it truely is “The Win” when it comes to databases. Feature rich, resilient and very flexible and advanced. Of course having something so versatile means there is a lot of knowledge on or about it, the PostgreSQL website has some excellent documentation on it, but I always like to have a good book too, plus a 2nd point of view is always handy for getting you head around those tricky concepts.

    So anyone who is using or planning to use (in a serious manner) PostgreSQL, I would strongly recommend the book “PostgreSQL” by Korry Douglas and Susan Douglas. It had a lot of in depth knowledge and is well written and structured. It coveres version 8.0 but most of what it covers is valid for 7.x also (for all you Debianites), and even has cases where it gives the commands/syntax for the previous versions where required. Its magic book number is : ISBN 0-672-32756-2 (second release).


    book cover

    TT

    Wednesday, November 1st, 2006

    Now has a PSU! YAY!

    has been sat on my desk getting buried under random crap.. after JFUK 2006 tho I am full once more with love for the Atari days and the idea of developing Jag and Atari software on a TT is interesting me once more.. So in went the PSU.. much neater than a PC one hanging out the back.. now I just need to fit my old 240 MB HDD, Network card and then see about getting this 64 MB RAM card working.. and we should be set…

    Wonder if I can force the box into uber high res without a special Atari monitor.. hmmm

    wow!

    Sunday, October 29th, 2006

    JFUK 2006 .. gonna stick in my mind.. probably due to the stress etching that into the inside of my skull, but it was worth it.

    It’s been and gone, and asside from the fretting and worrying and playing the good proxy-host it went well I think, I have recieved several text messages thanking me for organising the event, even some gifts from people attending.. some of whome I have never actually met in person before, others who I have only met once before.

    People may call it a sad hobby, but screw em, we have a common interest, we get along and I would consider them my friends. The buzz at the event was awesome, unless that was just me running off the endorphins.. still hyped, although saddened as it is now over until some time next year when someone else takes the torch and gets to play proxy host :)

    pics this time are on a more appropriate site… Jagfest.org

    Funky RADIUS

    Wednesday, October 25th, 2006

    Each time I have to make a change FreeRADIUS always manages to suprise me with it’s power and flexibility.

    Needed some magic to add specific Attributes to the RADIUS Reply based on username and which NAS the initial request came from, the contents of these attributes would either be derived or looked up and the looked up portion dynamic too.

    Sounded a bit daunting and a day of playing with RLM_PERL module and some perl off and on has resulted in a fully functional module! Huzzah!

    All thats left to do now is check it’s Thread happy and that there is no nicer way to do the DB stuff and it’s done. As Thecko said it’s a little like heading towards Radiator the all Perl RADIUS daemon but at least this is 99% Naitive code and then the precompiled Perl module aborts if the user isn’t one of the special type (of which 99.9999% arn’t) so there should be minimal overhead.

    Yay me!

    Datasheets

    Saturday, October 21st, 2006

    Having a look online for a datasheet for a device, and 1st hit is some datasheet download page. Great, or not, they expect you to pay for a subscription.. so a 2nd google to find the manufacturers actual page, a quick mooch and hey presto, the same datasheet for a whopping 0pence.. now thats what the internet is for.

    Now, lets see if my programmer can play with these PROMs :)

    iSCSI the hardware approach

    Thursday, July 27th, 2006

    This iSCSI lark is great fun. You get your SCSI packets, wrap em in a tastey IP batter and TCP for a few milliseconds over an Ethernet (or other layer 2 cooking protocol), tada you have a 15 mile long dynamically routable SCSI cable, shared by x devices.. cool.

    Of course this all costs money.. well the kit does (you can do both ends with linux suprise suprise, but we needed something a little bit special at work). Therefore we have some shiny iSCSI switches which do all kinds of funky stuff with the data stored on the FibreChannel disk sheves we have, giving us upto about 5TB (yup Terra bytes :) ) of very very very resilient storage to carve up and distrubte over IP, all in about 10U of rack space! neat eh!

    One snag we have discovered is that using the software based iSCSI drivers on the servers can lead to some problems, a) because it’s still fairly infant code, and b) it can eat 30% of your CPU in wrapping up those SCSI packets, and possibly more from the looks of it. So as the local SAN man (me) I was given the job of finding something a bit whizzier.. and lo I do deliver in the shape of some nice whizzy QLogic HBA cards. A quick Firmware issue and we have hardware automagically connecting via iSCSI and appearing entirely to the local system like a localy attached SCSI disk, so the CPU on the server does no SCSI wrappering, it’s all done by the card itself! cool huh!

    Anyway, that bit was simple.. the fun part was making it work under Debian and so that I could install the entire OS on the remote SAN disk. Spent a few days, but with a bit of hackery and several kernel compiling fauxpas I have made my very own bootable Debian install CD which recognises the card and installs the driver I had to compile etc. And then you can install onto the SAN disk! YAY! I just now have to get the install to put the driver on the disks so that when it boots it doesn’t top itself when it’s disks are unreadble :)

    But it made me happy, even did a happy dance! :)

    Server abuse

    Wednesday, March 1st, 2006

    Arrived in work today to see how my project with stunted dev time was going, was hoping to find a nice happy database of lovely numbers all nicely formatted etc etc.. instead I was greated by a server with a load average of 54!

    It’s graphs looked equally impressive with a nice steady linear climb at approximately 45 degrees up for CPU load and down for free memory.. OOPS! would seem that getting the database to import 167 million rows of data whilst another process tries to process those rows of data is a bad idea.. ah well :)

    A bit of crontab editing, process killing and all was back to just busy. Checking the IO on the disks showed them switch from mainly read to pretty much just write, 24MB (bytes not bits kids) per second of write infact!

    I am hoping all that data will be in by tomorrow when I start so I can get the processing running. Which will hopefully not take too long to churn through it all… we will see… at least it means I can confirm the code is working correctly.

    Coderific

    Sunday, February 26th, 2006

    Well spent the large portion of yesterday working. Had to do some upgrades at work, and then more DB coding, as I was at work I took the opportunity to nick some more test data from the server in question, whilst it was processing the request I managed to watch 2 episodes of lost ! (Dunno what danby’s problem with season 2 is, I am so far enjoying it, you do have to accept the little more outlandish story arcs yeah but still fun).

    Once I decided to give up on the extra test data I set off for Dianes, I am helping her with a db she needs for her pHD research, and as her house isn’t populated with small noisey people it lends itself to thought at bit better than mine. Just like having a study session back at college/uni :)

    I was able to fix a few issues and help her out a little, I am (proudly) not a VB or access programmer :) .. my own project for work is comming along swimmingly, with a nice quiet atmosphere and a steady flow of tea (thanks Diane) I was able to find the pesky logic errors and quash them. always nice to find and rid yourself of stupid errors you made when writing code originaly. All the way to the next big snag.. which with a bit of thought I have a solution too and have mostly implemented ! even found a possible fix for an issue with PostgreSQL version that is part of the Sarge distribution of Linux.

    Myth TV

    Saturday, February 11th, 2006

    Well it booted when I tried it, worked for 3 ish hours and died!!!

    ARGH!

    Hopefully it’s just the RAM needs to be reseated.. HOPEFULLY!

    I have added pictures to the Gallery to satiate a hungry Pie. here you go sir:


    Inside MythTV box