Archive for October, 2009

I’m influential

Thursday, October 29th, 2009

I’m not really, but I feel like I am. I made two fun discoveries in my RSS feed reader this morning:

My friends over at Zoom Creates apparently found my recent post on advertising interesting enough to quote at length.

I recently wrote to Marty Kline of Sexual Intelligence fame suggesting that he take the opportunity to celebrate Concerned Women for America and Morality in Media’s current campaign, Pornography Awareness Week, by reminding people that pornography is healthy and normal and doesn’t lead to divorce or child molestation. I’m sure I’m one of dozens of people who suggested it, but I’m not going to let that get in the way of my ego trip over his most recent post, “10 Ways to Observe Pornography Awareness Week“. He’s got some great ideas, and I encourage you to read his post.

Backing up a MySQL database to Subversion

Monday, October 26th, 2009

As you may know, I recently set up subversion. As of this morning I was backing up my database with a daily cron job that sent mysqldump’s output to a file called database_[date].sql.bz2. That worked, but I’d rather not have to manage the files myself.

When I created the script to commit the newly created backup files, I intentionally removed the zipping step because I wanted to be able to use subversion’s diff feature, which would be useless if I commit binaries.

#!/bin/bash
# Dump the database and put it in a repository.
# Inspired by http://www.petersblog.org/node/959
# Written on Mon Oct 26 02:59:02 PST 2009
 
STORE_BACKUPS='/home/kj/backup'
WORKING_DIR='working_dir'
DATE=`/bin/date +%s`
FILE='server_'$DATE'.sql'
 
cd $STORE_BACKUPS
/usr/bin/mysqldump -u user -ppassword --skip-opt --comments=0 --all-databases>$FILE
 
# Must commit a whole directory even though
# we're only dealing with one file. The file name
# cannot change from day to day.
/bin/cp $FILE $WORKING_DIR/server.sql
cd $WORKING_DIR
/usr/bin/svn commit -m "daily backup; file saved as $FILE"
 
# I could delete $FILE now that $WORKING_DIR has
# been committed, but I like to have a backup
# backup in case the commit fails.
#     If you want to live dangerously and assume
# everything went as planned, feel free to
# uncomment the following line to delete.
#/bin/rm $FILE

I believe this will fail if cron tries to commit the file a remote repository over ssh because the user is unable to address the password prompt. I’m told ssh is designed to not let you redirect input or otherwise script around the password prompt. A potential solution is having the server authenticate ssh users by key instead of password.

Oct 26 Edit: Minor bug fix. I haven’t tested it post-change. I don’t think I added any new bugs, but nobody ever thinks that, so use discretion before running this script.

I hate advertisements

Sunday, October 25th, 2009

I consider being straightforward about what an ad’s intention is to be the foundation of basic decency in advertising. Anything less is predatory. Modern advertising is based on being fun and obfuscating who’s paying for it.

I have a certain respect for an advertisement that says, essentially, buy this product. Those that try to act like they’re just a fun game or PSA created selflessly for public good when their true intention is to manipulate your feelings for profit are truly offensive.

I know a lot of people “ignore” ads, but I don’t believe it’s as effective as they like to think. First off, you have to see something, and process enough of it to recognize that it is something to ignore. That is plenty of time to see a logo or get the gist of what it’s trying to sell you.

It’s said that the purpose of advertising is not so much to sell you on a particular product as it is to build brand awareness so that when you realize one day you need new shoes, the first thing you think is of a specific brand or store. If this is true – and I believe it is for at least some advertisements – then by the time someone has decided to “ignore” it, they’ve already absorbed enough information to accomplish the advertiser’s goal.

Everything on the Internet these days is ad-supported, and many sites are data-mining supported: by visiting, you either give them data about yourself, either implicitly by visiting the web site, or explicitly by entering your name, e-mail address or other information, identifying or not. This data can then be sold back to advertisers to let them know how effective their advertisements are. When a web site takes on advertisements, they’re effectively selling access to their visitors’ eyeballs. You, as a visitor, pay for a site by yielding your headspace to them.

While I have a special hatred for Internet advertising because of its privacy implications and the practice of selling data, I don’t have a problem with a person agreeing to yield their headspace in exchange for a free e-mail account or entertainment. The user has given their consent to be advertised to. A person walking past a bus stop, selecting produce or using a urinal has not entered into such an agreement.

Revently, the FTC declared that bloggers “must disclose the receipt of free merchandise or payment for the items they write about.”

I am unpleasantly surprised by how many voices on the Internet are expressing severe butthurt over these rules. I’m not at all surprised by advertisers’ butthurt, but I do hope companies that feel this way will identify themselves clearly so I can avoid doing business with them.

Noting the new guidelines have created a “firestorm of controversy within the ad-supported interactive-media industry,” Interactive Advertising Bureau President Randall Rothenberg suggested the FTC rescind the new guidelines.

