Thursday, 29 October 2009

Sequel Pro - fantastic Mac OS X front-end for MySQL

I bet you're either using MySQL, or going to use it or at least heard of it – I hardly believe anyone of reading my Twitter or blog are not exposed to this field at all. Hence, if you've ever used MySQL you have probably asked yourself a question – "where can I find a decent front-end application"? Of course, there's PhpMyAdmin as well as many others, and they're fine, really ... except they're web applications, and most of us still prefer something which runs on our machine locally - after all, it's totally different experience.

Now, if you're lucky enough to use Mac (and I see absolutely no reasons why you should not) – you've got an app for that, too! Sequel Pro gives you great database navigation, with ability to access server via SSH tunnel (as, obviously, not all servers are exposed to outer world and in fact, most are not). You can do practically all you want via it's UI - view and edit tables' structure, add or change indexes, view the content of even very large tables, and, of course, run SQL queries on the database. And, best of all - it's free! Try and you won't regret – and I can just say "Thank You!" to the guys who made it available.

On the screenshots: Sequel Pro accessing MySQL database with loaded Wikipedia dump via SSH tunnel.


Sunday, 25 October 2009

Buffalo Linkstation - USB2SATA adapter #fail

In feeble attempt to revive my Buffalo Linkstation home server, disassembled it to extract the disk and connect to my Mac – just to find out, that the USB2SATA adapter doesn't fit this disk (i.e. it is compatible from connector's point of view, but it's clearly too thick to get into tiny socket designated for SATA cable). Now waiting for SATA cable + power adapter from eBay – until the next weekend.

Autumn in Ravenscourt Park

Decided to have a short walk today – before diving in into studying. It was good :)

Wednesday, 21 October 2009

Sunset behind the office window

At the moment of writing all these unbelievable colours are already gone :) Too bad it didn't last for long.


Tuesday, 20 October 2009

pv or pipe viewer — one of the most useful UNIX commands

Have you ever heard about UNIX pv command? I bet you didn’t — and I promise you, your life will change and you’ll become warm and fuzzy inside — because pv stands for “pipe viewer”.

Try to count, just how many times did you do something like:

grep -i something file.txt | gzip -c > output.gz

and wondering, just how the hell long will it take for it to finish? Well, for me it did happen quite often, especially when handling 10GB+ files (such as, say, Wikipedia dumps). That is exactly when pipe viewer comes to the scene. That’s how it looks:

[user@host wikipedia]$ pv enwiki.xml | wc -l
767MB 0:00:16 [67.9MB/s] [> ] 3% ETA 0:07:58

It’s the most simple use case — but so far one of the most useful ones (if you can say that about the use case). Say, you pipe more than one command and want to display the progress separately for every of them — no problems, you can do it! — as well as many other things.

Check out the pv’s webpage: — to me it’s one of the little utilities which make my life substantially easier.

Monday, 19 October 2009

The most unusual return form I've ever seen

I can't really comment on it - so I will just cite the text of the original email. I've never, ever, ever seen anything like that before.

This email has been sent to you by Griffin Technology to help facilitate testing and/or replacement of merchandise.

Generally we handle returns for our international customers a little differently than for our domestic customers. We assure you that this is our preferred method for handling your return as it will help save you money (shipping costs) and the hassle of having to send the product back to us. It also has the added benefit of helping us to ensure that your unit is truly non-functional.

First, destroy your defective product. Yes, really destroy it. A hammer works well for destroying most products however feel free to use whatever tool you are most comfortable with. This can be a great opportunity for you to express yourself creatively and take out some frustrations at the same time. Also, you may want to use eye protection and protect yourself from any flying debris that may result from this process.

Second, document the destruction. We recommend taking a digital picture of the destroyed unit while it is laying on a printed copy of this email so that the RMA number and other information are visible. Also, take a digital picture (or scan a copy) of your receipt.

Third, send us the pictures. Just reply to this email and attach the digital pictures of the destroyed product on the printed email and the receipt along with any other pictures that we might enjoy, such as you holding the destroyed product or the town where you live. Of course including the extra pictures is optional but feel free to include them if you want to.

