Posts by: bsterne

Removing file extensions with sed May 12th, 2010

I need the following sed one-liner periodically, and I thought it was useful enough to share here. Other versions I’ve seen chopped off everything after the first dot, which doesn’t work for files with a dot in the basename. This one does:

sed s/\.[^\.]*$//

Sample Usage:

bsterne@zodiac:~$ ls /video | sed s/\.[^\.]*$// | head -n5
2001: A Space Odyssey
40 Year Old Virgin, The
A Bronx Tale
A Clockwork Orange

Wildflower Triathlon 2010 May 4th, 2010

I completed my first triathlon this weekend! I raced in Sunday’s Wildflower Olympic Distance Triathlon and placed 85th out of 224 in my age group. I was very happy with my performance and met or exceeded all my goals for the race.

It was an awesome experience all the way around. The environment is fun and festive with live music and food and race equipment vendors, all the athletes and volunteers are super supportive of each other, and the rush of finally getting to the finish line was indescribable. I’m hooked, for sure.

WordPress and Content Security Policy April 12th, 2010

Lately, I have been implementing the server logic for Content Security Policy in WordPress. I was very pleased to see that the WordPress community opened up the tracking bug for this feature around the time we first blogged about it. One of the neat things about working for Mozilla is that contributions to other important open source projects are treated as valid, valuable uses of our time.

Today, I posted my first patch to WordPress, still a work in progress, which adds an administration panel (see below) for configuring CSP. One of the features I’m rather happy with is “Suggest Policy”, which analyzes the content in the user’s blog and recommends a policy based on the content types and sources it finds.

Next I’ll be working on moving the remaining inline script into external script files. Stay tuned for further updates!

Growing Veggies at Home April 10th, 2010

Update: 2010-06-20

The planters are doing great so far. I love how the squash and zucchini put up the giant sun catching leaves and send the vines bubbling over and onto the ground.

In progress...

Last year, I built some sub-irrigated planters (SIP) using the excellent 2-bucket design from Green Roof Growers. The concept is based on the commercial product, Earthbox, but costs far less to build at home. The basic idea is that the plants wick up just the right amount of water from the reservoir underneath. The design includes drainage holes at the top of the reservoir that prevent over watering, so it’s really easy to keep keep plants happy using this system. They really seem to thrive when they can drop their roots down through the screen and into the water below.

Completed planter

Last year we had cherry tomatoes and some mixed greens, which were delicious but seemed to really attract a lot of aphids. This year I added a third SIP and we’ve planted heirloom tomatoes and cucumbers:

Tomatoes and cucumbers

…as well as some snap peas that are doing really well so far:

Snap peas

I also built the wooden boxes the planters are sitting in to give them a nicer aesthetic and to protect them from the sun. This project has been really fun and is part of a larger effort on my part to make things myself.

A-Star (A*) Algorithm in Python – Update January 25th, 2010

Since there have been many requests over the years for the source code referenced in my A-Star (A*) Algorithm post, I decided to share it. I did a bit of refactoring too, as I have learned some neat things about Python in the years since I wrote that post, like list comprehensions.

A cautionary note to undergrad CS students (who I can only assume are the requestors): CS professors are pretty good at catching cheaters, so learn from others’ code, but write your own.


Content Security Policy – Preview Builds October 1st, 2009

I posted this over at the Mozilla Security Blog but wanted to share it here as well. I am excited to report that Content Security Policy is available for testing! We’ve been working hard on implementing the CSP spec and now the new features are ready to be put to the test.

I would like to encourage any interested parties, whether web security researchers or website administrators, to head over to Mozilla Try Server and grab a preview build of Firefox with CSP enabled:

Mac OS X: 1256079015-macosx.dmg
Linux: 1256079015-linux.tar.bz2

Once you have it, you can test the core functionality of CSP at the demo page I set up on my Mozilla web space. There is a lot more information about this project there and I look forward to any feedback you have to share with me.

East Bay Psychotherapist
Licensed Clinical Social Worker provides psychotherapy and counseling services for couples and individuals in the East Bay Area.