Migrated the Blog from Pelican to Hugo

I’ve been using pelican to build blog.ceshine.net for about two years, and as you can see, I’ve not been very productive. Part of the reasons is that I found I spent more time tuning the code rather than actually writing stuffs. Recently Go-based Hugo caught my attention. Go can easily compile multi-platform binary executables, which makes deployment much easier. Hugo also provide a decent built-in web server whose performance is good enough for some small-scale production use. So after some experimenting, I decided to replace the old pelican site with Hugo. ...

July 28, 2015 · Ceshine Lee

Bayesian Logistic Regression using PyMC3

I’ve been reading this amazing (free) book Bayesian Methods for Hackers. I was half way through in early 2015, but dropped it because of some nuisances. But when I finally restarted reading it, I found it might be a good thing that I stopped reading for a while. Now I have more appreciation of the Bayesian methods and more mathematical understanding to fully grasp the idea the book trying to convey. (To be honest, I was quite confused about some concept like MAP in the first round of reading) ...

July 11, 2015 · Ceshine Lee

Change Sources of Ubuntu in a Docker image

The official docker images of Ubuntu use archive.ubuntu.com as the default package source. Because my Internet connection is metered, I’d like to change it to the free mirror server my ISP provides. And this command does the trick: sed -i 's/http:\/\/archive.ubuntu.com/http:\/\/mirror.internode.on.net\/pub\/ubuntu/g' /etc/apt/sources.list Change http://mirror.internode.on.net/pub/ubuntu to the url of whatever mirror you prefer. And add RUN to the start of the line and put it into the Dockerfile.

July 7, 2015 · Ceshine Lee

Docker: Remove All Untagged Images

By courtesy of this post, its comment section and this thread: Clean up old containers docker ps -a | grep 'Exited' | awk '{print $1}' | xargs --no-run-if-empty docker rm Remove All Untagged Images docker rmi $(docker images -q --filter "dangling=true")

July 5, 2015 · Ceshine Lee

Random Sampling at the Command Line

When you receive a large dataset to analyze, you’d probably want to take a look at the data before fitting any models on it. But what if the dataset is too big to fit into the memory? One way to deal with this is to take much smaller random samples from the dataset. You’ll be able to have some rough ideas about what’s going on. (Of course you cannot get global maximum or minimum through this approach, but that kind of statistics can be easily obtained in linear time with minimal memory requirements) ...

January 22, 2015 · Ceshine Lee