Monday, October 25, 2010

 

a small JPEG

Here is a 384 byte JPEG image that I made in photoshop. It is the letters ROFL hand drawn by me and then saved with max compression settings while still being sort of readable.

Hex sequences:

my @image_hex = qw{
FF D8 FF E0 00 10 4A 46 49 46 00 01 02 00 00 64
00 64 00 00 FF EC 00 11 44 75 63 6B 79 00 01 00
04 00 00 00 00 00 00 FF EE 00 0E 41 64 6F 62 65
00 64 C0 00 00 00 01 FF DB 00 84 00 1B 1A 1A 29
1D 29 41 26 26 41 42 2F 2F 2F 42 47 3F 3E 3E 3F
47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47
47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47
47 47 47 47 47 47 47 47 47 47 47 47 01 1D 29 29
34 26 34 3F 28 28 3F 47 3F 35 3F 47 47 47 47 47
47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47
47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47
47 47 47 47 47 47 47 47 47 47 47 47 47 FF C0 00
11 08 00 08 00 19 03 01 22 00 02 11 01 03 11 01
FF C4 00 61 00 01 01 01 01 00 00 00 00 00 00 00
00 00 00 00 00 00 04 02 05 01 01 01 01 00 00 00
00 00 00 00 00 00 00 00 00 00 00 02 04 10 00 02
02 02 02 03 01 00 00 00 00 00 00 00 00 00 01 02
11 03 00 41 21 12 F0 13 04 31 11 00 01 04 03 00
00 00 00 00 00 00 00 00 00 00 00 00 21 31 61 71
B1 12 22 FF DA 00 0C 03 01 00 02 11 03 11 00 3F
00 A1 7E 6B AD 4E B6 4B 30 EA E0 19 82 39 91 3A
6E 63 5F 99 8A 68 B6 E3 EA 70 08 A8 00 55 98 EE
48 22 37 1C 63 19 AF A5 68 B8 05 24 9A 7E 99 F5
B3 22 20 55 EA 27 CD 8C EB 4E 31 91 9D 41 FF D9
}; #this is a very tiny jpeg. it is a image representaion of the letters "ROFL" hand drawn by me in photoshop and then saved at the lowest possible quality settings where the letters could still be made out :)

my $image_data = pack('H2' x scalar(@image_hex), @image_hex);
my $url_escaped_image = uri_escape( $image_data );

I was going to include the output of this code right here but blogger keeps stripping out the NULL (hex code 00) bytes for some reason. So ... This text file contains the output, all 384 bytes URI escaped and ready to go.

Friday, October 22, 2010

 

google adsense

hmm my adsense is giving ads for shortbread cookies and other cookies. and IT stuff.

something tells me google's bot is getting stuck on my cookie redirect test. better open up the first screen to not need cookies lol.

Wednesday, October 20, 2010

 

western digital hard drive RMA fun

About 3 years ago I bought a 500GB western digital hard disk. It worked fine for about 8 months I think then it started causing my World of Warcraft to crash from random disk read errors. I pulled the disk and was going to do RMA but around that time is when I needed to move from Ontario to BC and dealing with hard drive stuff was not a top priority. I bought a replacement drive just to have another working 500gb disk, with the intention of some time after moving to actually complete the RMA for the dead drive.

But I'm a lazy bastard and as I had a lot of extra disk space still I didnt make doing the RMA a priority, especially since I'd checked sometime in 2009 to see how much time I had for warranty and it showed I had until October 2010.

Fast forward to October 2010 when another of my disks started acting up (a 750GB seagate one). Ok so I figure if i need to do a RMA on the seagate (which I did need to do) I may as well get this old WD RMA dealt with. So I do the WD RMA first and actually find out that I have warranty left on the WD drive for another 5 days or so. LOL. So I complete the RMA and have now just gotten an email saying they've shipped my replacement part. And guess what, my replacement part is a 750GB disk :D ... I guess they ran out of 500GB.

Lesson here is that procrastination is perfectly fine and can lead to unexpected coolness.

