• Tweaking a web server with Nginx

    A few weeks ago, I started playing with nginx as a replacement for Apache. The exact reasons I decided to do this are a bit unclear, but I think it had something to do with me playing with node.js and MongoDB. The initial setup was pretty smooth and the configuration files are much easier to understand than Apache for my sites. However, I also decided to offload the PHP processing to php-fpm and that's where the problems began. My VPS is pretty lightweight and doesn't have a lot of RAM. My blog was running out of memory all the time and php-fpm stopped responding.

    After a lot of tweaking to reduce memory usage, I managed to stabilize the system and get much faster response times for my blog; it doesn't get a lot of traffic, but I think I've done a decent job with performance. If I ever get hit with a massive load, I'm sure my server will keel over.

    Is there a real reason to use nginx vs Apache? I'm sure some people will say yes, but for me the jury is still out. Things are going smoothly, but was it worth the trouble? I have no idea.

  • Drones and Privacy

    A few months ago, I received a DJI Phantom 2 quadcopter for a present. For most people, a quadcopter is called a drone. Call it whatever you want, it is a fun toy for me (tool for others). I have it outfitted with a GoPro camera and a video transmitter so that I can see what is going on during flight. In a conversation with my in-laws where I was showing my father-in-law how it flies, my mother-in-law indicated that she thought the devices were creepy because they can be used to spy on people. This is the same thing that the media is playing up and catering to the fears of people.

    The quadcopters are first off, noisy, you can't sneak up on people and take a picture; you know they are coming. Second off, the cameras on these copters aren't all that great for details. The GoPro is a decent camera, but if you want to take a picture of someone in a house, you're going to have to have the copter right at a window. Third, if you live in a 2 story house, it's likely that you can already see in your neighbor's yard. We live on a hill and can easily see into our neighbor's backyard from our backyard.

    In the current state of copters, I find it quite hard to really invade someone's privacy without them knowing. Also, as I'm just learning to fly, I only fly on my property. When I get more experienced, I'll goto a park and fly; flying over people's houses may not be the smartest thing to do.

    Time will tell what lawmakers decide to do to this new found hobby of mine.

  • Thoughts on Storyboards

    When Apple came out with Storyboards in Xcode, I thought that they would be quite useful in making it easier to see how an app was laid out. However, after attempting one project with them, I determined that they had limited utility as they wouldn't scale and wouldn't work well for multi person teams. I left storyboards for a year and didn't revisit them.

    I started another project about a year after my first experience and decided to give it another go. This project was a small project and I was the only developer, so it was well suited for storyboards. The project grew and grew. Storyboards worked OK, but the layout in Interface Builder was almost too hard to manage. I finally decided to see about splitting up the storyboards into multiple storyboards.

    The app was a tab bar based app, so the logical breakdown was one storyboard per tab. It only took about 15 minutes for me to do this and undo a poor initial decision. However, there were still one or two links between storyboards that were easy to fix in code. Some peopl have come up with ways to link storyboards like RBStoryboardLink which looks interesting, but I haven't explored it.

    Multiple storyboards seems scary at first, but it is worth doing to keep difference parts of an app more contained and easier to visualize.

    I haven't used XIBs in about a year and I'm not sure there is a good reason to use them as storyboards are easy to work with and make it simple to use custom UITableViewCells and UICollectionViewCells.

  • Lessons in home remodeling

    Almost a year ago, we embarked on the journey to transform our house into a home. It has been an interesting journey, to say the least. I've learned a lot about myself and a lot about the process. While I love our house and I consider it down, the most important lesson I've learned is that I never want to do this again! Why would I say this? Remodeling a house requires you to make hundreds and hundreds of decisions ranging from what faucets to get to what color paint to put on the wall. We had a general contractor who handled all the sub contractors. Dealing with the general contractor was easy and he was quite responsive.

    We had an architect do the design and my dad who was in construction inspection his entire career offered to act as the project manager, per se. Man dad was at the house a few times a week and paid attention to all the details along the way helping mitigate problems that arose and guiding us on what we should do. By getting up early every day and working from 5:45 am to 2:30 pm, I was able to goto the house everyday and see what was going on with the house. Inevitably there was some problem I had to deal with or some decision to make.

    Just to give you an idea of the decisions we had to make:

    • What faucets to buy
    • What countertop to get in the bathroom
    • What countertop to get in the kitchen
    • What light fixtures to buy throughout the house
    • What outdoor light fixtures to get
    • What floor to get
    • What color paint for all the rooms
    • What color paint for the outside of the house
    • What kinds of toilets to get
    • What towel bars to get
    • What kinds of windows to get (I was very specific on the type of lock I wanted)
    • What sliding glass doors to get
    • What tile to get
    • What fireplace to get
    • What tile to go around the fireplace
    • What color stain for the cabinets
    • What ceiling fans to buy
    • What track lights to get
    • What thermostat to get
    • What furnace to get
    • What garage door to get
    • What garage door opener to get
    • What shelving units to get
    • What closet organizers to get
    • What sinks to get
    • What vanity to get
    • What doors to get
    • What door hardware to get
    • What speakers to get
    • What appliances to get (refrigerator, microwave, washer, dryer, range, dishwasher)

    etc.

    I tried to keep ahead of the contract and to make things as easy as possible for my wife, I tried to only present a few decisions to her at a time.

    On top of the decisions, issues came up with just about every sub contractor. Some issues were easily resolved, some were a bit more complex. One of the most memorable problems was the day we moved in (the house wasn't done, but enough so that we could move in), I smelled gas in the attic, so I shut off the valve to the furnace. The next morning, I went up again and still smelled gas. The shutoff valve wasn't properly connected so I had to shutoff the gas to the house. The contractor got the sub contractor out to fix it right away, but that kind of workmanship is pretty unacceptable as it was a safety concern.

    This really wore on me and caused me an immense amount of stress. Our house is now really a home and I'm very pleased with the outcome; the process, however, is one that I could have done without.