Home

Installing Pypy3

Go to http://pypy.org/download.html and find the download link and wget/extract it. wget https://bitbucket.org/pypy/pypy/downloads/pypy3.3-v5.2.0-alpha1-linux64.tar.bz2 tar xfj pypy3.3-v5.2.0-alpha1-linux64.tar.bz2 Preferably move it to /opt/ or /usr/local/: sudo mv pypy3.3-v5.2.0-alpha1-linux64 /opt/ Install pip and virtualen...

Read more

Upgrade MySQL to 5.7

First, go to https://dev.mysql.com/downloads/repo/apt/ and click “Download” button, on next page, copy the link that says “No thanks, just start my download.”, it should point to something like https://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb Use the link to wget the file. then sudo dpkg -i mysql-apt-config_0.7.3-1_all.deb Selec...

Read more

Creating Swap File

I ordered a ECS from Aliyun, it come without a (virtual) swap drive. Here are the steps to create one: sudo dd if=/dev/zero of=/swapfile bs=1G count=2 sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile A 2G swap space is created and activated. To make it available at next reboot: sudo vi /etc/fstab add this...

Read more

webpack babel error

If you see something like this when you do webpack: ERROR in ./app/app.js Module build failed: Error: Couldn't find preset "es2015" relative to directory "/home/yourname" That’s becuase you have a .babelrc in your home directory but not in your project directory. To get rid of this error, either deleting the .babelrc in your home directory o...

Read more

Gdal SVG support

I wanted to convert a SVG file to GeoJSON. Gdal command ogr2ogr is supposed to support these 2 formats. But when I tried it: $ogr2ogr -f GeoJSON circle.json circle.svg FAILURE: Unable to open datasource `circle.svg' with the following drivers. It then listed drivers that includes both geojson and svg. What’s going on? Turns out that gdal o...

Read more

Using Letsencrypt

update: Because of API change, the command line now should have additional ‘-f account_key.json’. The full example command is: $simp_le -d example.com:/var/www/sites/example_com/server -f key.pem -f cert.pem -f fullchain.pem -f account_key.json Let’s Encrypt entered public beta 2 days ago. It also happened that I have a SSL certificate that ...

Read more

What to blog

Even though I promised myself I would blog more, I just cant think of what to blog. I learned a lot lately, but putting them in writings in a coherent manner is quite a challenge. These days my minds seems scattered around all over the places, there is clearly lack of focus and even priorities. I really should be taking a pause from time to t...

Read more

Setting Up Blog

I set up this blog using Github Pages today. I actually had a blog, but it’s hosted on Google’s Blogger, which is not accessable in China. I spend the majority of my time in China now, even though I can access the blog with VPN, it’s still inconvinient. That’s why I set up this blog. I hope I promise myself I will write more blog posts than I...

Read more