Swarm's Blog

Perhaps

Install Shadowsocks on CentOS(server) and MacOS(client)

Yesterday I bought a linode 1024 VPS for many reasons, including break GFW
I decided to use Shadowsocks to achieve this goal.

  • First we need to update the CentOS system.
1
2
yum -y update
yum install build-essential autoconf libtool gcc -y   
  • Then install python-setuptools (which contains easy_install), pip, shadowsocks.
1
2
3
yum install python-setuptools
easy_install pip
pip install shadowsocks

Copy Python List Correctly

Consider the following statement:

1
a = [1, 2, 3]

It means that a points to the list [1, 2, 3] we just created, but a is not the list. If we do:

1
b = a

We didn’t copy the list referenced by a. We just created a new tag b and attached it to the list pointed by a.

If you modify a, you also modify b, since they point to the same list:

>>> a.append(4)

>>> print a    
[1, 2, 3, 4]    

>>> print b   
[1, 2, 3, 4]   

Does CentOS Also Have Something Like ‘Build-Essentials?’

‘Build essential’ is a Ubuntu / Debian package.
The official definition of build essential package is as follows:

If you do not plan to build Debian packages, you don’t need this package. Starting with dpkg (>= 1.14.18) this package is required for building Debian packages.

Start With Email, End With Email

Last night, or more precisely, this early morning, I had a strong feeling to write a letter to my boss to talk about my leaving again.
The thing is, I have talked with him on Monday, however, he insisted me to stay of course.
After a long talk, I compromised somehow and agreed to stay for one more year.
But then I found out that I’m still not happy and so willing to leave for Shanghai.
Thus that is how the long letter below comes:

First Post Using Octopress

Hello Octopress!

This is my first blog using octopress, and github pages as well!

Got much help from: Hello Octopress & Github Pages

Hope I will enjoy in the future.

My Chinese Blog (life and others): iswangheng.wordpress.com

Below are some hits on markdown

1
2
3
4
5
6
class TestPython:
    def __init__(self, para):
        self.para = para

    def foo(para):
        return '%s is an idiot! LOL' % str(para)

what the fuck

Test Codeblock in OctopressPython Official Site
1
2
3
4
5
6
class TestPython:
    def __init__(self, para):
        self.para = para

    def foo(para):
        return '%s is so damn cool! LOL' % str(para)