Skip to content

Author Archives: Anhang Zhu

I am a computer science student at UC Berkeley with a high interest in Social Networking, the Internet, and Web development in Ruby on Rails and jQuery.

Rails application failed to start properly

A bad deployment was preventing my rails server from booting up. production.log had nothing. Apache logs (~/logs//https/error.log) was empty. Stumped, I came across this article on FCGI from dreamhost: https://help.dreamhost.com/hc/en-us/articles/217298967-FastCGI-overview The tldr is that you can run `perl public/dispatch.fcgi` to get an error trace on what went wrong!

“Error: EPERM: operation not permitted, rename” on Windows+VirtualBox+npm (and Rails)

When using an Ubuntu VM on a Windows host, and developing on npm with a shared folder, you’re probably going to hit our “operation not permitted” error a lot. I installed browserify-rails on my rails app today, but i couldn’t compile my assets because of a series of issues with VirtualBox shared folders. Here are […]

Error: origin_mismatch when using Google OAuth on a non-localhost domain

Not developing on localhost? Google’s “Authorized JavaScript origins” list can only be configured to use localhost:port (e.g. http://localhost:3000) for development. This poses an annoying problem for those of us that are developing remotely or with a VM. My current setup has me running a Ubuntu VM using VirtualBox, on a Windows 10 host. Since the […]

Error when installing fcgi gem

If you’re getting this error when installing fcgi: Installing fcgi 0.9.2.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. you need to actually install FastCGI first. (`gem install fcgi` just installs the ruby bindings) Normally, `brew install fcgi` would be ok, but it looks like the fcgi library has been taken down. […]

Easy Rails deployment with rsync

Starting a new Rails app? I find one of the most annoying thing with writing code is the initial deployment. I just want to get my little app online! The fastest way to deploy Rails (or any) code to production is probably¬†rsync. rsync¬†is actually a tool used to keep files synchronized, by copying/deleting the files […]

[College Tips] Use less salt, eat less sodium

  In college, you will eat lots of high sodium meals and snacks. Energy drinks, soda, potato chips, burgers, fries, pizza, chicken strips, ramen, etc are all high in sodium. Since too much sodium is bad for you, try to consume less of it when cooking in your own apartment. Here’s a convenient and easy […]

[College Tips] Choosing EE/CS classes

For sometime now, I’ve been wanting to write about the tips and tricks I used to survive UC Berkeley and Berkeley EECS. The combination of my recent graduation and the incoming of a new class of freshmen has finally persuaded me to pick up the laptop and start typing. Let’s hope I have enough tips […]

A Tip to Recruiters

Here’s a pro tip to recruiters: format your emails. I automatically delete 90% of recruiter emails without reading, and in the rare occasion where I actually open your email, at least make it easy for me to read it. You have 10 seconds to pitch before I press shift-3. Also, don’t use an email address […]

HTML 5 Local Storage with Expiration

Not sure why expiration isn’t built into the HTML5 specs for LocalStorage, but I put together this little snippet today. It uses Modernizr (http://www.modernizr.com/) to check for LocalStorage support. AZHU.storage = { save : function(key, jsonData, expirationMin){ if (!Modernizr.localstorage){return false;} var expirationMS = expirationMin * 60 * 1000; var record = {value: JSON.stringify(jsonData), timestamp: new […]

Economic independence teaches the responsibility of freedom

While driving down the 85 today after work, I was really focused on the pressure of my foot against the gas pedel. I tried to step on it as lightly as I could to be as gas efficient as possible. In fact, for the past two weeks, I’ve been stretching those gallons of liquid gold. […]