Living with PulseAudio via PulseAudio Device Chooser

Date Jan 06, 2010 at 10:30 AM | Computers & Technology, Hardware, Linux, Open Source, Software, Usability

Telecommuting is a pretty sweet gig with a good number of benefits. To name a few, while I’m working I can:

  • Toss some laundry in the machine
  • Start my lunch and work while it cooks
  • Sign for packages when they are delivered

And that’s just the tip of the iceberg. However, to make telecommuting possible, there are some technologies I simply MST have working. VPN is a big one, so I can get at the computers back in the office. SSH and FTP access is important to manage servers and files. And of course, I need to communicate with people; for that, we use AIM and Skype. Up until recently, it’s been enough for me to use my Nokia N800 to make my calls back to the office. It’s no good for chatting with video though, so I needed to set it up on my desktop with my camera and, preferably, my headset.

Simple enough task really; both my Logitech webcam and Plantronics headset work out of the box with Ubuntu (at least in 9.04) with nearly zero configuration required. I just plug them in, tweak Skype quickly and I’m up and running. However, with the addition of PulseAudio in the more recent version of Ubuntu, this became a little trickier.
Read Read more…

Comment No Comments

Asynchronous PHP

Date Oct 16, 2009 at 01:46 PM | PHP, Software, Web Development

I needed to “asynchronous PHP” recently and it took me a little while to find the solution. What my script basically does is generate a PDF file for the user to download based on some parameters they have chosen. The problem was, the PDF generate take a while and during that time I needed to show the user a screen explaining that the file was being generated, which would also show the download link once the generation was complete. My setup is as follows:

generate.php

This script is where the user is sent when they click “download” on the parameter choice page. This is where the asynchronous magic has to happen. From here, the user is immediately sent to download.php.

download.php

This script gives the user either a “please wait” message of a “click here to download” message, depending on where the target PDF has been generated yet.

My problem was, even though was added the header redirect code (shown below) to generate.php, the browser would still wait for the PDF to be generated before sending the user to download.php. In other words, it was only synchronous PHP, which didn’t help me at all.

header("Location: download.php");

Thanks to this comment on php.net, I was able to make it work! Basically, you need to tell the browser that you are done sending it data, even though the PHP script will keep executing. Code below:

//redirects the browser to the new url, but continues processing in the background
function redirect_and_continue($sURL) {
header( "Location: ".$sURL );
ob_end_clean();
header("Connection: close");
ignore_user_abort();
ob_start();
header("Content-Length: 0");
ob_end_flush();
flush();
session_write_close();
}

So, the user is sent to generate.php, which immediately calls redirect_and_continue(‘download.php’), redirecting the user to download.php while still continuing to execute generate.php (and make the PDF file). Once the user is at download.php, the script checks for the existence of the generated PDF file (as indicated by the filename sent through the session) and uses a meta refresh tag in the HTML to keep reloading download.php. Once the PDF file exists, it provides the user with a link to the PDF file for download.

Comment No Comments

PPTP VPN Routing in Ubuntu using Network Manager

Date Oct 01, 2009 at 12:19 PM | Site News

Back when I was still on Ubuntu 8.10 (Intrepid), I had near endless problems with PPTP VPN access using the network manager. I wasn’t alone, and I guess I was pretty fortunate that it worked at all. My problem with it was that routes never worked correctly so ALL of my traffic was routed through the VPN. To be honest, they DID work, but the connection ALWAYS dropped off after a minute, sometimes less, so it was hardly usable. This was exceptionally annoying since everything worked just fine in 8.04 (Hardy)!

Thankfully in 9.04 (Jaunty), things seem to be working again. In fact, as I type this, my traffic is being sent from my local connection, even though I’m connected to the VPN at work. Since this still seems to be a big problem for many people, I thought I would post what worked for me. Read Read more…

Comment No Comments

Go Vote for My Will Code For Green Project

Date Jul 29, 2009 at 09:48 PM | Site News

So, I entered the Will Code for Green contest last week at Jason’s recommendation. It was pretty clear that if we could come up with some ideas, we stood a real chance of winning the contest.

That’s where you, my trusty reader, come in. 20% of the scoring for the projects is based on the voting public… that’s you! So, go vote for my project, “Green Rhino,” by following these steps:

  1. Visit http://willcodeforgreen.gnomedex.com
  2. Provide your email address and click “Submit”
  3. On the resulting page, fill out your information (name, email,
    birthday, address) and the numbers and letters you see at the bottom
  4. Once you successfully register, click “Go To Gallery” on the resulting page
  5. Look for the “Green Rhino…” box. If you don’t see it, click the
    right arrow at the bottom to go to the next page. Continue browsing
    the pages until you find it, then click on it.
  6. You will see a new dialog window explaining what Green Rhino is.
    Click on the URL to see it in action if you like. More importantly, at
    the top of the new box, click “Vote for This Entry”
  7. You will be asked to confirm that you want to vote for the entry.
    Click “Vote for This Entry” again

