PHP – The World’s Best Case Against Static Compilation

Let me start off by saying first and foremost that I am NOT anti-PHP.  I like PHP.  PHP was my first web scripting language that I learned (I don’t count Perl as a web scripting language, because it has so many other uses), and I’m glad for its existence.  It has allowed me to do many things, and powers many great websites like Facebook and Yahoo.  It is what WordPress is written with, possibly one of the most useful content management systems out there.

One annoying thing though about PHP is that most of the extensions, with the exception of PEAR modules, is that additional functionality is all bundled into one huge binary. This means that many PHP modules, whether you need them or not, get included into this one big chunk that sits in RAM and processes your PHP scripts.  You can avoid this partially by stripping out things you don’t need if you’re running your own server or virtual dedicated server, but in a shared hosting setup you simply have to include most of the commonly used modules, and this is easily over 20 in most common setups.

I’m not completely against static compilation, I know it has its advantages.  When you compile a binary program statically, you have one single package that contains all the libraries it could possibly need.  There’s no need to include anything else other than program data – the one binary file can probably do everything you need.

I’m also aware that you can have PHP compile dynamic modules that can be loaded in both at run-time and via the php.ini file, but in a shared setup, this is a potential security risk.  Debian and Ubuntu do this automatically by isolating out just the shared library and using conf.d type php.ini files, but still, it doesn’t address the core issue of the nightmares of getting all the dependencies right while building PHP from scratch.

I really hope that the PHP team at some point forks off all of the extra plugins and reduces the PHP project to the simple Zend execution core.  If modules like MySQL, GD, etc. were made into PEAR modules, they could be included only when needed, and thus save a ton of time while compiling PHP, not to mention RAM during script execution.

Ruby did this well by only including what needed to be included in the core, and leaving extra functionality to be fulfilled by a Rubygem, either installed by a local user or system-wide.  This reduces dependency issues, compile time, RAM usage, and configuration headaches.  I’m not saying the Rubygems system is perfect, but it certainly has distinct advantages over the “throw everything including the kitchen sink into the interpreter” style.

Posted in Linux, PHP, Ruby | Leave a comment

Redefining the E-mail Habit

E-mail isn’t a bad habit, but keeping it around forever is.

Since 2005, I’ve been a user of Gmail.  It’s a wonderful e-mail service offering free e-mail that seems to have no limits.  You’re encouraged NOT to delete e-mail – just archive it away.  It will be there when you need it.  But when do you really need it again?  If you do, aren’t there better ways to store your data?

In light of Google’s increasing privacy concerns, I’m moving most of my services away from Google.  I’ve started using Duck Duck Go as my primary search engine (thanks to Eric Jung’s suggestion), stopped using Gmail (though I still have the address, it just forwards to my own server), and am slowly divorcing myself from all that is Google.  It’s not that I have anything to hide – in fact, if it weren’t for passwords in my data, I’d have no problem with anyone seeing all of it.  I just don’t like the idea of a company farming my data to see what kind of financial gain there is in it for them.

In my re-evaluation of e-mail, I went through a good portion of it and noticed that it really didn’t need saving.  In fact, I’d say out of the 1 Gigabyte or so of e-mail I’ve had in the past 5 years, only 1%, or less, should still be around.  Anything else could be deleted or moved into things like Basecamp or our ticket system.  Keeping things in your e-mail inbox is tantamount to procrastination.  They probably should be filed into separate data storage with an active purpose, acted upon, or deleted.  The rare few e-mails that don’t fall into those 3 action categories should be saved.

That’s my new philosophy going forward.  Optimizing my digital life by reducing the amount of data I have laying around to only what is essential, uncluttered my inbox and acting upon the e-mails I receive as soon as possible, and ditching what is left.

Hopefully I won’t again fall into a habit of convenience to benefit another company’s data mining techniques.

Posted in Business, IT, Productivity | Leave a comment

Template Redesign

I love the new Twenty Ten theme in WordPress 3.0. It is much easier to customize and edit than the theme that came with WordPress 2.x. For that very reason, I’ve changed my theme to it and customized it a bit to my taste. This theme has a lot more possibilities so expect some more changes soon. I know there’s a few font formatting issues that exist on some posts but I’ll clear those up shortly.

Posted in Web Design | Leave a comment

Spaces in Windows Share Paths in Fstab

If you need to put a space in your Windows share path in /etc/fstab, just use this escape sequence:

//192.168.1.2/My\040Documents

(It is important to note that there are no spaces between My and Documents, only the escape sequence \040)


Posted in Linux | Leave a comment

Extras in Ubuntu 10.04 LTS

I’m posting this both as a reference for myself and for others as to how to enable all the extras in Ubuntu that you need, like MP3 support, Windows codecs and fonts, etc.

