Home

EC2 Azure GCP reserved VM price comparison

I was looking for a small virtual machine (or VPS virtual private server) for development. Normally I would go with either digitalocean or linode. Their prices are the same: $10 per month for 2GB vm and $20 for 4GB. Because I know I will be using this VM for more than a year, I started look into the VM’s that offered by big 3 cloud providers ...

Read more

apeflac2mp3

apeflac2mp3 is a Python script I wrote to bulk convert APE, FLAC or other music files to mp3. I have a lot of musics in APE and FLAC formats, for example this gem: Mozart Complete Works [Brilliant] 170 CDs. It has 170 FLAC files, one for each CD. Each FLAC file also have a cue file that tells title and start time for every tracks in the FLAC f...

Read more

Installing Streisand on Linode

Streisand is a set of Ansible playbooks that set up a VPN automatically. It can create a new virtual machine on one of the cloud providers, such as Linode, from a remote server. Since I already have a spare Linode, I decided to set up Streisand on that server locally. Streisand run only on Ubuntu 16.04, my linode is 16.04 so it’s all good. S...

Read more

How to stream from RaspberryPi PiCamera

Pre-requisites OS: Raspbian >= 8 Do sudo raspi-config and enable PiCamera, in ‘Memory Split’, give GPU more than 128M of memory. Connect PiCamera, reboot. Test PiCamera works by raspistill -o photo.jpg. Load v4l2 module: sudo modprobe bcm2835-v412 Optionally add bcm2835-v412 to /etc/modules file. v4l2 should already present in the OS...

Read more

Using Squid as the internal http proxy

I moved to a new building. In the old building I used to have a few Linux machines and virtual machines connected to internet directly. Now we are on a temporary network, all our machines and VMs are behind a firewall. To connect a machine to internet, I have to open the browser from that machine and load the login page, enter my username and...

Read more

Set up both 32 and 64 bit Anaconda on Windows

I need to have both 32 bit and 64 bit Python on my Windows machine. For 32 bit, I only need Python 2. First, I installed Anaconda 4.3 into my home directory (C:\Users\wensheng). Then I downloaded Miniconda Python 2.7 32-bit installer. I run the installer as usual, but at the last step, where it ask if you want to add path to environment, unc...

Read more

Move files from all sub-directories to current directory

On Linux or Windows (with Windows Subsystem for Linux, or Bash on Ubuntun on Windows ), if you want to move all files from all sub-directories to the current one, do this: find ./*/ -type f -exec mv -t . '{}' + You can then remove all those empty directories: find ./* -type d -exec rmdir '{}' +

Read more

Blog update

These is a post on HN today about “Replacing Disqus with GitHub Comments”. I had Disqus, I forgot why it stopped working or maybe I just never enabled it in the first place. So I took this opportunity to add comment to this blog, using the method suggested in that post - Github Issues. I also removed Swiftype search. It worked for a while th...

Read more