While you are there, you should consider voting for Jason’s project “Eeko” too. It is, after all, my idea, he just ran with it. If you do take the time to vote, hit me up in the comments or on twitter and let me know what you thought. Thanks!

Comment No Comments

Ubuntu 64-bit and Adobe Air

Date Jun 14, 2009 at 06:28 PM | Site News

UPDATE 2009-10-01: I’ve just gotten Air running on my Ubuntu 9.04 (Jaunty) install. Apparently Adobe updated their installation instructions to include all the required steps now. Good for them! So, this post isn’t really useful anymore, but I’ll keep it around anyway, just in case.

There I was, running 64-bit Ubunutu and trying to get Adobe AIR to install. The problem is, AIR is written for 32-bit systems, so it needs some extra help installing on 64-bit Ubuntu. I managed to get it running, with a little help from Adobe’s site and grabbing getlibs here (their link was broken), everything looked good. That was, until I tried to install an AIR application.
Read Read more…

Comment 2 Comments

Ubuntu 64-bit, Firefox and Flash

Date Apr 23, 2009 at 04:17 PM | Computers & Technology, Linux, Software

OK, so you have this sweet new computer (much like myself) running 64-bit Ubuntu like a champ. Except for one thing; Flash elements on webpages in keep flaking out. That is, from time to time, instead of seeing the Flash content, you see a grey box that doesn’t do anything. It just sits there, mocking you, until you close and re-open either the tab, or in most cases, the browser itself.

I had this happen in both Firefox and Opera. As it turns out, the problem is related to the machine running a 32-bit version of flash with a 64-bit version of the browser. There are 2 ways to fix this: run a 32-bit browser or run 64-bit flash. But, why would you run a 32-bit browser on your sweet 64-bit machine? Well, because there isn’t a 64-bit version of flash… or at least, there wasn’t until recently.

I was tired of this problem so I hit Google and looked for a solution. Sure enough, I found one! Now, I will warn you that the 64-bit Flash is still in Alpha, but i’ve been running it for a few weeks now without any problems. Here’s how you can too.
Read Read more…

Comment No Comments

How NOT to Sell MP3s

Date Mar 16, 2009 at 01:43 AM | Computers & Technology, Linux, Software, Usability

I recently came across the band 3 on last.fm and absolutely love them. I managed to find all of their albums via torrents, but I thought I would actually buy their stuff since they aren’t on an RIAA label. Their website didn’t help at all and CDBaby didn’t have any of their stuff. I was about to give up when I thought I’d give Amazon a try. Turns out, it was a good idea; Amazon had all of their albums available for sale. But, that’s also where the problem came in.
Read Read more…

Comment 4 Comments

My Sweet New Laptop

Date Mar 11, 2009 at 08:41 PM | Computers & Technology, Hardware, Linux, Open Source

I’ve been considering picking up a new laptop for a while now. My old laptop, an ageing Dell Inspiron 8500, had treated me well for a few years, but I really wanted to change to a more portable machine. The Dell weighed in at around 8 lbs., had a battery that lasted about half an hour at its best and ran almost too hot to touch at times.

Ultimately, I just wanted a machine that was light, had a long-lasting battery and had a full-size keyboard. The 10-inch netbooks looked like a good buy, but it was difficult to find one that was worth buying. I had been considering the Lenovo S10, and came close to picking one up about a month ago when I found one for just under $300. What stopped me was reading about overheating problems with the machine. I’ve wanted the MSI Wind since it was announced, but it was always over the $400 mark, which I don’t think is a reasonable price for that class of machine. All of the other offerings were either overpriced, lacked some key features or had batteries that just weren’t going to cut it. In most cases, all of these were true.
Read Read more…

Comment No Comments

Comment are Fixed

Date Feb 09, 2009 at 08:48 PM | Site News

I just found out that comments have been broken on the site for a while. My bad! It’s fixed now…

Comment No Comments

Remote Backups with Amazon’s S3

Date Feb 09, 2009 at 08:40 PM | Computers & Technology, Linux, Open Source, Software

Recently, my SATA controller on my RAID box failed, silently corrupting my entire array. Fun stuff, I assure you. Luckily, I had backed up the array about a month before the failure and was keeping a nightly rsync running. I had a few things that weren’t included in the rsync backup, but I didn’t really lose much data. So, again, backups saved my ass!

But, I’ve been aware for a while that regardless of how much I back up, I still have everything in one place. If there were a fire or a robbery, I’d be completely SOL. This fact has prompted me to look for some free or very low cost online file storage services. Most of the ones I found required you to run their software for them to work. This wasn’t very desirable for several reasons, the most important being that I run Linux and most of the services didn’t have a Linux client to use. But even more than that, I wanted to be the one in change of the backups, something that would allow me to just set up a cron job that would encrypt my data and ideally use rsync (via this script) to send that data. Unfortunately, I still haven’t found that, but I did find service that is both cheap and easy to use; Amazon’s Simple Storage Service!
Read Read more…

Comment 2 Comments