Subscribe

172

Fans

ON FACEBOOK

Search

Email

  • Memphis, TN 38103 U.S.A. Otto 240cf86e-5cad-11dc-8314-0800200c9a66

Facebook

Amazon

Buy Otto a Beer

Currency:

Amount:

Website(Optional):

Get Otto a Gift

My Amazon.com Wish List
Text

9 Feb 2010-02-09 11:24

Don’t include wp-load, please.

Time for Otto’s general griping: WordPress plugin programming edition.

Here’s a practice I see in plugins far too often:

  1. Plugin.php file adds something like this to the wp_head:
    <script src='http://example.com/wp-content/plugins/my-plugin/script.js.php'>
  2. Script.js.php has code like the following:
    <?php
    include "../../../wp-load.php";
    ?>
    ... javascript code ...
    

The reason for this sort of thing is that there’s some option or code or something that the javascript needs from the database or from WordPress or whatever. This PHP file is, basically, generating the javascript on the fly.

Usually, the case for this turns out to be something minor. The code needs the value from an option, or some flag to turn it on or off. Or whatever.

Problem is that finding wp-load.php can be a bit of a chore. I’ve seen extreme efforts to find and load that file in plugins before, including searching for it, examining the directory structure to make decent guesses, etc. This sort of thing has existed even before wp-load.php came around, with people trying to load wp-config.php themselves and such.

But the real problem is simpler: This is always the wrong way to do it.
Read the rest of this entry »

Tags: , , , , ,
Shortlink:

Posted in Geekery, General Spew, Hackery, Programmery | 47 Comments » -

Text

21 Dec 2009-12-21 14:08

Twitter Geolocation

Heard of geotagged tweets yet? Not surprised, a lot of my friends seem to have not caught on to it, so I’m writing this in a possibly futile attempt to get them to try it out.

How to add your location to your tweets

1. Turn on Geotagging. To do this, go to your Twitter settings page. Down under the “Location” section is an option to enable geotagging. Turn it on.

Twitter Settings

2. Get a Twitter client that supports Geotagging. These are generally mobile applications. Tweetie 2 for the iPhone added support for it in 2.1. Several other clients support it as well. Find one.

3. Turn it on in your client. How you do this depends on the client, but it can usually be enabled on a per-tweet basis.

Here’s an example of how it works and looks in Tweetie 2 for the iPhone.

First, you type in a new tweet, and pull open the drop down.

Next, you enable the geotag feature, and you'll see a little red pin appear.

You'll see little maps on tweets with locations attached to them.

Click on the map icon for greater detail.

You can do more with your Twitter location too. For example, this website will read your twitter feed and get your latest location, then send it over to Fire Eagle, which is Yahoo’s location service. Fire Eagle can do all sorts of things, but basically it’s just a service that stores your location for other programs to use. So if you want to display your location on your blog, or on Facebook for your friends to see, or anything else you can think of, you can do that, using nothing more than your already existing tweets.

Tags: , , , , ,
Shortlink:

Posted in Geekery, General Spew, Linkery, Thingery | 1 Comment » -

Text

17 Nov 2009-11-17 10:14

Why I won’t give you my phone number on Facebook

Why won’t I give you my phone number on Facebook?

Because if you knew what you were doing, you wouldn’t need to ask me for it.

I was reading through my normal morning selection when I ran across this article on TechCrunch detailing how they tricked a bunch of people into giving up their phone number openly.

People, this is unnecessary. Why are you falling for this kind of nonsense?

If you lose your phone, here’s how to get those numbers back. More to the point, here’s how you can get your number to your friends *without* having them ask for it and without it being public knowledge.

Read the rest of this entry »

Tags: , , , ,
Shortlink:

Posted in General Spew, Linkery | 7 Comments » -

Text

21 Sep 2009-09-21 16:14

How to find a backdoor in a hacked WordPress

Over here, Jorge Escobar is writing about how he got hacked with the latest version of WordPress. After some minor back and forth on FriendFeed, I got him to do a search which found a malicious backdoor he might not otherwise have found.

