28 April 2014

Getting Motivated

#1. Stop trying and just do it.

I really like the song “One More” by Superchic. If you can overcome step one, you can face the 99.

A thousand mile journey starts with that first mile.  And that first mile starts with a single step.  Just one.

Don’t concentrate on an end goal, or you might get dissuaded by lack of progress.  In a journey of a thousand miles, it can be daunting to think that there’s another 999 to go after getting that first mile down… so, instead, think of how far you’ve come.  And when you get another mile, realize that you’ve just doubled the distance traveled.

#2. Concentrate on the Next Step.

When I started weight lifting in November of 2013, I had no idea what I was doing.  I just jumped into it, asked for some advice, and did my best.

Probably the biggest single thing that I did was to make it to the gym regularly.  Even when I felt like crap, when I didn’t want to work or was feeling sick, or whatever, I just went.  Just getting in the door was a big challenge.  Once I was there, I would think, “well, I’m already here, might as well do something.”  And then I did a full workout.  In fact, there were many days that started out with not wanting to do anything, and ended up being some of my best days.

#3. Track Your Progress.

On that first day, I moved 9,525 lbs. Today, I moved 91,170.

That’s a 10X gain.  And it was all with little additions.

One of the things that motivates me to work out just a little harder each time is Nerd Fitness.  It’s an awesome website.  No pushing merchandise, or pills, or services on you, just simple no-nonsense advice from real people.  One of my favorite articles is “How to Set a New Personal Record Every Day.”

Category: Uncategorized | Comments Off on Getting Motivated
26 March 2014

Comments Finally Available

I’ve wanted comments available for a long time.

Due to my lack of willingness to deal with spam, I disabled the standard commenting system in WordPress.  For a while, I allowed it (though on a different website), but required them to be authenticated users… and they had to have at least one comment accepted… unfortunately, this only lead to an unmanageable number of bogus users being registered.  I tried to cope.

I don’t cope with technical bullshit very well.

I’ve used Disqus before, many times, without problem, so I decided to go with that system.  I installed the plugin, configured my account so there could be posts on a different website (using a different “category” or whatever), and POOF: nothing.  Just like before I installed the plugin.

Comments were enabled (at least as far as I could tell)… nothing.

Went back to the default theme… nothing.

Removed all other plugins… nothing.

Followed Disqus’ “manual installation” instructions… NOTHING.

Finally, after fiddling with the code a bit, I forced the Disqus comments to show.  Basically ignoring the check that determines if WP says that commenting is okay.  For now, that’s just how it’s going to have to be.

So… START COMMENTING ALREADY!  (Click on the title of the post if you don’t see a place to comment.)

Category: Uncategorized | Comments Off on Comments Finally Available
21 March 2014

No Space Left On Device

I got this message while testing something on my web server. I was quite baffled to find out that there was, in fact, quite a lot of space remaining.

What Is Tail?

The “tail” program is a command line utility for Linux based machines.  To read the last few lines of a text file (such as a log), the command is “tail /path/to/file.log”.

However, the true power of the tail program comes when adding the “-f” argument.  Now, it will show the last few lines of the file, along with anything appended to the file.  Running “tail -f /var/log/nginx/error.log” shows me, in real time, the errors that are occurring on my server.

Searching For A Solution…

I read a few articles on the web about this problem, after I tried freeing up some space.

Ultimately, the problem was due to CrashPlan’s greediness (and a bug in the “tail” program).

How To Fix It… For Reals

Instead of configuring the system to have a higher value for “fs.inotify.max_user_watches”, just restart the crashplan service.  Or Dropbox, or whatever it is.  Just restart a service, then try running “tail -f” again (on virtually any file): if the error went away, then the culprit was that last service you restarted.

Category: System Administration | Comments Off on No Space Left On Device
4 March 2014

Why MS Access Application Developers Should Be Ashamed

If you have written what you consider to be an application in Microsoft Access, you should be ashamed of yourself.  MS Access is not a developer-friendly environment.  Not even a little bit.

You might think, “oh, but I’m just making this simple little application, and it’s not going to be used for very long.”  Wrong.  The company you made it for is going to use it until the amount of money they’re spending on maintenance vastly overshadows the amount it would cost to create a real application to replace it.

“No, that’s silly,” you might think, “I told them this thing won’t scale.”

Well, kudos to you for realizing that MS Access is a pile of crap, and for realizing it doesn’t scale.  But the company isn’t going to do anything about it.  Because if it ain’t broke in a way that costs a lot of money, don’t fix it.

“I told them I’ll rewrite it as soon as I have time.”

You’re never going to have time.  Once this thing gets put to use, you’re going to spend all your time fixing it.

