“cd: 1: can’t cd to ~”

02 April 2012 | By Ian in Development, PHP | No Comments Yet


Are you seeing messages like the following in your web server’s error logs?

cd: 1: can't cd to ~
cd: 1: can't cd to ~
cd: 1: can't cd to ~
cd: 1: can't cd to ~

Though it lacks a timestamp, the reason for the error is somewhat self-explanitory–somewhere there is code trying to execute the command “cd ~”. However, the source may be hard to track down. If you’re using the AWS SDK for PHP, I have your answer:

You haven’t created the config file config.inc.php either in the root directory for the SDK (/usr/share/php/AWSSDKforPHP/ on Ubuntu if installed from PEAR) or in your home directory. The file sdk.class.php looks in the SDK root folder for the config file. If it isn’t found there, it checks for $_ENV['HOME'] and $_SERVER['HOME']. If neither of those variables are set, it tries to execute the command “cd ~ && pwd”. Of course, there’s a very good chance the apache user won’t have a home directory, so this command will fail.

The fix is simple: Create the config file or at least create an empty file that it can open up and be done with.

In our environment, the config file is not desirable because we populate all of the required variables through our built-in site config. I just ran “touch /usr/share/php/AWSSDKforPHP/config.inc.php” and the problem went away.

Note: This information is valid as of SDK version 1.5.3 in April 2012.

Tags:

Let’s Both Pretend I Read the Agreement

18 November 2011 | By Ian in Opinion, Rants | No Comments Yet

By clicking the "I Agree" button, I acknowledge that I want this message box to go away and that I don't give a hoot about the rules you're trying to put on my use of something you created.The EULA. It’s an interesting beast. On one hand, software makers have the right to say you cannot decompile their code and resell parts of it on your own. On the other hand, the rights granted to software makers and the limitations placed on end-users are often egregious, ludicrous, contradicting, and at the very least inscrutable.

I propose we break this down into three easy-to-digest parts:

What you want from me

First, a simple list of personal information that the app will collect and use just like with Facebook Apps or the Android Marketplace. This process is simple and well precedented. It covers the publisher’s backside and informs the consumer. Win-win.

What I get from you

Second, simple list of rights a user has with the software. How many copies can they install? Until what date is their license valid? This stuff is already baked into the legalese, but here you can make it easy to digest. At the same time, leave out the crap we already know such as “You can use this CD burning application to burn CDs.”

What I give up in return

Finally, provide a succinct and realistic outline of things the user should not do with the software. This will be the hardest part of all to streamline. Look, nobody is planning on manufacturing nuclear weapons with iTunes. In fact, let it be implied and obvious that if you’re breaking the law, your license is invalid and you are not authorized to use the software. Don’t be like Adobe and insist I cannot install their Air player on any machine that shares files with other machines. In today’s modern computing world, almost every computer out there shares files.

Of course, this is all naive and wishful thinking. So perhaps we should spend our efforts developing an app that automatically clicks the “I Agree” button. To whomever creates this app: Please lead by example and put a reasonable EULA on it.

When Can I Reuse This Calendar (dot com)

11 November 2009 | By Ian in Development, Hobbies, Made by isnoop, Misc, PHP, Related sites, Sites of Interest | 5 Comments

My wife dug up a 2008 calendar still in the shrinkwrap and it got me thinking… When can I reuse this calendar? Well, I had a spare hour and $6.99 to register a domain, so I whipped out this little site:

http://whencanireusethiscalendar.com/

Now you can go digging through that chest of crap from the 1990s and pull out your favorite cute puppies calendar. In 2010, you can re-use calendars from 1999, 1993, 1982, 1971, 1965, 1954, 1943, and 1937.

Flying Notes – Hawaii Big Island

04 September 2009 | By Ian in Aviation | No Comments Yet

Today I took a 2.7 hour flight on the Big Island of Hawaii. Emily was riding in the back seat and the CFI was a gent named Hawk from Hawaii Flight Academy.

The flight was gorgeous scenery of course, but I left most of the sightseeing and photo taking to Emily as I handled the controls.

The weather was exceptionally good. We were able to see all three mountain tops when most tours are lucky to see one or two from the coast. Our counter-clockwise trip took us over the active lava flows where Hawk took the controls and flew lower Part 136 altitudes while Emily and I ogoled the natural wonder.

After that, I took the controls again and we headed toward Hilo, brushing the underside of broken clouds around 3,000. On the far side of Hilo, we angled upslope to avoid incoming rain, but then I let hawk take the the controls and take us on the more scenic trail through the rain and low/no visibility.

Coming around the north side, the skies were clear, but we got a bout of light turbulence. Emily was mildly shaken, but I did a very good job holding altitude within 50 feet of 1,500. The downdrafts downwind of the saddle caught me off guard and I had to take decisive action when I noticed we had glided from 1,500 down to 1,100.

I told the instructor early on that I’d want him to do the landing if the crosswinds were too strong. After all, the most important things in my world were riding in that plane. When we set up for a long final at about 20 degrees left of the runway, we agreed that the landing would be doable.

We were following a light plane doing a touch and go and we were some distance ahead of a larger jet. I maintained centerline fairly well, but flared too much and ballooned the touchdown. I made a good stabilizing re-approach at wingspan height, adjusting for crosswind, and set it down with enough room to take H taxiway back to the fuel station.

This is also the first time I was directly involved in a refuel. This isn’t your Chevron filling station. Well, okay, it was *a* Chevron filling station, but the everything involved was much beefier.

Check out more photos as well as a geotagged photo map from our trip.

Flying notes – Landings lesson 1

22 August 2009 | By Ian in Aviation | 7 Comments