Once you install Ubuntu 10.04 LTS, make sure you do all of the updates.  Reboot, then install the recommended nVidia drivers.  If you do these items in the reverse order, you’ll end up having to possibly reinstall the nVidia drivers.

If Ubuntu doesn’t prompt you to install all of the updates, just go to System -> Administration -> Update Manager.

If Ubuntu doesn’t prompt you to install the drivers, just go to System -> Administration -> Hardware Drivers.

Once you’ve done that, you need to enable all of the software repositories.  To do so, start up Ubuntu Software Center from the Applications menu.  Click the Edit menu and click Software Sources as shown below:

Ubuntu Software Center - Edit Repositories

Once you do this, you’ll see a dialog asking which repositories to include.  Click them all (except for source), as shown below, and click Close.

Ubuntu Software Center - Software Repositories

Once you’ve done this, close the software center and run (in a terminal):

sudo apt-get install ubuntu-restricted-extras sun-java6-bin

This should install most of the extras you’ll need.

To install Flash, just go to any site that you trust that uses Flash (like YouTube) and try to play a video.  You’ll get a notice about installing Flash.  Do so, then restart Firefox completely.  Once you do this, you’ll be able to use Flash.

If you install Chromium, you’ll be able to use Flash there too.

Posted in Linux | Leave a comment

The False Choice – Healthcare or the Economy

It seems that you can’t pick up a newspaper, watch television news, or venture out anywhere in Internet journalism without hearing something about healthcare and its reform. Are you enjoying the false debate?

On one side you have a group of people that have the strong belief that healthcare should be free to all.  Everyone should be insured they say.

On the other, you have the belief that government shouldn’t be involved in healthcare whatsoever and that we should be focusing on the economy and not healthcare.

Both arguments are flawed.  Healthcare isn’t free, so someone has to pay for it at some point, and the government shouldn’t be trying to fix the economy because government really doesn’t have the ability to fix it.

So there’s our false choice – which do we fix – healthcare or the economy?  As if we have the power, or testicular fortitude to fix either.

Healthcare

We can’t fix healthcare because we won’t talk about the root of the problem – insurance.  We need to get rid of all insurance.  We can’t do that though because there is no way to force the abolition of a business in our government framework – and this is a good thing.

Rewind 120+ years ago, back to a time when health insurance didn’t exist. People paid hospitals and doctors directly.  Of course we didn’t have near as many treatments available, but healthcare wasn’t so primitive that it didn’t cost money.  When people couldn’t afford it, they were generally able to find a doctor or hospital that would provide free care, or make payment arrangements.

Those payment arrangements weren’t as steep to meet though, because there wasn’t the hidden tax of health insurance baked into the bill like it is now.  The cost of medical services were exactly what they really cost, plus a decent profit, depending on the provider.  Adjusted for inflation, healthcare was just a fraction of the cost it is today, and people got by as well as they got by today.

The right complains about socialized medicine, but we essentially have it now.  The left complains that a single payer system is the only answer, but we can’t afford to make the problem worse by expanding the healthcare insurance industry into a large government organization. You think you hate how health insurance is now?  Just wait until the government takes it over.

Even if there were a way to provide healthcare to everyone for free, the government infrastructure to provide this service would be horrendous, and we wouldn’t like the consequences.

My plan for healthcare would include the following:

  • Call on Americans to take personal responsibility for their own healthcare – stop eating junk food, watch what you put into your body, and do everything you can to reduce the need of healthcare services.
  • Explore homeopathic remedies – there are many out there, and they work well, sometimes better than modern medicine.
  • Call for a nationwide boycott of healthcare insurance – pay your healthcare provider directly!  Can’t afford to pay them for their services?  Just wait, the price will come down dramatically after the healthcare insurance industry removes its talons.

I know the plan isn’t perfect, and I don’t claim to be a model of health myself – but it’s a good start, and I bet would accomplish more than what’s being proposed now.

Economy

The government can’t fix the economy, because they’re in bed with some of the same folks that messed it up in the first place – the Federal Reserve!  The economy seems to unravel more and more no matter how hard we try to push it to grow.  That’s because you can’t make something grow by papering more money over it.  Printing borrowing money isn’t the answer, and only makes the problem worse.

Why do we expect the same people that caused the mess we’re in now to come up with solutions to fix it?

So how do we fix the economy?  The short answer is we can’t without a bit of pain, but the pain would be a lot less than it will be if we continue down the road we’re on.

