2013-01-22

Web 2.0 made easy with IFTTT

Web 2.0 is about treating everything on the web as a datasource, and generating dynamic content based on one or more datasources. It used to be a fairly complex task: websites rarely presented their data in a structured form, much less provided APIs for access. So, one had to rely on a bunch of ugly screenscraping tricks which include pages of regular expressions.

Now, most sites publishing useful data also publish a machine-readable stream. Most will even provide APIs to access that data, e.g. Flickr (a Web 2.0 pioneer), Twitter, Facebook, etc.

The point of this post is to highlight ifttt.com (stands for "If This Then That"). It comes with many predefined "channels", which may be considered both sources of data and targets for publishing to. Personally, I use it to send myself a text message whenever the weather forecast predicts rain the following day. Recently, I just created a Tumblr (since there is a lot more social interaction between bloggers there than on Blogger), and wrote a recipe to duplicate posts in this blog to Tumblr. It reads the RSS feed for this blog, and every time there's a new item, a text post is created at Tumblr which links back to the post here.

I also have, for my personal use, a recipe that looks at Craigslist for listings of bicycles of a certain make, and emails me a link to the posting when one is found. For data sources which do not give legal RSS, one can use Yahoo! Pipes to preprocess the input and generate a clean RSS feed, which can then be used in an IFTTT recipe.

Cinnamon desktop for Ubuntu 12.10 Quantal

I wish I had discovered this sooner. I've been using Unity for months and never did get used to it very well. I installed the Cinnamon desktop over the weekend, and it works like an old-fashioned desktop.
sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon
When logging in, click on the small Ubuntu logo, and select the desktop environment you want.

2013-01-07

Wifi connectivity issues and TCP SACK

So, my Ubuntu 12.10 laptop recently developed an issue where it would not connect to the wifi access point at a local café. My iPhone had no trouble, nor the laptop when booting into Windows 7. Other people using Mac laptops seemed to have no trouble, either.

At a guess, since similar connectivity issues came up at work a few months ago, I decided to turn off TCP SACK (Selective ACKnowledgement), and that caused the wifi connection to start working. What's odd is that SACK is supposed to be negotiated at the start of a connection. Whatever. It works, now.

UPDATE: Well, maybe that wasn't it. Right after doing this, I turned SACK back on to see its effects, and was able to connect to the access point with no trouble.

UPDATE 2: Here's the commandline:
sysctl -w net.ipv4.tcp_sack=0
There was some discussion on ServerFault about TCP SACK, and also an in-depth article by Patrick McManus from 2008.

2012-12-18

Changing the GNOME keyring password

I just changed my password yesterday -- we have a 180-day lifetime on passwords at Wake Forest -- and discovered that my GNOME keyring password still remained the same. The password is supposed to be the same as the login password so that the keyring is unlocked when you log in.

I had changed my password using the command line. Maybe the GUI tool would automatically update the keyring password, as well. (I have my doubts.)

A little googling turned up slightly outdated information. So, for posterity. One uses Seahorse which turns up as the "Passwords and Keys" application under Fedora. Just search for "seahorse":



Once you do, though, there is no obvious way to change the keyring password as this is the view first presented:


The trick is to go to the View menu, and check on "By keyring".




A left sidebar pops up showing you the three keyrings available: Passwords, PGP Keys, and Secure Shell. The Login keyring under Passwords should have a lock icon next to it:


Right click on "Login keyring", and select "Change Password", then change it to be the same as your login password. The next time you log in (even with KDE), the Login keyring will be unlocked.

2012-11-30

Fixed-width fonts in Gmail

I keep having to search my email for instructions I mailed out to colleagues to get fixed-width fonts in Gmail under Firefox and Chrome. So, I'll make a post, instead. This is gleaned from various sources on the net.

First, for Firefox:
  1. Install the Stylish extension. This allows injection of CSS into web pages.
  2. In the Firefox Add-on management window, click on User Styles in the left hand column, and then click the Write New Style button.
  3. Enter the following userstyle "script", and then give a name, and save and close:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("mail.google.com") {
    /* GMail messages and textarea should use fixed-width font */
    .gs .ii, .textarea, .editable {
    font-family: MonoSpace !important;
    }
}

If you use Firefox Sync to sync Firefox on different machines, you may want to install the Stylish Sync extension, which uses Firefox Sync to sync installed user styles.

If you don't want to write your own user style, you may be able to find one at userstyles.org.

For Chrome, I use a Greasemonkey script, i.e. injected Javascript. Chrome natively supports Greasemonkey userscripts. You could also use this on Firefox if you have Greasemonkey installed.

2012-11-28

Full-disk encryption on Linux Mint 14

UPDATE 2014-06-29: Unfortunately, when I updated the comment system to use Google+, it cleared out the old comments, which happened to be somewhat helpful.

I have just tried, and failed, to get full-disk encryption on Linux Mint 14 (see also this Ars Technica review). I'm writing this post in the hopes that someone can figure out how to get it to work.

As part of my university's ongoing efforts to improve data security, we have just been required to encrypt the drives on our work-issued laptops.

Ubuntu 12.10 Quantal Quetzal introduced the full-disk encryption option into their default installer. Previously, it was only available via the text-mode installer available on a separate "alternate" image. However, despite using Quantal for several months, I find the Unity GUI really annoying, and decided to try Linux Mint 14 with the Cinnamon desktop GUI. The Cinnamon GUI is a GNOME 3 fork, so it uses 3D compositing, but presents a GNOME 2-like interface (or Windows-like), which I prefer.

Unfortunately, Linux Mint 14 did not adopt Quantal's Ubiquity installer, so the full-disk encryption option was not available. Andreas Haerter has written a good guide to full-disk encryption on Ubuntu prior to 12.10, and included a shell script which automates a lot of the process. I made some small modifications to the script for Mint: renaming LVM volume names, using optimal alignment in parted. However, Ubiquity now crashes after I specify the mount points and it starts doing the install proper.

Maybe someone out there has an idea of what might be broken?

My modified script is here:


2012-11-05

Private Ruby gems

I have been remiss in updating this blog. Here's a quick tip about Ruby:

To install Ruby gems to your home directory rather than to the system-wide gems directory, a couple of environment variables need to by set/modified:

    export GEM_HOME=$HOME/gems
    export PATH=$GEM_HOME/bin:$PATH
 
Since our site's conversion from cfengine to Puppet, I have been wanting a sort of testing framework other than just putting things out on a test server and running a test Puppet agent against it. I found a good blog post by Patrick Debois describing a few testing methods for Puppet.