What a great suggestion! I bet the CEO of Chrysler or GM wishes he’d thought to suggest to the EPA a loosening of environmental restrictions. I welcome this firestorm: Based on their own description, “the ad-supported interactive-media industry” seems to be based primarily on deceiving consumers. I would love nothing more than to watch it crash and burn.

Many sources have pointed out, accurately, that these rules are unfair because who write reviews in print media don’t need to declare their alliances. I don’t see why we can’t rectify this by imposing these rules on more traditional media as well. Advertisements are often embedded right in a TV show or movie, and unlike a commercial break, many viewers may not even realize they’ve seen an advertisement. There’s no reason radio time purchased to play songs alongside unpaid content should be exempt. If it makes sense for the FTC to impose rules about full-disclosure for product placement in a blog post, there’s no reason it shouldn’t also carry over to any other instance of product placement.

I rather doubt that will happen, in part because I suspect that advertising and media are already so intertwined it’s difficult to draw a line between them. I wouldn’t be surprised if there is no “unpaid content” on the radio, or, instead of movies where advertisements are snuck into the plot, movies are advertisements with a plot tacked on as an afterthought. Increasing amounts of advertisements feed the need to compete for consumers’ attention, which in turn feeds the need for more intrusive advertisements.

I don’t have an alternative for how a business should let potential customers know about their offerings. The need goes both ways: People in capitalist societies need to know where to purchase necessities as much as businesses need to sell them. I’d like to see consumers and businesses (which are made of of consumers) work together to bring about a mutually agreeable solution that doesn’t involve intrusive advertising or lies.

Setting up Subversion

Sunday, October 25th, 2009

Every six months or so I decide to set up subversion on my server. Inevitably, I get some error (usually at the svn+ssh stage) I can’t find a solution to and lose interest after several hours of trying. I don’t know if I’m smarter or if errors are better documented, but I was successful.

I primarily used these instructions. Some of the errors I did encounter include:

  • When testing the online repository, I kept getting a forbidden error, even after inputting the correct password. It turns out I was giving it the wrong repository name. This would have taken me forever to diagnose without tail /var/log/httpd/error_log.
  • On import, “Unable to open an ra_local [sic] session to URL”. I had the arguments in the wrong order. It should go:
    svn import [files] [protocol]://[repository]
    I wish subversion’s otherwise excellent documentation would use more explicit terminology in distinguishing between your working copy and the repository.
  • I deleted a directory in my working copy, and when I try to check it in I get the error “Directory [directory] is missing”. I thought I could solve that by deleting it with svn delete instead of rm, but apparently that’s not the case. After a couple hours of googling and still lacking a better idea, I ran svn delete again immediately before committing. That did the trick, but I’m not sure why it was necessary
  • I have two separate config files, one for the development version on my laptop and another for the live version on the server. Now that both are drawing from a common repository, I made two config files in the same package, one for debugging and the other for live. I check in the files from my laptop and ran svn update on the server to bring them up to synchronize them. This did not synchronize them. I tried checking out a new version on the server, and although subversion indicated that it completed the operation successfully, the live version is still not using Although they both claim to be using revision 6, the live version is still showing the old config files.
  • Spent several hours finding out the hard way that can’t just add a file to a working directory and have subversion include it automatically, you need to run svn add file then commit changes. This is my least favorite feature of subversion.

I toyed with making the repositories available online. While it worked, I’d like to make them pretty before I introduce them to the public

C Magazine is an advertisement, not a magazine

Friday, October 23rd, 2009

A couple years ago we started getting a large periodical in the mail calling itself C Magazine (subtitle: “California Style”). It tries to pass itself off as a magazine, complete with cover price and subscription page. The dead giveaway that it was junk mail is that it’s addressed to my grandfather, who doesn’t subscribe to magazines on account of having been dead for 50 years.

I imagine they got a mailing list of households who subscribe to a lot of magazines (which we do) and then picked a random male member of the household and mailed it with his name on it. I’m guessing they count on the recipient to not notice it’s not one of their regulars, or to assume they had subscribed to it on a whim. Indeed, had it been addressed to someone who was alive and resided here, I don’t think I would have had any idea it was junk mail.

Finland declares Internet access a human right

Tuesday, October 20th, 2009

I know almost nothing else about Finland except that I’m suddenly filled with love for it. The US Pirate Party, on whose mailing list I first heard this, has the details.

I find it interesting that they declared the minimum speed to be 1 megabit per second (Mbps). That makes dial-up (typically billed as 56k or .056 Mbps) is, by Finland’s standards, a human rights violation. Although I don’t know the first thing about Finland or their legal system, I am curious how it affects any dial-up providers that may still exist there. Will there be follow-up legislation banning the sale of dial-up? Will the infrastructure surrounding dial-up become contraband, or a useful backup in case of emergency?