In so doing, it occurred to me that most people don’t keep up with the world of WordPress in the way I do, and so have not seen nearly as many hack attempts. So I figured I’d post my little contribution, and show people how to find hidden backdoors when cleaning up their hacked sites.

Non-technical users can safely ignore this post. :)
Read the rest of this entry »

Tags: , , , , , , , ,
Shortlink:

Posted in Geekery, General Spew, Hackery, Linkery, Programmery | 19 Comments » -

Text

21 Sep 2009-09-21 13:03

Waze – Free iPhone Directions Application

Playing around this weekend, I discovered a neat and fun little app for the iPhone.

A lot of new apps have came out for the iPhone lately that are based around driving directions. TomTom came out with theirs for $100, and Navigon is another popular one that runs $90. But, if you want to try out something a little different, this one is free.

iPhone image

Waze is a free driving directions app, with a twist. Basically, the maps on it are “incomplete”. That is, they’ve got the map data, but like all maps, the data is inaccurate. So, to get the data to be better, they’re enlisting your help.

How do you help? Simple. You use the app in the car, then drive around. As you do so, the GPS will be reading your location and noting that there is indeed a street there. It makes it kinda fun to confirm streets in this way since a little Pac-Man like figure appears, eating dots on the map where you are driving, and giving you “points”. The points aren’t useful for much, except a ranking system with everybody else using the app, but it’s fun nevertheless.

So what else? Well, obviously it’ll do driving directions. However, when I tried it to get to my friend’s place at Cooper-Young fest this last weekend, it was laughably wrong. It suggested an 8 mile trek through ridiculous parts of town for no reason. I drove there the normal route instead, letting it complain that I was “off route” all the way and listening to the Waze-pacman gathering up the points as he munched his way down the road. However, something odd happened then. On the way back, when I turned it on, it knew that route. Investigating today, I’ve found that it really doesn’t like to route people on routes that haven’t been “confirmed” yet very much. So, since I’d confirmed that route already, it picked it for my way home.

But there’s a bonus to all that. By confirming the route, it’s getting more than street maps. It’s also getting average speeds. So it can use that information to give optimal routes, knowing how fast each street tends to be.

iPhone Event Reporting

You can even more than that though. Along the way, you can report events too.

An event is like an auto accident, or a speed trap. Whenever you see one of these, you can touch the report button and report one quickly. If you’re totally stopped in traffic, then you can also type in a short message (it won’t let you do that while moving), and the message will instantly be sent, where other drivers (and their iPhone’s) can see it. Those drivers will then get routed a different way, possibly saving them some time.

Or, even better, somebody else reports a problem, and you get to save some time.

Downsides to the app: Battery life. Like any other GPS app, it sucks the battery right down. You’ll need a car charger to run the thing. Probably a quality iPhone mount too. It does do landscape mode as well, and hidden down in the options is a “3D mode”, which makes the map lay back and look like the more expensive iPhone driving apps, if you prefer that sort of thing. The 2D map is easier to read, to me.

From what I’m reading, Waze has only been around a month or so, and not many people are using it. As far as I can tell, almost nobody in Memphis is using it, since almost all the roads are unconfirmed. But it would be pretty neat if everybody driving around was sharing data like this, what with Memphis traffic being what it is. I sure wouldn’t mind getting routed around half the crap I see on the streets around here.

If you’ve wanted to try out a driving directions app without spending $100 or so, then you cannot beat free. So I highly recommend it. I’m using it all the time now.

Tags: , , , , , , , ,
Shortlink:

Posted in Geekery, General Spew, Placery, Thingery | No Comments » -

Text

26 Aug 2009-08-26 12:52

Bob Dylan to be new voice of GPS system

According to the Telegraph, Bob Dylan has been approached by multiple GPS manufacturers to be the voice of their GPS system.

While this is ludicrous on the face of it (having listened to Bob for many years, let’s face it, clarity ain’t his strong suit), I find that the best part of the whole story is what people have to say about it. Some of the comments on Digg about this development are truly the greatest remarks I’ve ever seen.

There’s the predictable ones about his clarity, or lack thereof:

“tuhhhhh lef at the lighhhhh”

What?

The natural comparisons to other celebrities doing GPS directions (such as Arnold Schwarzenegger in this case)

