Install GNU gcc 4.8.2 on CentOS 6.4

Install pre-requirements: % yum install gmp-devel mpfr-devel  libmpc-devel Download and extract gcc 4.8.2 source tar ball: % curl -O ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.gz; tar zxf gcc-4.8.2.tar.gz % cd gcc-4.8.2; ./configure –enable-languages=c,c++ –disable-multilib Build and install: % make; make install

Date
Categories
Tags
Comments

Published:November 5, 2013 View Post

Uncategorized

Leave a comment

Crop image in golang

In python, for cropping  image I use PIL. However the dependencies of PIL is huge, also need to install some lib*-dev packages. So I choose go to crop images: Usage: % go run crop.go large.jpeg thumbnail.jpg

Date
Categories
Tags
Comments

Published:October 4, 2013 View Post

golang

Leave a comment

Create file with random string in python

#!/usr/bin/env python import string import random out_file = ‘text_file.txt’ file_size = 1024 * 1024 rands = lambda x: ”.join(random.choice(string.letters + string.digits) for x in xrange(x)) with open(out_file, ‘w’) as f: f.write(rands(file_size))

Date
Categories
Tags
Comments

Published:July 24, 2013 View Post

python

Leave a comment

Increase uwsgi_buffer_size to run django-openid-auth on dotCloud

To enable Django OpenID authentication, I choose django-openid-auth. But when I deploy to dotcloud, there’s a ’404′ as welcome message :p

Date
Categories
Tags
Comments

MySQL Connector C++ on Ubuntu 10.04 LTS

I’ve trying to use MySQL Connector C++ for my project, here the example code (retrieved from official site):

Date
Categories
Tags
Comments

Published:March 6, 2012 View Post

database

Leave a comment

Compile and Install Growl 1.3 via XCode 4.3 on Lion

Growl notifier has been updated to 1.3.x last year, and it also became a paid software. Since it’s open-sourced, so I decided to build it myself. The steps are quite simple, just follow the documentation you will be fine. Just be sure you have mercurial (hg) command line tools.

Date
Categories
Tags
Comments

Published:February 17, 2012 View Post

mac

Leave a comment

WordPress on dotcloud

My AWS EC2 free tier is expired, so I switched to a fully-dotcloud-hosted site (originally I’ve host MySQL on dotcloud). Here are some notes we need to take care.

Date
Categories
Tags
Comments

Using ssh to upgrade wordpress plugins

Using ftp to upgrade wordpress plugins is not a safe way: you will need to open the ftp port and have a ftpd daemon just for upgrading wordpress.

Date
Categories
Tags
Comments

Published:August 17, 2011 View Post

wordpress

Leave a comment

MySQL on dotcloud

To run MySQL on dotcloud is very easy, just follow the documentation:

Date
Categories
Tags
Comments

Deploy django project to dotCloud

QuickNote: follow the Official guide may not be enough.

Date
Categories
Tags
Comments

Published:June 22, 2011 View Post

python

1 Response