Index | Archives | Atom Feed

On Writing

I've decided to start writing more. Part of the motivation grew from reading blogs of other developers, such as Brent Simmons's amazing inessential. Writing has since grown on me and has become a lot more.

Writing, especially publishing on the web, was very difficult initially, but it has gotten progressively easier. Part of it may be due to more practice, but I feel most of the improvement from building rewriting into my writing workflow. For me, a thought rarely comes out right the first time and almost always needs rewriting.

I've started carrying a pen and notebook with me, as I noticed I solve some coding issues better on papers first. It is the same for writing. Writing the old school way removes the distraction of a computer and helps me focus better. It also forces me to do a rewrite when I transcribe it into my draft document on Dropbox.

As a result, I'm much happier with the final result compared to the first draft, and I'm also much more willing to publish it. I'm looking forward to writing and sharing more in the future.

P.S. My new found obsession of fountain pens may also be contributing to this. Maybe I'll write about it one day.


Website Migration, Again

In my previous post, I detailed my new setup. I initially chose to use the most popular distribution of linux, Ubuntu, for my DigitalOcean VPS. I made this decision because any problem or question I may ever have about Ubuntu has probably been answered on the web. It probably made some things easier for me on my first VPS, but after a bit of reading, I've decided to switch over to CentOS. CentOS is designed for enterprise use, and focuses on stability of the OS, which is perfect for servers. There are a few drawbacks, such as some packages being older, but nothing that isn't impossible to work around. With the announcement and patching of the Heartbleed bug/exploit, this is as good of a time as any to make this move. Even though I am not serving anything through SSL, I may in the future and don't want it to bite me later.

I started with taking a snapshot of the current Ubuntu server using DigitalOcean's web panel. I wanted to make sure I had a known-good configuration that I can fall back to if everything went to crap for some reason. I then created the new droplet, logged in as root, and started installing packages using yum. The only big issue I had to resolve was that CentOS only has Python 2.6.6, while I needed 2.7.* for Pelican. Since yum and some other things in the system rely on the system python, I had to install python2.7 in /usr/local/ Thankfully it was fairly straightforward to install using the make altinstall command.

Everything was smooth sailing from there. I updated my DNS entries to point to the new droplet. After that propagated sufficiently (I had a TTL of 30 minutes), I stopped the old droplet, took a final snapshot of it, and destroyed it. While it took a little bit of time for the migration, it was all very simple.


New Website

A while back I planned to start writing more. It started on Tumblr, but quickly fizzled out. I tried out Squarespace recently since I heard so much about them through the various podcasts I listen to. While it was nice and I would highly recommend it for many, it wasn't for me. They do have very nice templates and a great WYSIWYG system. Their iOS apps were great as well, and I used them to start a few draft posts. I just never got around to finishing them up on my computer and publishing them. I didn't like the fact that the only way to write and post on a computer is through their web interface. I like my native text editors too much, especially on the Mac, to give them up.

Then I realized VPS hosts are crazy cheap these days, with a basic plan at Digital Ocean coming in at $5/mo. There's also a ton of information avilable on the web to help if I bump into any issues. Here's how I've got everything setup.

This website and blog is generated using Pelican, a Python static site generator. I write the posts in Markdown and keep the drafts in Dropbox. Finished drafts are added to a git repository, which gets pushed to the servers repository. A post-update hook triggers Pelican to regenerate the site. Finally, nginx serves the content to the world.

The neat thing about this setup is I will always have a copy of all my writing, and switching platforms later isn't hard. I also have a solid handle on each part of the stack, or can find help through Google easily enough. The serving of the static pages is guaranteed to be fast. I can also quickly push updates and regenerate the site from anywhere I have access to an ssh client, which is pretty much anywhere I can get my iPhone/iPad/MBA online.

This isn't the right solution for everyone, but if you have some technical chops and want to have a personal website, there's little reason not to self-host. For everyone else, I can strongly recommend Squarespace. They have an amazing platform and really great templates that look and work well on both desktop and mobile platforms.


CMStepCounter Quirks

I've been playing with CMStepCounter in the iPhone 5s lately, and observed some interesting behavior. When I query the step counter minute by minute, steps occasionally get lost between the minutes. So sometimes querying steps for time1 to time2 and time2 to time3 results in a sum less than directly querying time1 to time3.

This looks like a bug with CMStepCounter or the M7 chip. I want to provide a consistent experience at least within the app, so for now I'm only querying for the smallest intervals I need, and summing those up for the less granular data points.

© Simon Yang. Built using Pelican. Theme by Giulio Fidente on github. .