Tuesday, October 19, 2010

 

Fun times with seagate tools, usb stick booting, no cdrom drive and grub4dos

So I have a mirroring RAID set up with 2x seagate 750GB disks and one of them has gone bad. I badly wanted to run the seagate diagnostic tools but was getting blocked at every chance. First of all the msi for the windows version refused to install on my xp system. Log file stuff I could find didnt show any errors :(. So I gave up on msi and tried to do the DOS version. Trouble its its a ISO for a CD ROM but I dont have a CD ROM installed in this computer right now. I wanted to boot from USB stick. Good luck. After a bunch of searching around I finally found a tool called multibootisos that will format a usb sick and make it bootable with grub4dos and also allow you to have several of its list of bootable isos installed on it. Trouble was that of course seagates iso is not on the list. In the end I left the seagate iso on my hard disk and just used the grub4dos that the multibootisos put on my usb stick to boot it. and it fuckin worked!

I had a bunch of stupid hangups and weird stuff before grub4dos would even boot anything for me off the usb stick. then once it did finally start seeing the usb stick files i realized i could probably just load it from the hard disk.

Heres what seemed to work in the end:
- format the usb stick as regular FAT (not FAT32). it will then hopefully have a better chance of getting formatted right by multibootisos
- connect usb stick, wait for it to pop up any windows then close them.
- run multibootisos. pick your stick drive letter (get it right!). choose memtest ISO (mainly because the grub commands that get set up for it will be a good reference for what we want to do) and have it download it. click next.
- when it tells you to disconnect and reconnect, after reconnecting make sure any windows that pop up from your usb stick are closed.
- click ok and finish up.

Ok now hopefully as long as your BIOS supports booting from USB-HDD you can reboot and have it boot into grub4dos off the stick.

Next step was loading the bloody seatools. Lol. Well I'd never used grub4dos before so I poked around at the help and did a little reading and looked at the example commands used to load the memtest ISO. Basically we do the same thing. Hit c to drop to the command prompt and type all this and then bam seatools came up on the screen. [My notes are in these square brackets. dont type those in.]

find
[this will list your hard drives]

ls (hd0,0)/
[show contents of this disk, is that the one with seatools? yeah? woot. then do...]

root (hd0,0)
[now the hd with seatools is the root device for grub4dos]

map --mem /thepath/totheISOfile.iso (hd32)
[something about telling it to load it in memory into virtual cdrom 1]

map --hook
root (hd32)
chainloader (hd32)
boot
[the rest of the stuff required to get it booted]

Link: http://www.pendrivelinux.com/boot-multiple-iso-from-usb-multiboot-usb/

Oh yeah, and I did confirm the seagate 750GB drive is bad, got a seatools error code now and everything. Lol.

Sunday, October 17, 2010

 

perl (mod_perl/apache/mysql, etc. 8+ years.) developer open to offers.



If you have an interesting perl based web project that you need back-end coding assistance with, I'm officially available for short and medium term contracts. My fee is USD$45/hour. Contact me with a description of your project and I'll be happy to take it under consideration. Bonus points if you are in Victoria BC as well.

Thursday, October 14, 2010

 

Lol. A year!

Well, almost a year since a post. Thats pretty lame. But what can I say. I started dating a lady named Angela. Thats been a hell of a roller coaster. We're still together, although its still quite bumpy.

I quit (err, got laid off? LOL.) my job because I was hating it and I'd saved up some money. Well, even with EI, I've burned through almost all of it and now I'm starting to think very seriously about work again.

I still like perl, I still like web stuff. So I've given myself a little project to get back into things. Its got me working with familiar stuff like my old (awesome!) code that runs as ModPerl::Registry, AJAX and captchas, as well as some new stuff like Amazon EC2 instance setup and getting a bunch of stuff going on a fresh Ubuntu 10.04. I'm sort of hoping that I can find a way for my little project to make some money but even if it doesnt at least I'm having a fun time while getting my head back into coding, problem solving, and server related shit.

This page is powered by Blogger. Isn't yours?