“Dis Twaffic sucks. GET TO DAH CHOPPA!”

Or Alan Rickman, which had this as my own contribution:

Hello.

This is

Alan Rickman.

You need to take

a left

in

two hundred

yards.

Do not disappoint me.

And this one:

BILLY MAYS HERE. TURN RIGHT AHEAD POINT 1 MILES.

Or an R. Lee Ermey one:

“I SAID RIGHT YOU WORTHLESS WASTE OF SHIT, I HAVEN’T SEEN DRIVING THIS BAD SINCE I LET MY WIFE DRIVE”

“IF GOD WANTED YOU ON THE TURNPIKE HE WOULD HAVE MIRACLED YOUR ASS ON THERE BY NOW.”

Of course, reworked song lyrics:

Come gather round people wherever you are,
And thank you kindly for using on-star,
And I will help you to maneuver your car,
For the trip you are arranging!
So don’t miss that turn,
And don’t go too far!
Oooh, your destination is a-changing!

Even a pretty decent meta reference comment:

Well, in these modern times, I’m not sure this would be street legal. I mean, when you’re going down highway 61, I’d imagine you’d be fine. You and John Wesley Harding can gaze at the Nashville skyline all you want while using the GPS. But when you’re on those back roads, the system might miss some railroad tracks, leaving you stranded with a slow train coming. If you don’t know to move, oh mercy, there’s going to be blood on the tracks. I can see why one would desire such a GPS, though, as they’ve saved many people from having to drive in circles until the new morning before finding their destination. Well, I guess the times, they are a-changin’, and when you’re out on the road, under a blood red sky and trying to bring it all back home, a GPS will definitely keep you from freewheelin’ for too long.

Digg comments are often a wasteland of human misery and suffering (not as bad as YouTube comments, but close), however this one is pretty good and worth checking out.

Tags: , , ,
Shortlink:

Posted in General Spew, Linkery | No Comments » -

Text

25 Aug 2009-08-25 11:56

Google Maps traffic… it needs work.

I always wondered how Google Maps knew traffic conditions. Today, there’s a blog post where they explain it a bit better.

That ain't on an iPhone...

That ain't on an iPhone...

Basically, they simply have all the phones running Google Maps with GPS send back data as to a) where they are and b) how fast they’re moving. Both of which GPS gives you more or less by default.

It’s a clever idea, and I like it, but it fails in a couple of major ways, IMO.

Firstly, when I use Google Maps on my phone, I tend to not leave it open. Google Maps is fine, but it’s not a very good navigation system. It’s just a map. A real navigation app is worlds better. I recently got Navigon Mobile Navigator on the new iPhone, and it’s pretty slick. Thinking about a dashboard mount for it now, actually.

Secondly, this system relies on a lot of people having Google Maps open and running and sending back data. If nobody with Google Maps running has been on your street recently, you get no information.

What Google really needs to do is to open it up as an API. Let other navigation system manufacturers both send and receive traffic data from the Google Maps system. It doesn’t have to be complex.

Any good navigation app knows your location and speed, so a simple way to send that info could be made easily enough. The problem, of course, is allowing third parties to use the data.

Google Maps works in layers of images, which is one of its major shortcomings, IMO. The street views are images. The terrain are images. Just big sets of tiles that get displayed next to each other. And I’m almost certain that this traffic thing is just another set of images they’re generating or updating. For navigation providers that use 3d views and such, they don’t need that stuff in the form of images, they need it in the form of data. What streets are busy? How can that information be used to improve the navigation? Etc.

Google is generally pretty good at opening up their APIs to third parties. However, they’re generally not good at providing data in different forms. Most of their APIs are “this is what we use, if you need something else we don’t have it” sort of thing. Hopefully, the Google Maps team will see the light here and realize that to get good data, you have to give good data, and start pushing in that direction. Because open traffic data would be pretty cool for everybody.

Tags: , , , , , , , ,
Shortlink:

Posted in Geekery, General Spew, Linkery, Programmery, Thingery | 1 Comment » -

Text

20 Jul 2009-07-20 12:36

How to Taste and Describe a Beer

