PurpleCow.com has changed!

Saturday 08 August 2009 at 10:50 pm

In 2007 I sold the domain PurpleCow.com to a group in Florida named City Auto Credit. I was happy, they were happy. Then for the last 2 years, I hosted DNS for them, at my own expense, since they hadn’t had a chance to set up things on their end. It worked for me because people were still able to get to old links to stuff on purplecow.com, and I guess it worked for them because they never complained.

I only noticed the change because email that should be active for at least another year ceased. Here’s the new site at PurpleCow.com:

The NEW PurpleCow.com. Auto Credit? Seriously?!?

Dead-simple Netmask/Netblock/CIDR Matching Code

Sunday 12 July 2009 at 3:59 pm

So I’m writing up some code to check if an IP address is within a given netblock given a CIDR notation. If you don’t know what CIDR notation is, move along.

I’m writing in PHP, but this code can be applied to any language. At the end of the day, IP addresses are all simply big numbers written out into a notation that helps us remember them. Most of us can’t remember a number between 0 and 4,294,967,295, but for some reason remembering 198.6.1.1 is easier.

So if you own 198.6.0.0/16, you own the IP addresses between 198.6.0.0 and 198.6.255.255, or 3322281984 to 3322347519. Now, how do you figure out if 198.6.5.22 is in that group, programatically? OK, this example is kind of easy, but what about 198.6.5.0/27? Is .22 in that netblock or not? It is. How do you tell your code that?

Instead of using some bloody library that uses regular expressions and some bizarre foreach loops, you could do this.

$cidr = ’198.6.5.0/27’; $checkip = ’198.6.5.22’; list($startIp, $netmask) = split(’\/’, $cidr); if (ip2long($startip) <= ip2long($checkip) and ip2long($checkip) <= (ip2long($startip) + pow(2,32-$netmask))) { echo “Yes!\n”; } else { echo “No!\n”; }

And to validate that the first part of the CIDR block is valid:

if ((ip2long($startip)%pow(2,32-$netmask)) != 0) { echo “Invalid Netblock notation.\n”; } else { echo “Netblock notation good!\n”; }

I thought I was being all smart and whatnot, finding libraries of 100 lines of code to do what I figured out how to do in 2 or 3 lines of code. Then I found this little beauty in the comments on php.net:

function netMatch ($CIDR,$IP) { list ($net, $mask) = explode (’/’, $CIDR); return ( ip2long ($IP) & ~((1 << (32 – $mask)) – 1) ) == ip2long ($net); }

Hurrah for bitwise operators! $matchThisIp AND NOT 1 shifted (32 – $mask) -1 == $net. WTF? I’m sure it works, I’m sure it makes sense, and it sure is a lot shorter than my version. But bitwise math just boggles my mind. I’d like to leave that to the Assembly crowd. So now you have TWO ways, bitwise and, well, mine, to check to see if a provide CIDR block is valid, and if an IP Address is within a CIDR block using only a few lines of code. I’m sure this could easily be ported to PHP, Python, Ruby, Perl, .NET, Cocoa… I’ll leave that trivial task up to you.

OSX-based Screen Capture Software Blogoff

Sunday 19 April 2009 at 4:12 pm

Scott Gruby, author of the fabulous ReceiptWallet, recently raved about Little Snapper over my personal favorite, SnapzProX. I have a license for LittleSnapper as a result of the recently ended and always fabulous MacHeist III . Click to read on.

(more)

My first day with the Kinesis Freestyle

Thursday 09 April 2009 at 11:01 am

At the prompting of my friend Jay, and with a surprise refund from the Federal Government, Jay suggested it was time to upgrade my typing experience. I sit here, in front of my computer all day long, and sometimes all night long, doing what? Typing. Mousing, Using the computer. One would think that the three most important things are: chair, monitors, and input devices. Click read to read the rest.

(more)

Soon to be hit by lightning.

Wednesday 04 June 2008 at 01:46 am

Just heard some thunder, and thought to look at the radar before going to sleep. Take a look at this lightning map — it’s like that shadow monster from Lost is heading straight for DC. Whee! Should be fun.Lightning Map! June 4, 2008 1am

Save the Environment: Stop Biking!

Tuesday 20 May 2008 at 1:26 pm

The Aptera Typ-1h Typ-1e Typ-1I was reading a post over at AutoBlog Green and started to think about why Biking across America would help us save money on gas. And in my calculations, biking actually is significantly less green than driving a pure electric vehicle.

Most companies say you pay about 2c/mile for an electric vehicle to run. Power that from solar or wind sources, and you have ZERO emissions. For our estimates, lets assume DOUBLE that estimate, or 4c/mile for an EV.

