Category

Obama/Biden vs. McCain/Palin: November is coming

My mom forwarded this to me. I usually don't get too many of this type of email from other relatives since they're mostly republican--and I tend to reply back fact checking them. But it's interesting to me to see this type of stuff flying around from the dem side... and I agree with it completely.

---------- Forwarded message ----------
From: Sacred Soaps <sacredsoaps@yahoo.com>
Date: Mon, Sep 22, 2008 at 10:54 AM
Subject: Obama/Biden vs. McCain/Palin: November is coming
To: My mom and 999 other people...

"I'm a little confused.  Let me see if I have this straight...

    * If you grow up in Hawaii, raised by your grandparents, you're "exotic, different."
    * Grow up in Alaska eating moose burgers, a quintessential American story.
    * If your name is Barack you're a radical, unpatriotic Muslim.
    * Name your kids Willow, Trig and Track, and you're a maverick.
    * Graduate from Harvard law School and be President of the Law Review, and you are unstable.
    * Attend 5 different small colleges in 6 years before graduating, you're well grounded.
    * If you spend 3 years as a community organizer, create a voter registration drive that registers 150,000 new voters, spend 12 years as a Constitutional Law professor, spend 8 years as a State Senator representing a district with over 750,000 people, become chairman of the state Senate's Health and Human Services committee, spend 4 years in the United States Senate representing a state of 13 million people while sponsoring 131 bills and serving on the Foreign Affairs, Environment and Public Works and Veteran's Affairs committees, you don't have any real leadership experience.
    * If your total resume is: local weather girl, 4 years on the city council and 6 years as the mayor of a town with less than 7,000 people, 20 months as the governor of a state with only 650,000 people, then you're qualified to become the country's second highest ranking executive.
    * If you have been married to the same woman for 19 years while raising 2 daughters, all within Protestant churches, you're not a real Christian.
    * If you cheated on your first wife with a rich heiress, and left your disfigured wife and married the heiress the next month, you're a Christian.
    * If you teach responsible, age appropriate sex education, including the proper use of birth control, you are eroding the fiber of society.
    * If, while governor, you staunchly advocate abstinence only, with no other option-even in the case of incest or rape, in sex education in your state's school system while your unwed teen daughter ends up pregnant, you're very responsible.
    * If your wife is a Harvard graduate lawyer who gave up a position in a prestigious law firm to work for the betterment of her inner city community, then gave that up to raise a family, your family's values don't represent America's.
    * If your husband is nicknamed "First Dude," with at least one DUI conviction and no college education, who didn't register to vote until age 25 and once was a member of a group that advocated the secession of Alaska from the USA, your family is extremely admirable.

OK, it's all much clearer now.

Jack Weingarten"

Mac mini RAM Upgrades

I bought a Mac mini last week to use as a work computer--now that I've got some income I'm finally appreciating the idea of a "work expense". I didn't spring for the RAM upgrade since I felt pretty ripped off after doing that for the MacBook.

Apple only sells them with 2GB of RAM but I'd read that you could upgrade them to 3GB. I figured what the fuck I'll just buy the 4GB and stick it all in and see what happens. Well the good news is that--as you can see from the screen shot--it'll use all 4GB.

If you do try to do the home upgrade read through this RAM upgrade walk through but skip their advice for getting the case off and watch this video instead. It has a much better technique that resulted in zero scratches. Be really careful putting it back together though, I tried to rush that and bent some of the tabs in the back so it doesn't seat quite right now.

Dodged the Bullet Poker Ride

It's better to have an ex-fiance than an ex-wife so come help me celebrate not being married.

Date: Saturday, August 9, 2008 - 6pm until late.

Get your bike ride on. We'll be hitting up five bars all over the city. The idea of the poker ride is that you throw down $1 as your buy in to get your first card at the Good Foot (2845 SE Stark Street, Portland, OR).