Today I flew 1.3 hours with John La Porta. This is my third lesson with him and my 6th overall. Aviation has been a dream and a goal of mine since I was very young and I decided it was time to realize that goal when I met a friend who happened to be a CFI (certfied flight instructor).

After preflight, I asked John if we could focus on landings today. He agreed and asked me to tell him what I know so far about landing a small craft. After discussing for several minutes, he gave me the list of steps we would take during a landing which I jotted down.

On our first go round, we came around too steep so my instincts told me to nose up. It was on this landing that I got my first real lesson on flying “the back side of the curve.” The little Cessna C-150 took the bounce surprisingly well. We settled it down and then re-applied full throttle to take off again. Surprised that my sucky landing didn’t snap the wings off, we climbed albeit a bit unsteadily.

John took us out over Redmond so we could discuss landings further and get me more proficient at firm rudder control. Previosly, I was unaware of the amount of spring in the rudder controls. You can (and should) depress both pedals simultaneously a few inches to keep the rudder from being blown about.

We also simulated several patterns. I continue to be impressed by. The tight turning radius this thing is capable of in slow flight. I need more hours to ge used to it’s capabilities.

We returned to BFI for four more landings. Each one was incrementally better, despite a notable crosswind.

It was very comforting to see the runway come into alignment and realize that I am naturally crabbing 15 degrees to maintain centerline without any effort.

My final landing stuck fairly well. I was mostly able to let go of my instinct to control altitude with the nose and instead use throttle with angle of attack controlling airspeed.

I have a long way to go, but this was perhaps the most instructive lesson to date.

(apologies for typos and grammar. Written on iphone, editing later on)

Return of the Rum Runners

04 August 2009 | By Ian in Misc, Opinion, Rants, The Emerald City | No Comments Yet

Liquor bottlesLast weekend Washington state just upped its liquor prices an average of 13% per bottle in a bid to help fill its 6 billion dollar budget gap. The estimated proceeds from the increase in liquor tax should cover about 1.3% of the budget shortfall. The problem is, I don’t think they will take in nearly as much as they have estimated.

It hasn’t even been a week and I’m already hearing several people talking about making booze runs down to Portland, Oregon. A casual web search reveals some insightful answers.yahoo.com advice suggesting there is no peril in shuttling copious quantities of booze across state lines, but I remain dubious. However, with over 75% of the cost of a bottle now profits to the state, it will become harder for people to resist a little bit of sales and use tax evasion.

I hate to say it, but it will probably take a horse’s ass to spearhead an initiative to reduce state liquor taxes. It can’t be many more years before people start whining about the ever-increasing rates in general and I know someone will come riding in on their white horse to rescue the taxpayer’s hard-earned dollar once the general consensus agrees that the economy has sufficiently recovered.

Photo credit Thomas Hawk

Curtains for Theater Listings

21 July 2009 | By Ian in Development, Google, Hobbies, Made by isnoop, Site Features | 14 Comments

no_popcornThis morning I received a call from a gent with a Boston accent. He indicated that he represents a firm that is displeased with some data I’m using on isnoop.net. According to the caller, my theater listings page is using his client’s intellectual property and I’m not properly licensed to do so. The lawyer seemed nice enough. Perhaps I should have kept him on the phone longer so he could tick up some more billable hours…

Like some other things I’ve developed, theater listings was a simple service I wrote for myself to clean up an otherwise cluttered interface and make the data available in my favorite feed reader. Over the years, many people have written with questions and thanks regarding the page. Thank you to everyone who used the service. I hope you might find some of my other tools just as useful.

As of now, the theater listings page is closed. If you still want this information in your web browser, check out Google’s movie listings service. For you feed reader junkies, Yahoo Pipes is widely known as a useful service for turning any web page into an RSS feed.

I’ll investigate the possibility of re-sourcing the data, but don’t get your hopes up. Also, for those who are already firing up their email clients to ask me for the source code, hold your horses. I’ve been working up a post on ethical screen scraping and now I can finally share it without being hypocritical. I won’t share the source, but look forward to an interesting and useful guide to capturing and reusing data on the web, including some advice that should help prevent you from getting your own C&D.

People Use FeedSifter.com?

19 July 2009 | By Ian in Development, Made by isnoop, PHP, Related sites | 3 Comments

rssAs with most of my web toys, FeedSifter.com started off as a tiny tool that served a very simple need I had. Assuming a handful of people might have the same need, I publish most of these utilities and some of them actually manage to become fairly popular.

FeedSifter is a simple service that allows you to filter an RSS or ATOM feed for various keywords. There are many other services out there that do this same thing, but this site is anonymous, uncluttered, and intuitive–exactly what I wanted at the time.

Looking at the traffic stats today, I’ve found that feedsifter.com managed to become fairly popular while nobody was looking. Over the past 8 months, daily traffic has been steadily increasing and it is fast approaching 2,000 requests per hour. That’s a pleasant surprise and a good indication that I should put some effort into finishing those final few features I never got around to implementing years ago.

Firefox’s Refreshing Source View

25 June 2009 | By Ian in Misc | 3 Comments

Did you know you can trigger a refresh while viewing the source of a page? This feature has been around since the dawn of Firefox 2.0, but it is still unknown to many web professionals.

All the standard keyboard shortcuts work, including the F5 and Ctrl+Shift+R for a cache flush. Give it a try on your favorite dynamic page.

Thank You, iPhone!

22 June 2009 | By Ian in iPhone, Sites of Interest | 1 Comment

Thanks to Apple shipping everyone’s iPhone to be delivered last Friday, my package tracking website Boxoh.com saw double the number of absolute hits and six times the number of Adsense impressions. That’s a lot of iPhone recipients mashing F5 all day long.

Let’s hope more of them turn into return visitors. I do have several features in the works to help make the site more compelling for regular users and one-timers alike.