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.