We'll stop at four more bars all over the city and you get an additional card at each stop. At the end of the night the person with the best poker hand wins the pot. The ride ends at my house and there's a keg of homebrew.

I'll be throwing $50 into the pot to make it interesting--and still a whole lot cheaper than a wedding. You can swap cards with other riders if you want to make some kind of a deal, so bring your friends.

Media sprinting

So back in April I started talking to Keiran at about doing a media and files sprint... well it's finally happening. aaronwinborn in in Portland and dopry is going to be helping remotely. Aaron posted a great writeup on what we're hoping to accomplish so I'll blockquote at length:

Andrew Morton (drewish), Darrel O'Pry (dopry, remotely), and I are heading up a Media Code Sprint in Portland this week! Come help, in person or remotely, if you're interested in multimedia and Drupal! It has now officially started, and as I've volunteered to help keep folks updated, here goes...

First the reasons.

Number One: Better Media Handling in Core

Dries conducted a survey prior to his State of Drupal presentation at Boston Drupalcon 2008, and number one on the top ten (or 11) list of what would make THE KILLER DRUPAL 7 Release was "Better media handling".

Let me repeat that. Better media handling.

People have done really amazing stuff in contrib, but it is difficult (if not impossible in many cases) for developers to coordinate the use of files, as there is no good means for file handling in the core of Drupal. Thus, we have several dozen (or more) media modules doing some small part, or even duplicating functionality, sometimes out of necessity.

Migrating from D6 upload.module to filefield.module

So building on my last post for creating CCK fields, here's some code I whipped up to migrate from the D6's core upload.module to the filefield.module. This isn't general purpose code but might help someone else out. The catch is I'd built a video node with and was using the upload module to attach exactly two files, an image and a video. The new node will have separate thumbnail and video fields. If you'll be moving to a multi-value field this code won't work for you.

The gist is the same as before, setup your field for video and your field for images then export using:

<?php
var_export
(content_fields('field_web_video', 'video'), 1);
?>
and
<?php
var_export
(content_fields('field_video_thumb', 'video'), 1);
?>

Then roll that into an update function that also moves the file data around in the database. Code is after the jump.

Building the C2 Morse code trainer on OSX

I was trying to install Ward Cunningham and Jim Wilson's Morse code trainer on OS X and it looks like their .dmg file doesn't work on the new Intel machines. Here's what I did to get it to build.

Programatically creating a CCK field in Drupal 6

I spent some time today trying to figure out how to create a CCK field as part of an hook_update_N function. Unlike previous versions of CCK, in 6 it's very easy to manipulate the fields from code.

The first step is to create the field using CCK's UI. Once you've got the field setup the way you'd like it use PHP's var_export() to dump the contents of the node's field as an array:

var_export(content_fields('field_translator_note', 'feature'));

Using Growl to tail a log file

Mikey_p from the Portland Drupal Group pointed me towards a blog post he'd done on using Growl to watch for PHP errors. Always looking to put my fingerprints on something I decided to do the same but using PHP rather than Python.

The short version is install growlnotify then run the following from the terminal:

tail -n 0 -f ~/Sites/nm/logs/access_log | php -r 'while ($m = fgets(STDIN)) shell_exec("growlnotify -p 0 AlertTitle -m ". escapeshellarg($m));'
Obviously you'll need to use the right filename and change AlertTitle to something more to your liking.

Prefilling the ImageCache cache with wget

Today I needed to get Drupal's ImageCache module to regenerate a bunch of resized images. ImageCache doesn't create the images until a browser requests them and at that point the new image is saved to the disk for future use.

One way to generate the images would have been to just click my way through every page on the site but I'm way to lazy for that. So I used wget:

wget -r -nd --delete-after http://example.com

By using the recursive (-r) and --delete-after switches I was able to have it crawl the site and get all the images generated. Bonus points for running in on the server so that the transfers were via the loopback interface so the transfer didn't count against the monthly bandwidth limit.

News round up

