Posts tagged: code

Add Digg To Blogger.com Posts

By , December 5, 2007 2:51 pm

After a poking around the xml template for my site, and playing around with the Digg code, I’ve figured out how to add a Digg button to my posts.
Listed below is a quick how-to for adding this functionality to your website too.

  1. Make sure your blog is set to enable Post Pages and you are using the new Blogger, not the classic version
  2. Go to the customization section of your blog, on the Template tab select Edit HTML
  3. Make sure to click Download Full Template and save a backup copy to disk – just in case.
  4. Put a check in Expand Widget Templates.
  5. Search for <p><data:post.body/></p>
    Update: November 5th, 2008

    It has come to my attention that some templates use a slightly different formatting. If you cannot find the text listed above – try searching for <data:post.body/> and follow the rest of the instructions.

  6. Paste this on the line directly before it:
    <div style='float:right; margin-left:10px;'>
    <script type='text/javascript'>
    digg_url=&quot;<data:post.url/>&quot;;</script>
    <script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
    </div>
  7. Preview your template to make sure it looks right – the Digg icon should appear at the top right of all your posts. Hover your cursor over it and make sure the link URL matches your post URL.
  8. If all looks well, click Save Template and then View your blog

Happy DIGGing!

X11 Gotchas

By , December 3, 2007 2:12 pm

While manually editing and tweaking my video configuration for Ubuntu 7.10 (Gutsy Gibbon) to get better performance for my ATI Radeon 9200 I accidentally butchered the config. (Tee-hee oops!)

Thankfully it reverts to a low setting at least allowing me into the desktop to load a terminal and start correcting my errors.

First off – if you can’t figure out what you did, just blast it and start over with this command:

sudo dpkg-reconfigure -phigh xserver-xorg

This will load the /etc/X11/xorg.conf file back as it was at install. Restart your x-server and things should be operational from a clean slate, unless you get the following message:
md5sum: /etc/X11/xorg.conf: No such file or directory

In which case, something you did wiped out your configuration entirely, and dpkg doesn’t want to reload it. This is easily recoverable:

sudo touch /etc/X11/xorg.conf
sudo dpkg-reconfigure -phigh xserver-xorg

This places an empty file in the location, allowing dpkg to do it’s thing without error.

Hacking The RTL8187b On Linux

By , November 30, 2007 8:14 pm

As I’ve mentioned in previous articles (Linux, Ubuntu and Me; Ubuntu, Stage One; and Ubuntu, Stage Two) my network is wireless using a USB dongle that I insist on keeping in the set up.

I have several reasons for this: all my upgrade slots are filled (AGP has video card, PCI has Soundblaster Live! and WinTV cards) and running cables would require a large amount of cat-5 wiring strung across several doorways, ceilings and down a flight of stairs. Ugly, time consuming and annoying to say the least. The current dongle I have works excellent (better than my old PCI card in fact) and came at a decent price.

The catch is that the Linux drivers for the RTL8187 chipset don’t include the B model. It’s functionally compatible, just not recognized by the driver. Lucky for me, someone did some correspondence with RealTek and found out what codes to enter into the driver to correct this. Furthermore they provided him with the source code, allowing him to make the appropriate changes. The source package is freely available for download.

Compiling the drivers was simple – as per RealTek’s README included in the files, the only caveat I encountered was that WPA encryption doesn’t seem to work (WEP 64 and 128 do) and it doesn’t automatically load on startup. I live in the suburbs and can get away with 128 bit encryption, so I can compromise on this point. By adding pre-up /{path to drivers}/wlan0up to /etc/network/interfaces just before the first wlan0 line (iface wlan0 inet dhcp on my system) it works perfectly. I reboot, and it just connects. Voila!

As a footnote, I’d like to mention that all my previous posts on this matter where made on my Windows XP laptop (which has to stay that way since it’s used at / owned by work) but this is the first post made with my newly configured Ubuntu system.

Panorama Theme by Themocracy