Andy Kopciuch's Blog
Tuesday, September 11, 2007
  dummy invoicing, mdadm & perfect coffee
So a while back there came an immediate need for a consistent and easy way for some brokers / staff to create a simple invoice for their customers. The time span for the actual insurance companies to produce paperwork is getting deeper and deeper, and this was causing some pain and suffering at the offices. So I took an evening and whipped up a quick little form asking for a few pieces of information, run it through and FPDI template, and voila! There was immediate use, and a few bug found (I mean cmon ... how many invoices am I supposed to create for oddball scenarios?). All seems good, edit old ones, reproduce, and most importantly ... GET PAID!

I had an adventure with a server a couple weeks back. I got an email / phone / IM about "The server is read-only" ... WTF? So yes ... it apparently had remounted / as read only ... I say again ... WTF? So some panicky checking later ... hrm ... disk problems, raid problems, XFS problems ... bad disk. Nothing can be done right at that moment. On to the disaster plan. The server was almost completely functional, as services were still running ... the only affected partition was root, and the RAID took over properly for /home, and /var ... so everything was still accessible, (except adding new accounts needing writing to /etc/passwd and other things.

So after some careful planning with Aaron, and discussing with other ... we planned to fix things after midnight the next night. So this is what I did. Installed a new hard disk in the open IDE slot (only 2 SATA connections available.) I then installed Dapper on there, with open partitions for the RAID volumes. Once the system could boot properly, as the old RAID array was pooey, I could add the new volumes in, and resync the arrays, and now have a working /var, and /home upon next reboot. YAY ... only took like 3 hours to resync ... meh.

Now came the fun part ... I have a bootable system, with / on a non faulty disk, and /home, and /var in active arrays again. Lets see here ... the /var partition where the apt DB is thinks everything is up to date, yet the binaries under the new / are still the inital installation. now what do I do? I'm not going to bother trying to even attempt fixing this and screwing with apt. Lets try something neat ... worst case I start all over again, and put things back the way they were (cuz I never touched the original disk at all). Lets mount the old / on the faulty drive (we can still read the data ... nice). Lets' rsync /lib ... cool, rsync /bin ... cool, rsync /usr ... cool, now the neat-o-rific one ... rsync /boot, vim /boot/grub/menu.lst, :1,$s/sda/hda/g, :wq, reboot ... cool.

That was by far ... I MEAN BY FAR! ... the coolest thing I have ever done on a linux server. Once I thought about it for a minute ... I went ... hey, same distro, same version ... just instead of fixing an out of sync apt to the system binaries, lets just move the old ones back. The boot loader, and actual linux images was the really nice one. So my notch in the linux bedpost is ... broken disk ... just install on a new one, and rsync the kernel image ... no problems ... and I say again ... cool!

Being a coffee fan, most of the time coffee is just that ... coffee ... a required beverage. Every once in a while though ... you are not even thinking about it ... and you take a sip ... and you go WOW! The perfect coffee. Maybe the roast of bean, the perfect ratio of cream and sugar to coffee, the perfect temperature ... liquid gold. I had that this morning ... I was so happy, and satisfied ... until I decided to dump it all over my keyboard, both mice, mouse pads, laptop, and everything else on my desk ... right at the exact same microsecond as the cup was tipping over, the phone rang with a server down. Three cups later, and I never did get back to that perfect coffee ... hope to see you in 6 months or so. coffee.
 
The Jolly Smoking Computer Programmer

ARCHIVES
October 2004 / November 2004 / December 2004 / January 2005 / February 2005 / March 2005 / April 2005 / May 2005 / June 2005 / July 2005 / August 2005 / September 2005 / October 2005 / November 2005 / December 2005 / January 2006 / February 2006 / March 2006 / April 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / January 2007 / February 2007 / March 2007 / April 2007 / May 2007 / June 2007 / July 2007 / August 2007 / September 2007 / October 2007 / November 2007 / December 2007 / January 2008 / February 2008 / March 2008 / May 2008 / August 2008 / October 2008 / December 2008 / January 2009 / February 2009 / March 2009 / May 2009 / August 2009 /


Powered by Blogger