I don't post news items like I used to a few years back but there are two things in the news today that I've got to comment on.

The first is GM's announcement that they're closing four North American plants manufacturing SUVs and looking at selling the Hummer brand so they can focus instead on more fuel efficient cars. The NY Times has a pretty good article on it but the GLARING OMISSION is that they don't mention anything about the CAFE standards. The American auto industry and their Republican lackeys have been fighting increases in the fuel efficiency since 1999. It seems like the US auto execs were the only people who didn't see Peak Oil and the end of the SUV coming... sure they'll tell you they've got hybrid SUVs the only problem that you can't buy them, they're just a PR device. I'd love to see some shareholder action to clean house and put some execs in place that have half a clue.

The second is Hillary and her Terminator impression. I'd defended her right to stay in the race until all the states had voted--even though it was obvious back in February that she wasn't going to be the nominee. But as of tonite this has gotten silly. Obama now has the delegates but she still can't quite let go and concede. Shit, I'll donate $20 to help pay off her campaign debts if she throws in the towel this week.

DrupalCampPDX

drupalcamppdx keynote I took a break today from my work at Sticky building a website for a major sports apparel company that cannot be named, for DrupalCampPDX. Ben Kaplan and I did the keynote presentation this morning which was definitely an honor. I followed that up with a panel on best development practices which was a bit unplanned but went really well. This afternoon I'm doing a presentation on Views2 and Panels2, I'm a little freaked out on that since I've done zero preparation at this point.

Drupal6: Display block for one node type

This is a little snippet I came up with to get a block to show up on a single node type:

<?php
$menu
= menu_get_item();
if (
$menu['path'] == 'node/%' && isset($menu['page_arguments'][0]->type)) {
  return
$menu['page_arguments'][0]->type == 'story';
}
?>

It uses the node type stored in the menu system so you don't have to match arg(0) etc.

About that experience thing...


"There was a saying around the White House that if a place was too small, too poor, or too dangerous, the President couldn't go, so send the First Lady."

And Sinbad... and Sheryl Crow... and the First Daughter? Yeah, let's talk about experience and judgement some more.

Spring Break

Almost done with classes for the term. Got to do the presentation for my Capstone class tonight. I think next weekend I'm going to try to get down to Reno for the StickerGuy 15th Anniversary. I worked at StickerGuy in Chris McClendon place while he when went on tour back in 2000-something. It wasn't a good experience at the time but as Mr. Bynum always said:

"You either have good times or good stories."

And, at this point, they're good stories. So it'd be good to get down to Reno, see some old friends and bands that I hardly remember. I've gotta say that I'm most excited about seeing The Atomiks, The Scurvy Bastards, and Dragonfire -- the first two because they're great bands the latter because of this video I found on StickerGuy's MySpage:

Update: I totally forgot to mention that my little brother Charles and his friends Petar and Chuck are coming up this weekend. Petar wanted to see Agalloch play tomorrow night and I owe him big for helping me find a place to stay in Boston during DrupalCon. Should be a good time.

Getting PHP + GD working on Leopard (aka recompiling everything)

Last Updated: Sept 29, 2008
Here's my writeup on how to recompile PHP for Leopard to get GD working so you can use use Drupal. The basic plan is recompile Apache and PHP from source. It may totally bork your system, I'm just writing it down so the next time I need to do this I can remember what I did. I wish I could give credit to all the places I stole bits from but I didn't do a good job of keeping notes early on.

Every time Apple releases a security update it seems to end up overwriting PHP or Apache and I end up reviewing these instructions. Since it's my personal guide I end up modifying it to match my current needs. For example, the last big change was adding in old mysql extension and the new PDO-mysql extension. The upside for you, kind reader, is that means the instructions are generally up-to-date. The down side is that when you come back in two months and try to repeat part of this it might not work correctly because I added some earlier steps that you'll need to complete.

for you, a photo

me as drawn by spaceman a long time ago

FreeTheAirwaves.com

User login