Take a gasoline car. Average fuel economy is about 22mpg. Though US average for regular was put at $3.69 yesterday, I’m going to use $4, because that’s what it will be in a month. Assuming you have an average car, you are paying 18c/mile for your petrol sucking car. Plus you are spewing CO2 emissions in the air; not as much as your parents were, but there are emissions.

Save the environment - stop biking!Now look at biking, cycling or generally using a bicycle. Using a few different sites on the web, they average about 1000 calories for biking 15mph for 1 hour. I don’t know if this assumes hilly or flat terrain, but I don’t care — the number seems reasonable. For healthy food, not power bars but actual food with health value, I’m guessing you pay about $4 for 1000 calories. The calories have got to be sustainable over 8 hours of biking, and I’m guessing 32 power bars (at 230 cals per bar) isn’t the ideal consumption for long term performance. Food Ain't Green!At $4/1kcal, you are paying an astonishing 26c/mile. And you’d like to think that biking is emissions-free, but it isn’t. All of your food is shipped and carted around this great country on diesel trains, trucks and boats, spewing more CO2 into the , just to process your healthy food for you to burn 26c/mile, forcing you to breathe all that pollution along the way, stupid bike.

But for skeptics, let us say $2 for 1000 calories. you are still at 13c/mile, 3+ times more expensive than our DOUBLED estimate per mile for an EV.
And on top of that, YOU are spewing CO2 into the environment!!! At a much greater rate than if you were sitting in a nice, quiet, efficient and ZERO EMISSIONS EV.

Bottom Line: Stop biking, you pollution loving hippies, and get yourself an EV.

Where to get an EV? The Aptera does 85mph for 40-60 miles on pure electric, and you can get up to 120mpg for longer drives, all for $29,900 (or the pure EV for $26,900 with 120 mile range). Or consider the Triac that does 80mph for 100 miles, and only costs $19,995. Or my favorite and future vehicle, the Venture One that does 0-60 in 7 seconds, goes 100mph, with all three types (1 EV, 2 gas-hybrids) doing better than 100mpg, and does it all while you feel like you are flying a fighter jet. Pricing between $18,000 and $23,000. Excellent.

PS — I guess you could almost say that food these days isn’t really green. So stop eating America! Save the environment!
PPS — Just kidding.

This computer cannot use this update.

Monday 31 March 2008 at 2:30 pm

Apple. © Wired 2008What a friggin’ cryptic error message, . Your website on the WWAN Support Update page states all I need is 10.4.8 and an Intel-based Macintosh Portable. Well, I sort of meet those criteria. Granted, I’ve got OS X 10.4.11, and I think the Intel-based I have meets that Macintosh abstract inconsistent naming convention. So why oh why can’t I install you, my pretty WWAN Support? All I want to do is connect my via (hell, I’ll even do it via USB if I must) to gain access to all the EVDO goodness I’m paying for. I even am paying for the PAM (Phone As Modem) plan with Sprint to make this work. I thought you were supposed to make things easy, Apple?

Apple Logo surrounded by razor wire used without permission; From the cover of Wired 16|04. © 2008 Wired Magazine.

OSX, ssh, FreeBSD, login delays and a glass of red wine

Thursday 13 September 2007 at 12:28 am

I won’t bore the lot of you that could give two cents for what information I am about to offer. It’s extremely geeky, but it sucked up my entire evening of what could have been a productive night. To allow the rest of you having this problem to enjoy a productive and happy evening without banging your head against a wall, I’m sharing my solution to this annoying problem.

Don’t wanna read my blatherings? Add this to your ~/.ssh/config:

GSSAPIKeyExchange no

Voila, no more delays. No server config changes either. Hope you don’t have to use Kerberos! :-)

Read on to see how I got to this solution.

(more)

My Joost Beta Experience

Thursday 05 April 2007 at 3:03 pm

So today I was happy to see my Joost Beta invite in my inbox. I decided to install it and take a run around. I now use a Mac, so my experience is solely Mac-based, no Windows here. I have a MacBook Pro Intel Core 2 Duo 2.33Ghz with 2GB of memory, connected to my network at 1Gbps, and my Internet connection is Verizon FIOS at 30Mbps down, 5Mbps up. My MBP is connected to an external Dell 24” widescreen monitor at 1920×1200.

The download took about 15 seconds for the 17MB dmg download, Firefox reporting a download speed of 1045Kbps, or about 8mbps. I was encouraged by this, hoping the video experience would be just as snappy.

Not so. Click more to read on.

(more)

SimpleShare NAS does NFS on OSX 7x faster than SMB

Tuesday 03 April 2007 at 12:58 pm

