Posts Tagged ‘tech’

Create a csv from MySQL output

Wednesday, December 10th, 2008

Today I got asked to pull some information from a mysql database. Pretty simple, but the one minor catch was that the person asking wanted it in a spreadsheet. Thankfully this is pretty easy with mysql’s built in ‘INTO OUTFILE’ functionality.

select * from users where last_name LIKE "%smith%" order by first_name
INTO OUTFILE '/tmp/result.csv'

This will write the file /tmp/result.csv in a format that is readable by pretty much any spreadsheet program (Excel, OpenOffice, etc). If you have any specific requirements for your file format (say you want tab separate) play around with the options until you get it just right. As you can see you can do anything you would regularly do in a sql query (joins, where clauses, ordering, etc).

And there you have it, one happy person who can access their data in their favourite program

Virtual Server Setup

Saturday, June 28th, 2008

Recently, I needed a clean environment to do some development for a project at work. The OS (ubuntu) I have installed on my development computer wasn’t the same as what the application was originally developed and deployed in (red hat) and this was causing a few issues. I debated bringing up a slicehost slice solely for coding and testing, but this seemed like a hassle, as well as an extra expense.

Enter virtualization. There are a number of options to create a virtual computer on your host system. The most popular hypervisors are VMware and Xen. What these programs will let you do is create a completely separate installation of an operating system inside your current one. This let me create the clean environment I needed for this project.


RSS: Really Simple What?

Monday, May 26th, 2008

So, I’m sure many of you have heard of RSS before, but may not know the benefits, or if you do, how to set it up. Yet another acronym, RSS stands for Really Simple Syndication and basically what it will do is allow you to subscribe to the content of a website that has a ‘feed’. Then, whenever this site is updated with new content, you will know right away. Most current browsers (Firefox, and Internet Explorer 7) have built in RSS reading capabilities under names such as Live Bookmarks or something similar. In the top right corner of the address bar you will see an icon similar to the one to the right. Clicking on this will walk you through the process of setting up an RSS feed right in your browser.

There are also many programs that you can download for free to read RSS Feeds. If you are using Firefox (which I highly recommend… I’ll write about this another time), there is a great plugin called Sage that I have used previously. Sage will let you categorize and search through your feeds on your computer nicely. If you are looking for a stand-alone application, something like SharpReader will do well for you. If you are using Linux, I’ve heard that Liferea is a great gtk application with all the basic features you’ll need.

After using numerous applications, I have ended up using Google Reader. Now, you’ll need a Google Account (yup, it’s free) to use their RSS reader, but I’ve found that it is worth it. It’s very quick to process lots of data (on an average day, I’ll read at least 120 headlines, and that number keeps climbing). One major benefit of using Google Reader for me was the fact that since the data is not stored on a computer, you can log in from anywhere and pick up exactly where you left off. So, it doesn’t matter if I’m at work, on my laptop, desktop, or on the other side of the World.

All in all, RSS is a great way to keep tabs on dozens of sites without spending hours clicking through to each one. Most of my family and friends blog or run websites of some sort and it’s great to keep tabs on all of them 🙂 If this has inspired you, feel free to add me to your RSS to stay up to date on the lastest posts here!


Saturday, May 24th, 2008

As some of you may have noticed, there’s a “What am I doing?” list of mini-posts on the left part of the blog. These are coming from a web-serivce called Twitter. There are a number of ways you can use their service to keep your friends udpated with what you’re up to right now. First, you can use their form on the website, but that would mean you would have to log into the site each time for just a quick update. Another option is to get a Twitter client (I’m using gtwitter on Ubuntu, but there are clients windows, linux and Mac OS-x) for quick posts, and to keep tabs on your friends. You can also set up twitter as an IM friend, so you just msn, or gTalk their address and it updates your status. Apparently you can also text from your cell phone to update as well. That makes it pretty slick to be able to update on the go wherever you happen to be! Lastly, they have an API that you can tie into if you feel like doing a bit of coding. I’ve heard of people writing server-monitoring apps that will post to twitter on certain events. The server admin then adds the server as a friend (wow, that sounds lame) to stay up to date on what’s going on. Some other trendy, web 2.0 sites use twitter as well. Remeber the milk, an online To-Do list will tweet you when you have items that are coming up as due. It’s pretty neat to see sites tieing together like this to provide added value. It’s not all roses though. I’ve just started using the service recently, and have experience a fair bit of down time. Hopefully they are working on this at the moment, and trying to make things more stable. Also, you’re limited to 140 characters. This keeps your messages short & sweet, so I haven’t noticed this as a major limitation yet. Check it out, and let me know if you start tweeting!