How to Survive a Weekend Offline?

I'm a heavy smartphone user. I read emails, access Twitter, check in on Swarm/Foursquare, watch YouTube, and look at weather forecast, multiple times a day. I use smartphones so much that my primary phone, the Nexus 5, needs to be charged 2~3 times per day, and I am reluctant to stay in places without free WiFi.

But, everything is changing in the past weekend: I joined a camping trip to Grand Canyon National Park. There is no electricity. There is no cellular signal, because national parks do not want cell towers to ruin the beautiful landscape. There is no WiFi, except in the cafeteria which we may or may not visit. Without electricity, I cannot keep my smartphones charged. Without cellular or WiFi, I cannot receive emails, access Twitter, check in on Swarm/Foursquare, watch YouTube, or use weather forecast apps. How can I survive the weekend in the national park, without electricity or Internet access?

Preparation

Internet access is unavailable, but it's not the only way to communication with the outside world. On many smartphones, there's a forgotten app called the FM radio, which allows you to receive information without Internet access or cellular signal. Therefore, I packed an old smartphone, the T-Mobile Comet, which has an FM radio tuner. This would allow me to listen to the weather forecast, and maybe some news and music.

My camping trip is a short one: we depart on Friday and return on Sunday. The lack of electricity can be solved by a few USB PowerBanks. I brought two USB PowerBanks, which contain a total of 12800mAh of electricity, enough to charge the Nexus 5 five times, or the T-Mobile Comet ten times.

My Experience at Hack Arizona 2016

Hack Arizona is the largest collegiate hackathon in southwestern United States. I attended Hack Arizona 2016 and had a great experience, and I want to share what I experienced during this event.

Why I didn't attend in 2015

I heard about Hack Arizona when it started in 2015, but I decided against attending last year because 37 sleepless hours is harmful for health and won't produce high quality project.

Many of my friends went in 2015, and they shared their experiences and showed me their projects. The situation sounds less scary than I imagined:

  • Although you are provided enough coffee and Red Bull energy drinks to stay up, you are permitted to leave and re-enter at anytime, and you can sleep in the venue as well.
  • There's free food, and it's not just pizza.
  • Projects aren't of poor quality.

parallelize.sh: run commands in parallel with bash

Recently I'm doing some heavy research work. One part of my work involves invoking a simulation script with different inputs and parameters and then an analysis script to analyze the simulation output.

At first, this is an easy bash loop:

(
  echo 3 11
  echo 3 11
  echo 5 19
  echo 5 19
) | while read -r -a L; do
  X=${L[0]}
  Y=${L[1]}
  python2 simulation.py --x=$X --y=$Y < input.tsv > $X-$Y.simulation.log
  gawk -f analysis.awk $X-$Y.simulation.log > $X-$Y.analysis.tsv
done

The loop works fine, but it takes too long time when the input gets larger, because scripts are running sequentially. Since we have a big server with 32 CPU cores, can I run the scripts in parallel?

So I wrote this nifty little script, parallelize.sh:

Share Dropbox between VirtualBox Host and Guest

My laptop comes with Windows, like most other laptops in the market. But as a computer science student, I need to use Linux from time to time. The laptop manufacturer advised me not to install Linux directly on this laptop. Although this would not void my warranty, they would not provide technical support or supply device drivers if I install Linux. Therefore, I turned into VirtualBox, a hypervisor that allows me to run Linux in a virtual machine, alongside the Windows installation.

I'm also a heavy user of Dropbox, a file hosting service that can synchronize my documents among all my device. I have Dropbox clients installed everywhere, including the Windows of this laptop, and the Linux virtual machine. When I edit a file, the Dropbox client uploads this file to the cloud, and then the Dropbox clients on all other devices download the file from the cloud.

One day, there's a congestion on my apartment's WiFi hotspot, and I notice that the Dropbox synchronization between Windows and the Linux virtual machine is having significant delay: every update travels a long way to the cloud, and then comes back. I also realize that, in my setup, the entire Dropbox contents are duplicated twice: it has one copy in Windows, and another copy in Linux virtual machine. Although having multiple copies is usually a good thing because you have more redundancy, having multiple copies on the same hard drive is not useful. Can I eliminate the synchronization delay and the redundant copy?

VirtualBox Shared Folder

VirtualBox has a nifty feature, shared folders, which allows files of the host system to be accessed within a guest system. In my setup, I could use this feature to access the Dropbox on Windows within the Linux virtual machine.