I recently had the task of automatically “tweeting” when a new article was posted to one of the websites I had built, it turns out to be a pretty simple operation thanks to both Twitter and Bit.ly providing a straight forward API. An account with Bit.ly does have to be opened to obtain an API key.
I decided to use the built-in cURL functionality of PHP for interacting with the APIs. This code uses some of the JSON functions introduced in PHP 5.2.0 so a recent install of PHP is required as the Bit.ly API responds with a JSON string. On to the code…
Read the rest of this entry »
After upgrading my media server to Jaunty recently I noticed that I could no longer play FLAC files from within iTunes under OS X. I couldn’t figure out why this was happening, but to solve it I configured mt-daapd to handle the transcoding with a script rather than with ffmpeg.
There are a few small issues that don’t make this reconfiguration as straight forward as you would hope. First of all, the required script (mt-daapd-ssc.sh) is not installed along with mt-daapd, so I had to pull it from the svn repository and drop it into /usr/bin. Also, mt-daapd-ssc.sh uses wavstreamer to encode the decoded FLAC file, so if that isn’t available on your system, you’ll need to install that too. I believe it is built along with the rest of mt-daapd when building from source.
Next up, mt-daapd.conf needs to be modified to change how the transcoding is handled, the following lines need to be uncommented:
ssc_prog = /usr/bin/mt-daapd-ssc.sh ssc_codectypes = ogg,flac,alac
The following line needs the ssc-ffmpeg.so part removed:
plugins = rsp.so,ssc-ffmpeg.so
At this stage, I thought that this was all that was required, but I still couldn’t get it working. Upon searching the Ubuntu Forums, someone else had already been through this and pointed out that one component of this set-up (I’m unsure which) requires an older version of FLAC, so a symlink had to be created.
sudo ln -s /usr/lib/libFLAC.so.8.2.0 /usr/lib/libFLAC.so.7
After restarting mt-daapd, iTunes was again playing FLAC files!
One of our office printers decided to die the other day, a Brother multi-function laser printer, which I recall took quite a lot of messing around to get it printing from Ubuntu and once it was set-up it always took a while to send pages to the printer. Sometimes, it printed just a bunch of garbage instead of the document I sent too.
Our new printer, an HP 2727nf MFP, was a completely different experience. After hooking it up to the network and selecting to add a new printer within Ubuntu, it searched for printers, found the new HP, fetched and installed the required drivers and just worked! Pages are sent to the printer almost immediatly and have printed perfectly every time, so far.
Also, I set the same printer up on 6 machines in the office, 1 x Ubuntu, 2 x Xubuntu, 1 x OS X, 1 x Vista, 1 x XP Pro. By the time it was set-up on the first Windows machine I had already completed the set-up on all three Linux machines – Two thumbs up for Ubuntu and HP.
I’ve recently started using Trac internally for managing the ever growing list of projects that I have built and am responsible for maintaining. There is currently no feature within Trac for displaying a list of all the environments and how many open tickets each one has, and I’m guessing this is down to the fact that each environment has it’s own SQLite database.
However, browsing the root of the Trac install does give a list of all the available environments, and there are RSS feeds available for any of the reports that have been created. So I wrote a quick script to pull information from both of these resources and display a list of all available environments and how many open tickets each one has. Read the rest of this entry »
Although I hardly use my SD-1, due to my GT-8 having all of the overdrive settings I could possibly want, it was still annoying me that I had a faulty pedal sitting on my shelf. The problem I was experiencing was that the SD-1 was constantly stuck in its on position – Stomping on it did nothing but continue with the overdrive.
After taking it apart and hooking it back up to some power, a guitar and an amp, in its disassembled state it was working fine – Reassemble and the fault reappears. It was instantly obvious that something was shorting out against the metal casing. You’d have thought that there was some form of non-conductive coating on the base-plate – Maybe there is, but defective near the switching area of the circuit. Covering the base-plate with insulation tape fixed the issue and it’s now working perfectly again!
My media server was getting to the stage where it required some extra discs, so I purchased another pair of 500GB SATA disks and a SiI-3114 based PCI to 4-port SATA controller card to hook them up to as I was out of spare SATA ports.
Upon booting there was no sign of the cards BIOS during POST and no sign of the disks attached to it either after booting into Ubuntu, though running lspci reported that the card was present. After poking around with a mixture of Google and the Ubuntu forums, a number of people were having issues with the card but no conclusive fix had been found.
So I head on over to the Silicon Image website to check if there are any new BIOS images available, and surprisingly there was! After downloading, and realising that the only flash tool available was DOS based along with my server not having a floppy drive or a CD drive to boot into a DOS shell with I managed to get a USB stick booting into DOS with the flash tool.
To cut the story short – Flashing the card with the latest non-RAID version of the BIOS fixed my issue. It was now displaying the BIOS upon boot, and the attached disks were visible when running lshw -C disk.
So I accidentally spilled a cup of tea over my Blackberry. Fortunately, after drying it off most of it worked perfectly bar one of the most important components in a mobile phone – The microphone.
After doing a little research, it turns out that the mic is surface mounted to the keyboard PCB so to replace the mic I’d need a new (or working) keyboard PCB. The only place I could find this component new was on some American website, which after shipping and other taxes involved in importing stuff, would have cost about £70. Or, I could have sent it off to Vodafone for repair at a cost of £60 and a few weeks Blackberry-less no doubt.
I ended up grabbing what was described as a faulty 8800 from someone on eBay for about £40, the description said it had a software fault, so there was a good chance that the hardware was in good condition. It turns out that there was nothing wrong with it from what I could gather after messing around with it for a couple of minutes. But it was on the o2 network, so no use to me. Read the rest of this entry »
Since I first bought my Logitech MX5000 combo it has never worked correctly on Ubuntu (back to 6.06 maybe…) after booting. The keyboard would work perfectly in the BIOS and even in GRUB, but as soon as I reached the (GUI) log-in screen my MX5000 would become unresponsive until I disconnected the USB Bluetooth receiver and plugged it back in. As you could imagine, quite tedious on every boot.
After doing a bit of research, this appears to be a fairly common issue. One suggestion that did work for me was to remove the bluez-* packages, but apparently there is the side effect of other Bluetooth devices no longer working. This isn’t an issue for me, so it’ll keep me happy until a real fix is in place.
Drop the following into your CLI if you’re having the same issue…
sudo apt-get remove bluez-cups bluez-pcmcia-support bluez-pin bluez-utils
I have just noticed an odd bug when viewing a H1 tag with a background colour under IE6 – There is no background colour until the H1 is taken out of view by scrolling it out of the viewport and then bringing it back again. Highlighting the text partially brings in some colour.
One solution for this issue is add relative positioning to the tags CSS class.
I consider my understanding of MySQL around the intermediate level, but when writing table joins in the past I have always used the ‘equi-join’ method:
SELECT t1.*, t2.`name` FROM t1, t2 WHERE t1.n = t2.n;
Now, when a record for t2.n doesn’t exist, a row will not be returned. To solve this problem in the past, I would have executed two separate queries and process the output with PHP – Not the most efficient solution.