It occurred to me that some of my friends don’t really know how to taste and describe beer properly. Even my wine friends, descriptive as they are, are pretty poor at describing beer. The methods of tasting are not all that different, really.  There’s more of a snobbery surrounding wine and some of people are loathe to come down to the beer world, even though we beer snobs are far bigger jerks. :D

But I figured that I’d try and educate some people on the proper way anyway. What the heck, eh?

There’s four steps to tasting a beer. To make it fun, let’s make them all start with the letter S. :)

1. See.

When a beer is poured it produces a foamy head. This head usually dissipates quickly, leaving behind a bit on top called the “lace”. This same lace remains on the sides of the glass when drinking the beer. Hold up the beer and take note of the color as well. These are all descriptive aspects that help in understanding of the beer.

  • Color describes the malts used, or the brewing process.
  • The amount of foam describes the carbonation.
  • How it dissipates describes the thickness or heavyness of the beer.
  • The amount of lace describes the freshness of the beer, the freshness of the hops used.

2. Swirl.

Yes, damnit, swirl it a bit, like you would a wine. This agitation pulls out the scents and carbonations from the brew. It also tests the head retention, which gives you more info about the lacing.

3. Smell.

Smell the beer, obviously. Something like 80-90% of taste is actually smell. It’s the most important part of tasting. Breath deeply of the beer through your nose and then, yes, through your mouth as well. The combination of these two gives you the best experience of the brew. Describe the scents you have. Wheat beers, for example, are often fruity or citrusy, usually because the brewer adds these types of ingredients specifically. Hops have a distinct odor, of course, but different types of hops smell different. Cascade hops (the most common type) smells completely different from fuggle hops, for example, and they are used in completely different types of beers.

4. Sip.

Take a sip, swirl it around your mouth a bit. Don’t swallow right away, let it warm up a small amount. Important bits to remember here:

  • Mouthfeel. You see this one a lot in beer circles. What does it feel like? What’s the texture of the beer?
  • Consistency. Does the beer change a lot as you taste it? From beginning to end of glass even.
  • Breathe out while the beer is in your mouth. This increases the flavor experience. Really. Google “retro-olfaction”.
  • What does it taste like? Salty? Bitter? Sweet? Acidic? Oily? Fruity? Beer can taste like just about anything, think of what it’s similar to. Describe what it would go with.

Now, once you’ve done this, describe the beer. Here’s an example for PBR:

Clear golden color, with a 3/4 inch thick white head, which quickly reduced to a minimal thin lacing. Pleasant but subdued scent, mostly sweet lagered malts. Slight amount of grain flavors, with subdued grassy hop undertones. Minimal bitterness. Somewhat fizzy in apperance, but only lightly carbonated flavors. Crisp and dry mouthfeel, with a slight hint of oilyness when warmer. Overall clean flavor, very light malts used. Good session beer, would be excellent with stronger beef or spiced chicken flavors.

Simple.

Tags: , , , , , , , ,
Shortlink:

Posted in Geekery, General Spew | 3 Comments » -

Text

17 Jul 2009-07-17 14:16

The media are a bunch of idiots.

I’m getting really annoyed with all the hubbub over the latest Tennessee gun law. You know, the one similar to the one passed in Arizona recently? TN and AZ are getting singled out as places that allow guns in bars.

The problem is that it’s not true.

That’s right, it’s just not true. Jon Stewart got it wrong. Stephen Colbert got it wrong. Every major media outlet talking about “guns in bars” got it 100% wrong.

You can’t carry a firearm into a bar in Tennessee. Period. It’s simply a lie.

To understand why it’s a lie, let’s examine the facts. Here’s a section of the TN State Code, before the law changed:.

39-17-1305. Possession of firearm where alcoholic beverages are served.

(a)  It is an offense for a person to possess a firearm within the confines of a building open to the public where liquor, wine or other alcoholic beverages, as defined in § 57-3-101(a)(1)(A), or beer, as defined in § 57-6-102(1), are served for on premises consumption.

(b)  A violation of this section is a Class A misdemeanor.

(c)  The provisions of subsection (a) shall not apply to a person who is:

(1)  In the actual discharge of official duties as a law enforcement officer, or is employed in the army, air force, navy, coast guard or marine service of the United States or any member of the Tennessee national guard in the line of duty and pursuant to military regulations, or is in the actual discharge of duties as a correctional officer employed by a penal institution; or

(2)  On the person’s own premises or premises under the person’s control or who is the employee or agent of the owner of the premises with responsibility for protecting persons or property.

For those of you that can’t read legalese, here’s a quick translation:

  • You can’t have a firearm in a place that serves alcohol.
  • Doing so is a misdemeanor.
  • Exceptions to this rule:
    • If you’re police or military, that’s okay.
    • If you own the place or are a security guard hired by the owner, that’s okay.

Pretty simple, right? No guns except for the obvious exceptions.

Now, look at the text of the new law… Basically, it adds a new exception. Here’s the text itself:

(3)
(A) Authorized to carry a firearm under § 39-17-1351 who is not
consuming beer, wine or any alcoholic beverage, and is within the confines of a
restaurant that is open to the public, serves alcoholic beverages, wine or beer,
and is not an age-restricted venue as defined in § 39-17-1802.
(B) As used in this subdivision (c)(3), “restaurant” means any public
place kept, used, maintained, advertised and held out to the public as a place
where meals are served and where meals are actually and regularly served, such
place being provided with adequate and sanitary kitchen and dining room
equipment, having employed therein a sufficient number and kind of employees
to prepare, cook and serve suitable food for its guests. At least one (1) meal per
day shall be served at least five (5) days a week, with the exception of holidays,
vacations and periods of redecorating, and the serving of such meals shall be the
principal business conducted.
(C) This subdivision (c)(3) is subject to the provisions of § 39-17-1359,
permitting a property owner to post notices on such property prohibiting firearms.

Still don’t get legalese? Well, let’s break it down more simply:

First, 39-17-1351 is the section of the law that defines Handgun Carry permits. So that’s what that is talking about.

Next, 39-17-1802 is part of the new non-smoking law. Wait, what?

Recently, TN banned smoking in all restaurants and bars. However, they added an exception. They defined an “age-restricted venue” as a place that only allows people in who are 21 and older, all the time (instead of just at night or something). These places can allow smoking. Obviously, a lot of the bars did this, since large parts of their clientle smoke. However, many restaurants did not. These places make most of their money from food, they can’t ban families from coming in.

Basically, this definition created a rather obvious separation between a “restaurant” and a “bar”, without actually making any definitions along those lines. “Bars” are 21 and up. “Restaurants” are not. There’s exceptions of course, but for the most part this is the way it went down.

Now, reading that law again, you’ll find that it says “and is not an age-restricted venue as defined in 39-17-1802″. That part matters. Remember, “bars” are age-restricted venues in order for them to allow smoking in the place.

So this new law adds a new exception. Basically you now have this:

  • You can’t have a firearm in a place that serves alcohol.
  • Doing so is a misdemeanor.
  • Exceptions to this rule:
    • If you’re police or military, that’s okay.
    • If you own the place or are a security guard hired by the owner, that’s okay.
    • If you have a carry permit and are not drinking and the restaurant is not age-restricted, that’s okay.
      • If the owner is okay with it too and doesn’t post a sign about it.

That not age-restricted bit means, basically, “and it’s not a bar”. If you prefer, it really means “and is a non-smoking establishment”, for the most part, but these are basically equivalent at this point.

So, the bottom line: you still cannot carry a gun into bars in Tennessee. Restaurants, yes. Bars, no.

So if you’re a member of the media (or even if you’re Stephen Colbert) then please, do your research first before laying down your opinion. Your ignorance of the subject leaks out into the public, and they form biased opinions based on it, and frankly I’m sick of correcting people about the new gun law. It’s not a bad thing, really, because it doesn’t allow anything that the media claimed it does. Sheesh.

Tags: , , , , , , ,
Shortlink:

Posted in General Spew | 1 Comment » -

Text

29 May 2009-05-29 11:17

Cameron’s house is up for sale

Tags: , ,
Shortlink:

Posted in General Spew, Linkery, Placery, Thingery | 1 Comment » -