How to make MySQL spit out CSV’s

mysqlDon’t you hate it when you know you solved a problem three years ago but you can’t remember what the solution was? I ran into that recently. I was trying to make mysql generate a csv directly from query results. I remembered that you can do it, and I had an example of the correct syntax to use in my old code, and I had a query that did it just fine when running in the mysql CLI as root. I had to piece together the answer from several different sources; and none of them told the whole story. So here is the full story, along with all the stumbling blocks that I know of.
Continue Reading…

Listen to this post Listen to this post

Tux Geekcraft Plarn Bag

Remember my Tux mittens that I knitted last winter (which would have been summer if I had been in Australia then?) They are kewl but I don’t often have cause to wear mittens, and they don’t actually fit me on top of that–the assumption of the design was that geeks are MALE with male-sized hands. I don’t think my husband would wear mittens with a cute avian, other than from time to time to please me, as the people he knows would not “get” it, and they’d think why is this distinguished gentleman sporting handwear for children?

Well now I made something that I can take everywhere, any time: a plarn* bag with Tux on it. This combines my interest in keeping plastic out of the landfill with my love for all things Tux. I adapted the pattern from the mitten pattern, added an additional color (or colour, as they spell it in Oz) and voila! It was a tad tricky to knit with four colours but I’m a geek and I’m about solving problems, and so I managed.

If you would like to make one of these I assume you must be at least part geek. You can combine my basic plarn bag pattern with the mitten pattern mentioned earlier. I warn you it is quite tedious and slow going if you use my colour scheme–it might be easier if you make the background white or yellow.

My next project will be the PHP elephant!


*plarn is yarn made from plastic bags. Here is a step by step tutorial how to turn plastic bags into plarn. Knitting with plarn keeps the plastic out of landfills and the ocean, and makes a durable, strong, attractive, and reusable bag that will prevent you from taking many more plastic bags. It also makes you THINK about plastic. I have gotten so I rely on others to provide me with raw material as I avoid getting new bags almost all the time! Do not knit with the latest compostable plastic. It is designed to break down. Use the bad old indestructable plastic.

Listen to this post Listen to this post

How to access ext2 FS from WinXP and Leopard

Here’s the scenario:   I’m trying to get data together from several old hard drives that are laying around.  Some of them are dual boot Linux ext2 and a variety of Win’s all the way back to 2000.  Then I have a fairly large drive that is pure ext2.  I don’t want to haul the weight of all those drives to Australia so I got one huge drive: one drive to contain them all. So my plan was:

  • Use a USB housing that I have to hook up the biggest PATA with some space on it to the Win XP box.  That ends up being the pure ext2 drive.
  • Transfer some stuff to the ext2 drive from the internal HD on the laptop.  (I don’t have an external housing for laptop hard drives and I don’t much care for taking laptops apart to be honest.)
  • Hook up the intermediate drive to the Mac.  Also hook up the monster.  Transfer all the non linux system stuff from the ext2 drive to the monster.  Leave the ext2 drive here as a backup of several linux systems which I will start using again when I get back.  No need to take the linux stuff to Oz, because if I create a linux partition on my Mac I will just do a clean install.
  • Remove the ext2 drive from the housing replace with all the other drives and repeat.

Well, WinXP didn’t want to read the ext2 drive, and Leopard could see it but not mount it.   For Windows XP I found this article:  Three Ways To Access Linux Partitions (ext2/ext3) From Windows On Dual-Boot Systems. The third way was what I wanted, as it allowed read/write access to the ext2 drive.   It is called the ext2 installable file system for windows.  I gotta say, it worked like a champ, and it allowed me to copy several folders to the ext drive.

My next problem was to make the Mac recognize the drive.  After seeing somebody answer on Yahoo answers that you just can’t do this, I thought how wrong you are buddy.  And so I found the ext2 filesystem for Mac and installed it.  After that the Mac could see the filesystem on the drive.  I’m not sure this one is write, but that is OK, because all I want to do is copy FROM the ext2 drive TO the big monster.  Boom, now I can do what I want.

Gotta say, it’s great when you just find free tools to do what you want and they just work.  Especially after my hassle with Magento.  (Of course it would be better if common file system compatibility was built-in but hey.  Next decade. )  I’m 2 for 2  sippin’ a beer and waiting for nightfall on this hot fourth of July, and in a couple more days I’m heading to Australia where it’s winter.

Listen to this post Listen to this post
|