This prompted me to wonder about my own connectivity speed. You may view the results if you’re curious. Then in 10 years when everybody’s using fiber optic or whatever bests it, we can all look at this and laugh and wonder how we lived with such slow connectivity.

How to add rel=”nofollow” to just one link in your blogroll

Tuesday, October 20th, 2009

I link to a site that, while I appreciate its hilarity, I really don’t want to positively influence their Page Rank. Page Rank is the assessment that Google has made about the quality of a site; more non-spam links usually correlates to higher Page Rank. You can use a link’s rel attribute – created to describe relationships between documents – to tell search engines that you’re not endorsing a it.

In WordPress, there’s a handy field for setting the rel attribute of a link, except they’ve got some Javascript wizardry in place to prevent you from just typing “nofollow”. A little research revealed lots of plugins to alter all your links in some way, but I didn’t want that. I found a site that allegedly showed how to alter the WordPress code, but that site’s layout had such serious defects that I couldn’t make heads or tales of what it was trying to tell me.

Then I had an idea that was so smart it made me feel stupid: alter the database. Most web software, including WordPress, is essentially a fancy interface to get information into and out of a database1. Bypass the gatekeeper by going straight to MySQL’s command line.

First, find the id of the link you want with the following command:
select link_id, link_name, link_rel from links where link_name like '%Clearingho%'

I searched for links containing the term Clearingho; you should change it to the name of the link you’re looking for.

The first column is link_id, the bit of information you’re looking for. The second is the link name, which I included to confirm that I really am grabbing the right id. Third is the existing rel value; I wanted to make sure I wasn’t about to clobber any existing data.

The link_id in this case was 18 and the existing link_rel value was blank, so it’s a simple update:
update links set link_rel="nofollow" where link_id=18

If you wanted to retain the existing rel information, you could run the following query instead:
update links set link_rel=CONCAT(link_rel, " nofollow") where link_id=18

Refresh your blog and see the new rel=”nofollow” on your suspect link. Congratulate yourself and do a silly dance.

1 Just in case it’s not already obvious, I’d like to clarify that this is not in any way a slur against WordPress or any other database-driven2 software.
2 This buzzword is so 2003.3
3 Yo dawg, I heard you like footnotes, so we put a footnote on your footnote so you can foot while you note.

Why am I blogging?

Monday, October 19th, 2009

I’m writing this post as much for me as for you. Indeed, given that I don’t think anyone reads this blog, you could argue that it’s entirely for me. But you won’t, because that would mean that you’re reading this, which would render the basis your argument false.

Now that I’ve got my moment of schizophrenia out of the way, here’s are my goals in rough order of importance:

  • Frequently, when I google a computer problem, I get somebody’s blog post about their efforts and eventual success with the same issue. I’d like to contribute to the knowledge pool.
  • Release and publicize code
  • Pursuing goals: I’ve read that by publicly announcing your goals, you’re more likely to follow up because you’ve introduced the threat of public failure.
  • Journaling: so I can look back and remember how awesome I am
  • Professional opportunities
    • Many jobs I apply for want candidates to have strong writing skills. What better way to show off my superlative writing than by writing?
    • The aforementioned goal of contributing to the knowledge pool is both altrusitic and self-serving: it creates a public record of my ability to solve problems, which is another oft-requested but hard to prove skill requested in job ads.
  • This blog offers me a platform to evangelize on topics that I think would benefit the world at large, including but not limited to free software, veganism, advertising and the abolition of gender.
  • Book reviews in hopes that it will help me retain more of what I read.
  • Passing along anything funny or interesting that hasn’t already made it around the Internet ten thousand times.
  • Keep friends, family and any other interested parties updated on my life

Internet vs internet

Sunday, October 18th, 2009

I’ve previously argued that Internet oughtn’t be capitalized because, essentially, the Internet is the only internet. I made this argument out of a love for the Internet and its ubiquity, and the hope that it would be with us forever.

That same hope and love for the Internet now prompts me to reverse my previous stance. We capitalize proper names to show respect, and there are precious few things more worthy of our respect than the Internet. We must capitalize Internet for the same reason people capitalize God.

I predict that at my next change of opinion, I will argue that we ought to capitalize it circumstantially, the way we do with familial titles, “This is my mom” vs. “This is Mom.” Analogously, “I browsed the internet” vs. “I browsed Internet.” No one says “I browsed Internet”, but it’s perfectly acceptable grammar since Internet is its proper name.

Show horses parrots

Monday, October 12th, 2009

Yesterday as I drove home from San Jose, I saw a horse trailer with the following phrase on the back:

Caution:
Show horses
Parrots

I’m not sure what it was trying to tell me, but I came up with three possible interpretations:

  • Put parrots in horses’ field of vision
  • This trailer contains show horses and show parrots
  • This trailer contains show horses and regular parrots

I’m going for the first interpretation, which was supported by the presence of a decal with parrots on the left and a horse’s head on the right, looking in the direction of the parrots.