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.

NDN hackathon proposal: Clock setup for devices without hardware RTC

This is one of the proposals I submitted to the first Named Data Networking hackathon.

Motivation

Certain cheap devices, most notably the Raspberry Pi, comes without a hardware Real Time Clock (RTC), and relies on Network Time Protocol (NTP) to setup its clock during system boot. NTP is an IP based protocol which would not work in a pure NDN network. It's necessary to define an NDN based protocol for clock setup.

Approach

protocol design and demo system

Get NFD Connected

UPDATE 2021-06-01: nfdc command syntax changed since NFD 0.6.0. This article has been updated to include the new syntax.

Named Data Networking (NDN) is a potential future Internet architecture designed as a distribution network. My last post described how to deploy NDN Forwarding Daemon (NFD) on a low end box. Now it's time to get it connected.

The procedures and experiences in this post are applicable to any NDN node. If you aren't using a low end box, you may follow the official guide to install binary packages or compile from source. This post assumes you have ndn-cxx, nfd, and ndnping installed. You need access to two machines with NFD running; they are referred to as "local" and "remote".

Connect to Another Machine

After installing NFD on your machine, you can connect to any other machine running NFD. Although NDN can run natively above Ethernet, there isn't a global scale native NDN network yet because NDN is still in its early stage. Instead, NDN can run as an overlay network above traditional IP network. You can specify the IP address and port number of the remote NFD, so that NDN packets are encapsulated into UDP or TCP packets and sent to the remote NFD.

Deploy NDN Forwarding Daemon in Low End Box

Named Data Networking (NDN) is a future Internet architecture designed as a distribution network. To access NDN network from a Linux or OSX machine, one can install NDN Platform, a collection of software packages including the protocol stack and critical applications. NDN Forwarding Daemon (NFD), a core component of the architecture, serves as a software router and runs both on network routers as well as on end hosts to communicate with routers.

NDN Platform has new version releases periodically, and binary packages are provided with each platform release. However, the development of NDN software, including NFD, happens much faster than platform releases. If one wants to run bleeding edge software, those packages must be built from source code available on GitHub.

As a geeky low end box user, I'm thinking: can I run NDN platform on a Linux box with a small amount of memory? The box I'm talking about is an OpenVZ container from LowEndSpirit UK location, with only 128MB memory and no swap space. To make the challenge more interesting, I want to avoid apt-get, and run bleeding edge version built from source code.

Building on the Box

I quickly installed compilers and dependencies (such as libboost-all-dev which takes several minutes to download) with apt-get, and cloned the git repositories for NFD and other essential NDN Platform packages. Given that the box has small memory and slow CPU, I can expect the compilation process to take a few hours, just like 8 years ago when I was compiling Apache on a library computer.

Faster Content Distribution with Content Addressable NDN Repository

The effectiveness of universal caching in Named Data Networking depends on data naming. NDN routers cannot identify duplicate contents published under different Names. This paper proposes an enhancement to NDN repository so that duplicate contents could be identified by their hash, in order to save bandwidth and shorten download completion time. The repository indexes Data packets not only by Name, but also by hash of payload. Client applications could retrieve chunks by hash from a nearby neighbor. Therefore, the same payload does not have to traverse the Internet twice. Our evaluation shows that total download time for two Linux Mint disc images is reduced by up to 38%.

Download full report as PDF
Browse code repository

Build a Free SMS Robot with Google Voice

I have been look for a free SMS API since April, when my previous free SMS provider, IMified, announced its shutdown.

Zeep Mobile claims to be free forever (because it is ad-supported), but my sign-up is unanswered after a few weeks. Twilio and Tropo both give developers some free credit, but they charge money for production use. Other resources are suggesting an in-house solution: buy a SIM card with cheap / unlimited text plan, plug it into an old phone, and connect to the server; this still costs money, and is impossible for those using a VPS.

As a Google Voice user, I'm thinking: can I use Google Voice to build a free SMS robot?

Google Voice API

Google, the company who release an API for almost every product, does not provide a Google Voice API.

那些年,我做过的网站

2001年,我制作了第一个个人主页。10年过去了,让我来回顾一下,10年来我做过的网站。

以下列举了34个网站,只包含目前仍然在线、或者能够找到截图/源码的站点,且不包含某些非公开项目;实际做过的网站,大约在60个左右。部分截图来自Internet Archive Wayback Machine

2001 个人主页

  • 内容:自我介绍,我的第一张数码照片
  • 技术:FrontPage
  • 发布:通过电子邮件发给读者
个人主页 截图

2002 FredSoft

  • 内容:VB编程作品
  • 技术:手写HTML4
  • 发布:学校空间
FredSoft 截图

2002 个人文件夹

  • 内容:链接到子文件夹
  • 技术:手写HTML4、CSS、JavaScript
  • 发布:本地计算机个人使用,Windows 98的folder.htt功能
个人文件夹 截图