Once we receive the email and verify the photos we will send a replacement to the address that you have provided us below. In order to ensure that we receive your email, please limit the size of the email to around 3MB. If we have not received a response from you within 30 days from the when this email was sent, your request for a replacement will automatically be removed from our system. So please respond as soon as possible.

Processing may take up to 2 weeks once the photos are received.

Thank you,

Griffin Technical Support

Indeed, I've sent them the photographs of (thoroughly) destroyed cable and received confirmation, that the new one will be despatched soon. I don't know, how long will it last, but the approach to returns I've seen from Griffin - is truly admirable!

Probably, the most horrible UNIX command I've ever written

pv enwiki.xml | grep -C1 '<title>' | tr -d ' ' | sed 's/<title>//' | sed 's/</title>//' |  
sed 's/<id>//' | sed 's/</id>//' | sed 's/<page>//'  | tr -d ' ' | grep -v '^$' | 
tr 'n' 't' | tr '-' 'n' | grep -v '^$' > title_id.txt 

I know it's probably as efficient as spaghetti code is - but hey! It works and does what I want it to!

Saturday, 17 October 2009

Palm Pre in O2

Got my hands on highly acclaimed Palm Pre in O2 Store. So, it's not yet another iPhone killer (which mostly killed themselves), but - finally, it's a real competitor to Apple Phone.

The mobile phone looks pretty sturdy, is significantly smaller than iPhone though thicker too (see photographs of the phone in hand). Hardware keyboard is good and responsive, but to my taste buttons are too small - at least, iPhone keyboard looks preferable to me.

Phone feels very good in hand - probably, that's the case when size does really matter. Web OS seems to be fairly fast and responsive, although I didn't have much time to play with it properly. As I said, this phone finally appears to me as a first real competitor to iPhone - due to combination of size, weight, hardware keyboard and well-recognised brand (c'mon - Palm been at this market long and long before Apple has ever though about the iPhone!) I believe Palm Pre will find it's customers. All what I can say - it's really great, after all, Apple's been on it's own for far too long in this market!

(thanks to my lovely wife for helping me out with these photographs!)

Friday, 16 October 2009

Copying compressed file via SSH to Hadoop HDFS

Had probably re-invented the way of copying gzipped files via SSH to Hadoop's HDFS:

gzip -c file.txt | ssh 'gunzip -cf - | hdfs -put - input/file.txt'

And all the way back:

ssh 'hdfs -cat output/result.txt/* | gzip -c' | gunzip -c - > resulttxt

Friday, 9 October 2009

Thursday, 8 October 2009

i2reader - ebook for iPhone with dictionary

In my opinion, pictures are pretty much self-explaining. To be brutally honest, software isn't 100% ready for your average user -- it took me a while before I figured, how can I install a dictionary; also, widely-advertised on RipDev's website i2Librarian is ... well, let's say it's even less ready than i2reader itself.

On the other hand, once you've set everything up -- it just works as designed with no problems whatsoever. To lookup a translation just tap-and-hold the word; you can turn pages by sliding them (or tapping left and right sides of the screen, which can be customised in app's preferences) -- that's pretty much all you need to know about i2reader.

Ah yes, and English translation sucks :) I know, these guys are Russian, but after making a brilliant software surely they could spend a little time to find someone who can make a decent translation, couldn't they?

Monday, 5 October 2009

For switchers, who desperately miss their Start menu

It's simple, really - especially now in Snow Leopard. 

1. Fire up your Finder and go to Macintosh HD
2. Grab Applications folder
3. Put it into your dock next to the Trash bin, Downloads, etc.
4. Wait few seconds while it loads all the icons
5. Right-click it (or option-click it although if you're switcher, you shouldn't care about old-school Mac terminology) and select "View content as" -> List. 
6. Click the icon and see the menu.
7. Enjoy!


N-1. Though many find using QuickSilver easier and more simple to invoke your applications.
N. Personally, I use Spotlight as I hardly need QuickSilver's niceties, and good ol' Spotlight works better and faster.
N+1. Drag the app icon to your Dock, dammit!

P.S. did I ever say I am trying to promote my uni coursework for the phrase "mscais search optimization" ? :-)

Thursday, 1 October 2009