HOWTO: Install VLC 2.0 in Fedora 16
It was quite a pain to get my system up to speed for the new VLC 2.0. Running under Fedora 16, VLC has a bunch of dependencies that are, as of now, only found in the Fedora 17 (Rawhide) repo. Since I didn't want to clusterfuck my fc16, I decided to manually install the packages VLC's configure script told me were missing.
Here's the command to get the packages VLC 2.0 needs to compile. Run them through zif or yum:
PyQt4-4.8.6-1.fc16.x86_64 PyQt4-devel SDL_image SDL_image-devel alsa-lib \ alsa-lib alsa-lib-devel avahi-devel dirac-devel flac-devel fluidsynth-devel gcc-c++ \ gnome-vfs2-devel jack-audio-connection-kit-devel libass-devel libavc1394-devel libbluray \ libbluray-devel libcaca-devel libcdaudio-devel libcddb-devel libdca-devel libdvdread \ libdvdread-devel libiec61883-devel libmodplug-devel libmpeg2-devel libmtp-devel libogg \ libogg-devel libprojectM-devel libraw1394 libraw1394-devel librsvg2-devel \ libsamplerate-devel libshout libshout-devel libudev-devel libupnp-devel libv4l libv4l-devel \ libva-devel mesa-libGL-devel portaudio portaudio-devel schroedinger schroedinger-devel \ taglib-devel twolame-devel zvbi-devel
As you might've guessed, some of them are extras. Should they not be present, VLC will simply disallow whatever feature it was using, such as Bonjour with avahi.
Canadian Postal Codes Database
I needed some data on Canadian Postal Codes for a project I'm working on. In context, I will have an user's postal code, but no way to validate it or use it as an index to get more location data. I started looking for free lists of Canadian postal codes I could merge in my application to achieve what I wanted. The first place I looked was obviously Canada Post, but it seems they're still in the mindset that selling public data is okay and only offer to license validation data... for 5,500$ a year. Mind you, it does seem include every Canadian addresses, not only postal code/city association.
Next in line was PopularData.com who offers a free database of 765,345 postal codes and their geographic data (city, province, latitude, longitude). Such data seems to be something recurring in various projects, so I figured I'd post here once and for all to tell you (and make sure I remember) how to get that data and inject it into a MySQL database on a remote server. Here goes.
Twitter Direct Messages Bulk Deleter
If you're a Twitter user and a organisation freak, you're certainly aware that Twitter doesn't give you the ability to bulk-delete direct messages. Back in the days, Damon Cortesi had built a nifty bookmarklet that allowed you to stick it to the man. Problem is, that bookmarklet is now deprecated, due to Twitter's change of layout - most of the stuff just doesn't work the way it used to, so the infamous DM Whacker was laid to rest.
Until I got really fucking tired of all the direct messages. Here's a reboot of Damon Cortesi's DM Whacker: DMDelete-v2.0. It's fast, uses Twitter-specific resources (such as their jQuery and dialogs), and is merciless. Give it a try, all you have to do is drag the link blow to your bookmark toolbar (or wherever you want really), go to your Twitter inbox and click it!
This is beta software! Feel free to relay any feedback you might have after using - it's rather challenging to thoroughly test this piece of code on my own, so there may be random hiccups.
Installing mod_pagespeed on CentOS (cPanel/WHM)
This month, Google announced the release of an Apache module to optimize rendering times called mod_pagespeed. They've long been on to the optimization wagon: last year, they released "Page Speed", a Firefox extension to help developers optimize their pages and embed most of mod_pagespeed's diagnostics in their Webmaster Tools platform. If you want to install mod_pagespeed on your CentOS server running cPanel and WHM, you might have a few problems since the mod_pagespeed RPM depends on the httpd 2.2 package and it usually isn't installed when running cPanel/WHM since those app want to be able to control versioning themselves and not through YUM, so we'll do it manually. This guide is intended for 32bit CentOS servers where you have superuser privileges on and run cPanel and WHM. If you're running a 64bit, simply adapt the various paths and files used throughout this article.
What you need to do is rather simple and safe. It does involve modifying the Apache configuration files though, so make backups of every file mentioned in this article if you feel the need to.
Change localized strings in the WordPress admin
The other day, I ran into an interesting issue with a feature on a WordPress-powered site I was building for a client. Essentially, we're using the WordPress' default structure and functioning of posts, categories and tags in order to make it something different. Think of it like this lyrics site where categories are artist names and post titles are song titles. It's one of the reason WordPress implemented custom post types. Since the platform I'm building for this client doesn't really allow for other types of posts, I decided not to add a layer of posts on top of hiding the default things,
I wanted to rename the "Posts" menu in the WordPress admin.
In the example I've described above, I wanted to rename the "Posts" to "Songs" and "Categories" to "Artists". The problem with that is that those are hardcoded in the a WordPress file and no hooks are defined, so we can't dynamically change it. It's also useless to manipulate the $menu variable which contains the admin sidebar items since "Posts" is also displayed on pages and at a bunch of other places. So how to efficiently turn that into a different string without hacking up the core?
The solution I came up with was to use WordPress' built-in localization mechanism. When theme and plugin developers want to output a string, they can enclose it in the__('string'); function, which calls up a gettext parser to translate. I'm not a fan of the system, it obliges you to compile a new language file for every version of your theme/plugin - and add one more for every language. But it's what WordPress uses, so we'll deal with it.
Junkware on Android: How to Get Rid of It
This week was very interesting in the mobile world. Both David and Goliath were too busy dealing with their own bad press to worry about smacking each other in the face.
On Friday, Internet erupted with pretty serious accusations against Motorola and how they allegedly booby-trapped their Droid X, their flagship Android-powered superstar, so that no ROM hacking could be done whatsoever.. otherwise the device would pretty much self-destruct.
On the same day, Mark Milian from the LA Times wrote a piece on the inclusion of useless applications by carriers and the reasons behind it.
Absolutely Android put up an article titled "Why Motorola should be asked to leave the Open Handset Alliance", which maybe was a bit of an overreaction that we all shared at that point, but ended up somewhat appeased when Motorola "clarified" the situation. Yes, it's arguable.
Around the same time, Apple was in damage control mode with the iPhone 4 antenna fiasco leading up to the press conference on Friday, where Steve Jobs openly admitted he actually is considering refunds and is giving shit away to avoid a mutiny among his unholy horde. Apple. Giving back money and free shit. Because they fucked up.
It was definitely a very interesting week in the mobile world.
Consolidating Facebook’s Takeover of the Net: Bookmarklet to “Like” Anything!
I was wondering, last night, if I'd really have to wait for everyone to implement the new Facebook Social Plugins, more specifically, the new embeddable "Like Button". I think it's a pretty cool alternative to replace everyone's "Share on Facebook" annoying popup link. That being said, I decided I'd throw a little JavaScript together, actually inspired by Damon Cortesi's DM Deleter for Twitter, I put together a bookmarklet to insert a "Like" button virtually anywhere (and by that, I mean on any site/page you visit).
First, for those who want the result before the explanation, drag this link to your browser's bookmark toolbar: Like This
Alright, now for the smart people, here's a breakdown of what this puppy does:
javascript:(function(){
var h=document.getElementsByTagName('head')[0];
var m1=document.createElement('meta');
m1.setAttribute('property','og:title');
m1.content=document.title;
h.appendChild(m1);
var m2=document.createElement('meta');
m2.setAttribute('property','og:site_name');
m2.content=window.location.hostname;
h.appendChild(m2);
var m3=document.createElement('meta');
m3.setAttribute('property','og:url');
m3.content=window.location;
h.appendChild(m3);
var s=document.createElement('iframe');
s.scrolling='no';
s.frameborder='0';
s.allowTransparency='true';
s.style.border='none';
s.style.overflow='hidden';
s.style.position='absolute';
s.style.zIndex='100';
s.src='http://www.facebook.com/plugins/like.php?href='+encodeURIComponent(window.location)+'&layout=standard&show_faces=true&width=450&action=like&colorscheme=light';
var a=document.body.firstChild;
document.body.insertBefore(s,a);
})();void(0);
What that is gonna do is relatively simple and most of you will be able to guess it just by looking at the code above. It creates three META tags, one for og:title, one for og:site_name, and one for og:url which are all required by Facebook to display the data that you actually like.
Once that's done, it creates an iframe, exactly the same as just getting the Like Button code from Facebook and puts it as the first element of the body tag, making it the first thing you see on the page, technically.
This is mostly a little toy, but feel free to use it if you'd like! I'm not too sure why, but when I tried this at home, it would pop up a Facebook login window instead of just "Liking" whatever I was supposed to be Liking... this morning, it doesn't. So let me know what you experience if you try it out.
Edit: ReadWriteWeb is also saying they've got a "Safe" bookmarklet. But theirs don't add meta tags
