GCC -o file option

-o file

Place output in file file. This applies to whatever sort of output is being produced, whether it be an executable file, an object file, an assembler file or preprocessed C code.

If -o is not specified, the default is to put an executable file in a.out, the object file for source.suffix in source.o, its assembler file in source.s, a precompiled header file in source.suffix.gch, and all preprocessed C source on standard output.

Example :

gcc -shared hellomodule.o hello_wrap.o -o _hello.so

References :

https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html

Swappiness

– Open a terminal
– type in or copy/paste:

sudo gedit /etc/sysctl.conf

– a file will be opened
– add the following line at the bottom of that file:

# Swappiness
vm.swappiness = 10
vm.vfs_cache_pressure = 50

– save the file and close it.

After rebooting the swappiness is set to 10. This can be checked by running the following command in a terminal:

sudo cat /proc/sys/vm/swappiness

References :

https://sites.google.com/site/tipsandtricksforubuntu/system-tips/swappiness
https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

Install Oracel Java on Linux

/usr/local/java/jdk1.8.0_66
sudo gedit /etc/profile
JAVA_HOME=/usr/local/java/jdk1.8.0_66
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_66/jre/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_66/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_66/bin/javaws" 1
sudo update-alternatives --set java /usr/local/java/jdk1.8.0_66/jre/bin/java
sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_66/bin/javac
sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_66/bin/javaws
. /etc/profile

References :

http://www.wikihow.com/Install-Oracle-Java-on-Ubuntu-Linux

Configure Shadowsocks via Config File

apt-get install python-pip
pip install shadowsocks
apt-get install python-m2crypto

You can use a configuration file instead of command line arguments.

Create a config file /etc/shadowsocks.json. Example:

{
    "server":"my_server_ip",
    "server_port":8388,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"mypassword",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

To run in the foreground:

ssserver -c /etc/shadowsocks.json

To run in the background:

ssserver -c /etc/shadowsocks.json -d start
ssserver -c /etc/shadowsocks.json -d stop

References :

https://github.com/shadowsocks/shadowsocks/wiki/Configuration-via-Config-File
https://github.com/pobizhe/shadowsocks/wiki/Encryption