Eventually, you’ll leave the company, probably because the pain of maintaining that application was too stressful.  That’s where I come in.  And I hate you for doing this to me.

That’s right, I’m the guy that gets hired to maintain the pile of shit you left behind.  And guess what?  The company has no money to spend on creating a real application, because they’ve spent all of it maintaining that thing.

Without further ado, here’s a few of the many, many, many reasons why MS Access isn’t developer-friendly:

  1.  Source code can’t be maintained.  Go ahead, tell me there is–and prove to me that you’ve used them successfully.
  2. Debugging is a joke.  If the application gets closed, all those breakpoints are gone, and trying to step through it is like scalping yourself and then replacing your own hair with individual strands of silk from a black widow spider.
  3. Changing the code will RESET THE PROJECT.  So those breakpoints you spent an hour setting are ALL GONE.
  4. Only one developer can work on it at a time (see #1).  If more attempt to, the result will be that somebody’s change will get overwritten.  But neither will know who did it, what’s missing, or why.
  5. The source code is obscure, difficult to access, and can be password-protected.  Because that’s a good idea.
  6. You have to know the application’s “secrets” to develop on it (like holding <shift> while opening the file)
  7. Pretty much any programming language that still uses “GoTo” should not be used anymore.

If you’re thinking about writing an application in MS Access: DON’T.

Category: Code, Rant, Software Development | Comments Off on Why MS Access Application Developers Should Be Ashamed
24 February 2014

My Drive

Recently, a friend and I had a conversation where he asked me how/where I get my drive.  He said the last thing he wants to do when he gets home is code, or–in the case of many others–touch a computer.

I’m not 100% sure where my drive comes from, to be honest.  It seems strange to say that I go home, after a long day of programming at work, and sit in front of the same laptop doing essentially the same thing.

So, here’s some things that seem like they might contribute to my drive.  I’m been having some mental issues as of late, so I’m yet capable (or willing) to decide which is the biggest motivator… but here goes:

Goals

I want to eventually push some of the software I’ve developed to a paying audience.  Through support contracts, through pay-for applications, or something.  Somehow the software I’ve written should be able to support me.

If I manage to support my application development by being a published author, that would be okay too.

I’d really like to have a company where I can work with my friends.  I have a couple of friends that are developers, and I really think it would be fun to work with them.  Maybe on web application development, maybe on building some sort of game, or maybe working on books or something like that.

Learning

I love to learn new stuff.  Not just anything, though, but stuff that interests me (I’m not going to learn Mandarin, for instance, because I don’t find it interesting nor useful).

I’ve decided against learning some things, though.  Several of my friends and colleagues have tried to get me to learn Ruby, Python, and some other languages.  And honestly, I just don’t find them interesting enough to pursue.  Learning programming is hard, and I’ve already got quite a few of them under my belt.

Category: Rant | Comments Off on My Drive
24 February 2014

Nginx and PHP as Different Users (Pooling)

So, after having installed a few WordPress sites on my server (namely this one), I ran into some permissions errors.  I couldn’t get plugins nor any updates to install.

The problem first appeared simply as a prompt to enter FTP credentials.  That was bizarre, so I hunted to find why that was.  I realized it was a permissions issue by reading this page (among others).

I scoured the Internet for answers (in other words, I tried a lot of different search terms in Google) for a way to make Nginx, the webserver software I used, to run as the proper user.  I’d setup different users for different websites, so just changing the webserver’s default user/group wasn’t the answer.

My first solution, albeit an ugly one, was to give everybody read+write+execute permissions on my WP folders.  That was an ugly kludge, but it worked.  And so it sat for some time.

Then I finally found how.  Through some bit of serendipity, I found an article on Apache and suExec.  I changed the term to Nginx with suExec, and found the answer… sort of.

Nginx, PHP-FPM, and Pooling

So the key was the “pooling” part of PHP-FPM that I’d basically ignored.  I had read the configuration file, but didn’t really understand it.

But after reading this article about pooling with Nginx and PHP-FPM, I found the answer.

So PHP-FPM can be configured to run different pools.  Basically, that means that there are multiple main processes for PHP, and they can run as different users.

Easy.  Added a new pool, changed it’s name and the user, and the new process (well, processes) appeared, with the correct user.  But how could I attach that to my website, so it ran as the correct user (instead of www-data)?

It’s All In The Socket

The bit of magic that makes Nginx hand off the PHP work to the correct pool is the socket.  The new pool needed to have a unique socket, then the affected websites needed to be reconfigured to use the socket corresponding to the appropriate pool.

I went back and changed my new pool to have a unique socket name, then restarted the php5-fpm process.  I then went and changed my website’s configuration file to use the corresponding socket.

Before restarting Nginx, I changed the permissions on my website’s folder to no longer be world readable/writable.  Then I attempted to delete an old plugin: as expected, I got a permissions error.  Restarted Nginx, then tried again, and it worked.   Woot!

Category: Nginx, PHP | Comments Off on Nginx and PHP as Different Users (Pooling)
19 February 2014

Why Coding and Smalltalk Don’t Work

So, when I’m working on code, and somebody starts trying to talk to me, I sometimes get funny looks from them when I can’t respond right away.  Or because they have to wait a significant amount of time before I let them talk.  Or because I get frustrated right away when they just start talking anyway.

I’m not intentionally being an asshole.  But I do get frustrated by it.  Switching to and from programming/coding isn’t like switching to/from a book or an article or whatever.  It’s way way more involved.

There’s a fair amount of time required to get (back to) programming.  Like one of those choose-your-adventure novels, only… more.

If you chose “I’ll go with the stranger” on page 2, but didn’t take the candy in chapter 12, and you’ve got a machete (from pages 12, 13, 405, 7004, or 7005), go to page 803..  If you chose “I’ll go with the stranger” on page 2, didn’t take the candy in chapter 12, and you’ve got a machete from pages Honey? 85, 99, or 9008, go to page 405.  If you chose “I’ll go with the stranger” on so I was at the store today page 2, didn’t take the candy in chapter 12, and you’ve got a machete from a page that is NOT 12, 13, 85, 99, 405, 7004, 7005, nor 9008, go to page 777.  If you chose “I’ll go with and I saw Jerry the stranger” on page 2, didn’t take the candy in chapter 12, and you don’t have a machete at all…

So now the stranger’s name is Jerry.  And I got the machete from a store… wait, there’s no chapter called “store” in here… SHIT.

Category: Code, Rant, Software Development | Comments Off on Why Coding and Smalltalk Don’t Work
17 February 2014

Nerd Rage on MySQL and Postgres

MySQL vexes me SOOOOO MUCH.  Why not just use PostgreSQL?

I know, I know, you’re thinking, “I have no idea what you’re talking about.  I don’t even know how to pronounce those two things.”

So, MySQL can just be pronounced “my squeal,” and PostgreSQL can simply be pronounced “post gres.”  There, one part down.

Choosing a database is a developer thing, I guess.  But… WHY?  Here comes the classic car analogy.

On the left, we’ve got the MySQL coupe.

It’s kinda plain looking.  It has a history of doing unexpected things, like not stopping when you press the brakes, and continuing to accelerate when you release the gas.  It looks like any normal car, but there are some rather devious things under the hood, and is definitely not “standards compliant.”

On the right, we’ve got the PostgreSQL coupe.

It looks sleeker, more like a sports car than a run-of-the-mill coupe.  Even though it costs the same as the MySQL coupe.  It does everything you expect it to.  Everything about it is standards-compliant.

So, why choose MySQL at all?  Doing so has zero benefit.  Choosing PostgreSQL means it’s actually pretty easy to convert to MySQL later (right… “hey, I’m trading in my Lamborghini Diablo for a No-Name Turdmobile).

If you’re a developer, and you’re working with a database, just use PostgreSQL.  It will save you time in the end.  SERIOUSLY.

Category: Rant, Software Development, System Administration | Comments Off on Nerd Rage on MySQL and Postgres
5 February 2014

Too Long, Didn’t Read

This post is about the “TL;DR” thing.  If you’re not aware, it means, “Too Long; Didn’t Read”.  It’s irritating to see, and I pretty much hate it.

“Look at that… jeez… it would probably take me like two minutes to read that… nope. TLDR.”

If I post something on Facebook about some article that was mildly amusing, I’ll understand if you didn’t read it.  When I come across long articles that look interesting, but I just don’t have time, then I skip it.  I totally get it.

BUT.  If somebody tells me about it later, says that I should really read it, I try take a few minutes to read it.  Especially if it seems important.

When I write you an email, especially when it’s specifically to you or to a very limited audience, I expect you to read it.  I spent a lot of time on it: the longer it is, the more time I spent on it.

So when you respond with, “TLDR” or some derivative, it means you don’t care about what I’ve said.  Not even enough to skim it.  Seriously, I can skim a two-page email in a couple of seconds if I need to.  In about as much time as it took for you to click “reply,” type in “TLDR,” and hit the send button.

Good friends read.  Acquaintances skim.  Assholes respond with “TLDR”.

Category: Rant | Comments Off on Too Long, Didn’t Read