I got a in December 2006 and have been quite happy with it. I have a SimpleTech on my network that holds my MP3s, documents, photos, etc. I had been using SMB/CIFS to connect to the SimpleShare drive, but I read somewhere that CIFS is slower than NFS, and I wanted to try. SimpleTech has instructions for how to connect from an box, so I figured it would be easy.

Trouble is that the SimpleShare documentation mentions NFS once, but doesn’t say how it works. Gack. Google to the rescue.

Click to read on.

(more)

A hybrid enclosed motorcycle: I want one

Thursday 22 February 2007 at 5:10 pm Venture Vehicles VentureOneLast week Venture Vehicles announced a new kind of , the VentureOne. I was reading the AutoBlogGreen on the VentureOne: 100mpg, 0-60 in 5 seconds, and sweet looking to boot! They are going to run about USD$20,000, and I'd be onboard to buy one. Gotta start saving for that !

"You will die in 10 years."

Thursday 22 February 2007 at 3:30 pm Mmmm, Cholesterol.That's pretty much what my doctor said to me on Tuesday. My cholesterol is 300+ and I weigh 263.4 pounds, not horrible for someone 6' 4" tall but still not great, and according to my doctor I have a very good chance of dying of some heart disease related death in the next 10 years unless I do something about it. I thought drinking grapefruit juice and taking my Omega-3 daily supplement would do it, and maybe it has, but the doc said that wasn't enough.

So Jen (my wife) did a bunch of research, and learned that it's less about cholesterol in the food you eat, and more about the saturated fat. I guess the body takes the saturated fat and turns it into cholesterol in your body. So I've dramatically reduced the amount of saturated fat I eat. No more cheese or fatty red meat for the next 3 months. Plus I'm eating more dietary fiber now, supposedly that's good for me too. A little FiberSure in a fruit smoothie every morning does the trick.

My goal is to be under 250 in both weight and cholesterol by May 19th, 2007. I'll succeed.

About to be a Father, Part 2

Thursday 22 February 2007 at 2:53 pm Saskia, Child Numero UnoMy second child, this time a boy, is due March 8th, just short of two weeks from now.

Wow. Two kids. Sure, people do that (and more) all the time. In fact, I'm sure a bunch of parents today had their second child. But that doesn't make me any more prepared for it. It won't be twice as hard, since I've done this before, but Saski is still such a good sleeper, I'm hoping this little guy will be too.

Woman sues City for Cutting Down Tree

Saturday 17 June 2006 at 12:59 am

The Springfield City Government hired an outside contractor to cut down a few trees around the city. Too bad they cut down the tree in front of the home of Margaret Schneider.

Schneider is now suing the City for damages. She claims that the tree provided a lot of shade, and now that the tree is gone, her electricity bills have doubled.

"I'm angry. The tree was in fine health, and it was on my property. Someone's got to pay."

Her case will be heard later this month.


Ok, this isn't accurate, it's fictional, but my wife claims she read a similar article somewhere in the last 30 days that was about this exact same event happening. Yet I and other people can't find it. Can you?

Disposable Phone Numbers make Dating Fun Again

Thursday 15 June 2006 at 03:23 am So you are on the dating scene; Match.com, eHarmony, jDate. Picture this -- you go to the bar, you meet someone nice, but you're not sure about them. You kind of want to find out more, but you hesitate to give your real phone number out. Tossable Digits to the rescue!

TossableDigits.com provides temporary phone numbers that forward to an existing phone number, like your cell, home or work number. The numbers are so cheap, their disposable. But you get more.

You get Voicemail-to-Email, Call Screening, and Time Restrictions. Finally you can control who calls, when they call, and if they call and you don't want to talk, they can leave a voicemail.

Set up Time Restrictions and calls only go through when you specify, and either goes to Voicemail or asks the caller to call back in a few hours. Set up Call Screening, and callers record their name, you get called, their name is played back, and you can decide to accept or decline the call. Voicemail enables you to get WAV files sent to your inbox so you can listen to your voicemail anywhere your email is.

I hear there are other features coming as well. It's really a decent price for what you get. No ads, no pressure, just a simple, easy-to-use service. Try it out -- there is a FREE Trial!

Bluetooth for Rental Cars

Friday 06 January 2006 at 08:37 am Why hasn't Avis or Hertz or someone big built a bluetooth module that plugs into their cars that, when connected to by an approved device, will transmit information about the fullness of the fuel tank, the odometer reading, and any other information the car has to offer that is useful at the end of a rental.



