Home

Installing OpenJDK8 or Oracle jdk8

Needed to do a project in Java8, here’s how to install openjdk8: sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-8-jdk sudo update-alternatives --config java # select openjdk8 sudo update-alternatives --config javac # select openjdk8 sudo apt-get purge maven maven2 maven3 ...

Read more

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