Essentially my plan would involve the following:

  • Have a jubilee – forgive all public debt – start from scratch.  All tax debts, federal loans, and debt owned  or owed by the federal government, would be included.
  • Bring the US dollar back under control of the treasury and re-link it to the value of a basket of precious medals, like gold, silver, and platinum.
  • Enact carefully thought out, constitutionally valid financial reform.
  • Relinquish government control of all private companies (i.e. Government Motors becomes General Motors again) back to their private owners.  If this means they fail or go bankrupt, so be it.
  • Get rid of federal agencies like the FDA, FCC, Department of Education, etc. and use the money save to reduce or eliminate income taxes at all levels – federal, state, and local – and watch the economy grow.  Supplement when necessary with sales tax, but you’d be surprised how little you need when you trim the fat.
  • Reduce our military spending to cover a decently large standing army ready to protect America’s homeland only.  We don’t need troops overseas unless there’s an active conflict we must be involved in (and by must, I mean a direct threat to our homeland security).
  • No more bailouts – if a company is about to fail, let it.  Get the pain over with fast.

Final Thoughts

If we really want to fix both, or either problem, we have to make some gutsy moves, and get to the core of the issues.  Both issues can be solved with minimum government, brief minimum pain, and a long term sustainable solution that isn’t a paper over until next year like everything being proposed now.

The left and right paradigm no longer serves us.  It gives us false choices, ideological battles that can never be won, and a false sense of democracy.  It’s time for a fresh, yet surprisingly unoriginal perspective on our problems – a return to the framework that the country was built on.  The problems left over can be addressed by the good will of all Americans coming together to help those in need and to fix problems larger than ourselves.  When done voluntarily, as part of charities, community groups, and religious organizations, the power of these good deeds is amplified.  When done through force of government, the human spirit is diminished to its lowest common denominator.

Posted in Economy, Politics | Leave a comment

The Port 22 Myth

There’s a myth that needs the proverbial busting treatment, and it concerns having the dreaded port 22 open.

Is it really safe to leave this back door open to your server?

I propose asking the question another way:  Is it really safe to leave open a default port to the OpenSSH login system, a system protected entirely by very strong encryption and written in a manner that is designed to be as safe as possible?

If you ask it that way, I feel most people would say yes.

There is no extra security you get by running SSH on any other port than port 22.  An attacker can easily run a port scan and find the port you’re running SSH on anyway.  It’s a rather trivial task. If your SSH software is up to date (just like every other system-specific software on your server should be that faces the outside world), then you have nothing to worry about if your passwords are strong and/or you use SSH keys to access your server.

Posted in Linux | Leave a comment

No, You Probably Don’t Need Ruby on Rails

I’ve taken some flack before for being on the side of the fence that usually doesn’t favor the use of Ruby on Rails for small projects.

What have I got against Rails?  Absolutely nothing!  It’s my platform of choice for developing medium and large web applications.

But Rails is generally not a good fit for a small project, especially a blog or simple website.  There’s many reasons why it isn’t, but some of the main ones are:

  • Why re-invent the wheel?  If you need a blog or simple CMS without a huge amount of complexity or customization WordPress and Drupal deliver nicely here.  Even Joomla, if you feel brave enough to tackle that mess.
  • Even with Passenger, deploying a Rails application is more of a hassle than setting up a WordPress site.
  • Maintaining a Rails application is a commitment, not just a casual task.  Rails depreciates things so quickly that means you will have to dig into the code from time to time to bring things current.

Now that’s not to say Rails can’t handle small projects, because it can, but if you want a set-and-forget type system for a small task, Rails isn’t it.

I deploy a Ruby on Rails-based project when I know I’m going to be maintaining that application for the long haul.  It makes things so much easier in the long run for complex tasks, but you really have to commit to it.

The Rails community could help this by not depreciating support so quickly for older releases of code, and keeping updates fewer with more purposeful and thoughtful features that don’t break everything 2 versions back.  Plugin and gem authors too need to be mindful of older releases of code, when possible.

This may work itself out as Rails matures (it’s come a long way already), but it still isn’t a good system for the casual website or project you can’t afford to babysit.  This is a real shame, because Rails really has a ton of advantages over many of the other ways.

Posted in PHP, Ruby | Leave a comment

Surprise Snowstorm

The weather forecasters missed this one big time!  There wasn’t even a chance of rain forecasted.

On the morning of February 8th, 2010 it started sleeting, then changed over to snow completely by 9 AM. At its peak, over an inch an hour was falling, totalling almost 6 inches in Florence, Alabama.

2 more inches of rain is forecasted to fall tonight, but with temperatures around the freezing point, its anyone’s guess as to what exactly will fall.

My backyard, a bit later in the afternoon after some had melted.

This was during one of the more intense parts of the storm. My mom took this one.

Posted in Weather | Leave a comment

Christmas 2009 Album Released

I’m proud to announce the release of my Christmas 2009 mini-album full of 6 traditional Christmas songs.

Please download the free album here:

Christmas 2009 Album

Posted in Music | Leave a comment