Soundcloud, for those who don’t know, is a service that lets users upload and share their own created sounds and music easily on the interwebs.

It comes with a handy embedded player, which lets you play music from within your own browser, and embed that music in other web pages.

Since I occasionally link to media hosted on Soundcloud from within Idno posts, I thought I’d write a quick plugin to turn these links into an embedded player!

» Visit the project on Github...

So, I recently got a notification that my Hardware Enablement Stack (HWE) was no longer going to be supported, so I had to perform an upgrade. I didn’t have time to move to 14.04, so I just did the HWE upgrade.

Unfortunately when I rebooted, I no longer had 3D support, and worse, my twin monitor setup was no longer supported (or rather, both monitors were active, but showed the same thing!).

Diagnosis

I am rocking a NVIDIA GeForce GT 610, which, although it’s a basic card, doesn’t seem to be supported very well by Ubuntu’s native Nvidia drivers. When I ran nvidia-detector, no cards were found.

Since my card was working before, I figured it was probably just a driver problem.

Solution

The solution I used for this was to update the Nvidia drivers to use the Nvidia proprietary drivers. Here’s how…

  1. First, visit the Nvidia website and use the wizard to download the correct driver bundle for your card.
  2. Hit Ctrl-Alt-F1 to enter a console
  3. Uninstall the existing Nvidia drivers: sudo apt-get remove --purge nvidia-*
  4. Move the old Xorg config out of the way: sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.orig1
  5. Stop X: sudo stop lightdm
  6. Run the NVidia installer (Note, you may need to reboot and re-run steps 5 & 6, as the installer may have to disable some kernel modules). Save yourself a headache, and be sure to build the DKMS module, so that changes aren’t lost when ubuntu updates itself.
  7. Reboot

All going well, you should now have working Nvidia drivers with two screen support!

I make use of Jetpack for this blog in order to add some pretty handy functionality, cross posting to my silo accounts, commenting, and OpenGraph.

Unfortunately, I had to make a couple of tweaks in order to get Opengraph working correctly.

This info is dotted around t’internet, but as an aide-mémoire, I figured I’d consolidate here.

OpenGraph headers not showing

To start, I had to get the OpenGraph headers to show in the first place. This required me to make a minor modification to the code of the plugin, not exactly desirable, but good for the moment.

Basically, Jetpack has a list of plugins that it conflicts with, and if one of those plugins is running, then it disables certain features. Unfortunately, I was running one of these plugins.

I didn’t want to disable the plugin, but after reviewing the code, I figured I wasn’t making use of the conflicting functionality (namely Opengraph, and two sets of opengraph headers is known to cause problems), so I removed the plugin from the list.

This list is found in $conflicting_plugins, which can be found in the function check_open_graph() in the file class.jetpack.php. Comment out the appropriate line at your own risk.

Missing/default open graph image

Next, I wanted to provide a default image for situations when the I don’t have a featured image in the post. This required a slight modification to my theme’s functions.php, as described here and here.

Showing your twitter user instead of @jetpack

Finally, I wanted to use my own twitter handle (@mapkyca) for the twitter card, instead of the default @jetpack.

This was another quick addition to my functions.php, e.g.

add_filter( 'jetpack_open_graph_tags', function( $og_tags ) {
        $og_tags['twitter:site'] = '@mapkyca';
        return $og_tags;
}, 11 );

See this discussion for details.