On top of speeding up the rental return process (though it's pretty fast already), you can poll your entire lot, potentially remove the need for the checkout guy at the spikes gate, and reduce errors on data entry of the information upon return. Just a thought.

6 months, eh?

Friday 06 January 2006 at 08:33 am Yep, so between being a new father and being busy with work, I haven't said a thing online in 6 months. Oops.



Saskia (the baby) is great.

Happy Fathers Day, A Day Late

Monday 20 June 2005 at 01:20 am Every year I look forward to that pivotal point in the spring and summer season, where it is neither spring nor summer. At that time every year the lightning bugs come out in droves, and every night there are more and more lightning bugs until they reach their peak, well, season, and they light up the sky like camera flashes at the Super Bowl in the dark.



This year, however, is a little bit more special for me. I'm going to be a father this morning or afternoon or even possibly tomorrow. The lightning bugs seem to have waited for this event, as have I, with a bit of anticipation. They aren't quite in full force yet, and I'm kind of happy about it. I'd love it if the peak of the lightning bug season would wait a few days so I can share it with my wife and daughter when we get home.



Fatherhood hasn't hit me yet. Maybe it really doesn't until you meet your daughter for the first time, without the hassle of your wife's stomach. Maybe that bond happens right at the point where you first see that your daughter sees you. Maybe it is when you get to spend a few hours just holding and looking at your daughter in your arms, making little noises, trying out her now-freed arms and legs a bit, recovering from the long day of coming into the world.



It's kind of weird, knowing that you have no idea what to expect now, and knowing that in a couple of hours, you will. Being able to know you don't know now, and know that you will know soon. Knowing that your life will change, drastically, but still staying up late, sneaking out of bed to put down those last few threads of what is floating in your head before you become a dad to someone who you've never met, but are completely sure you'll love for all of eternity.



My daughter. Wow. I'm gonna be a father today.

Father-to-be in 23 Days

Wednesday 18 May 2005 at 12:18 am June 12, 2005. That's when our baby is due. Baby girl. Wow.



I'm completely unprepared for this little bundle of joy that will be entering my life in a few short weeks. Everyone says your life will change, you will not get any sleep, you'll be a zombie, blah blah blah. And I'm sure they are right.



I'm already short on sleep, acting like a zombie, and my life changes day to day. So maybe I am ready.



nah. But I am excited. This first time this happened, it was my wedding. A new person came into my life and has been with me for a fantastic voyage for the last 5 years. But she can take care of herself, at least the basics. Now a little life is entering my life, and I'm being forced to give up my selfish ways. Sure, I did that when I got married somewhat, but this is a life that depends on me for the bare essentials. I can't be like "Oh, I'll change you after ER." or "Can I feed you tomorrow?" or "If you aren't gonna shut your trap, I'm leaving." Not that I do that now...



So maybe this will help me figure out what I need to do to be a good parent, a good father, to my future daughter. I know my life will change, and that I'll be joyful and so proud of my little girl. But it sure is going to be a shock to my current way of life. Change is a difficult beast. Change is even harder when it is forced upon you, instead of you deciding to change.



Change is good. I'm really excited to meet my daughter. Jen is starting to have some mild contractions (calls 'em cramps, but I know better), so the time is drawing near. 37 weeks in, 23 days to go.

Payphones Of The Future

Wednesday 06 April 2005 at 1:41 pm I was reading about how phone companies are removing unprofitable pay phones from places across the US. In some cases, this is causing a lot of uproar from residents of smaller communities, where cell service may be spotty or non-existent, or where many residents don't have their own home phone.



We have so much technology that it seems silly that we don't have a solution. In the article above, the Fayette Country Store had their pay phone removed by the phone company because it was unprofitable. Why can't the store provide a pay phone?



The store probably gets a decent amount of business by having that pay phone available. Now why couldn't the store get their own pay phone, charge 2x as much for calls, and pay for itself. The pay phone could be controlled by a cheap PC inside, use a standard phone line or even a cell line, and sell phone cards at the store...profit!



I know there are companies that provide pay phone service to other businesses, maybe not in Maine though. I just think it is silly that people complain about the phone company being more interested in the revenue than the community. The community needs to take action themselves, and the technology is there for them to use. If they want a phone, they should pay for it, regardless of who is running it.



Besides, access to a telephone isn't a constitutional right.
 

Beckman

I'm a big geek, serial entrepreneur and idea guy. I've been called names, such as PHP Guru, MySQL DBA, BOFH, Security God, etc. That and Peter-Peter-Pumpkin-Eater.

The image in the header is © Peter Beckman.

Tag cloud

Archives

Last Comments

Links

To change the links in this list, edit the file '_sub_link_list.html' in the pivotx/templates/default/ folder. You can do this by directly editing the file, or you can go to 'Manage Media' » 'Templates' in the PivotX interface.

Search

Stuff

Powered by PivotX - 2.0.2
XML: RSS Feed
XML: Atom Feed

Add to Technorati Favorites