Ubuntu install shadowsocks and switchyOmega

1. Install shadowsocks-qt5 GUI

$ sudo add-apt-repository ppa:hzwhuang/ss-qt5
$ sudo apt-get update
$ sudo apt-get install shadowsocks-qt5

2. Configure shadowsocks

  • ip: test.example.com
  • port: 4443
  • password: xxoo
  • Encryption method: AES-256-CFB
set proxy

3. Install switchyOmega

open google chrome apps, search switchyomega and add to chrome

add switchomega

4. Configure switchyOmega

  • add socks server for proxy
socks server
  • configure auto proxy
auto proxy

Rule list URL: https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt

5. Configure switch options in Interface

switch options

6. Enable switchOmega in chrome and enjoy

enable switchOmeg
CentOS upgrade to latest stable kernel

Upgrade

$ rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
$ rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
$ yum install yum-plugin-fastestmirror
$ yum --enablerepo=elrepo-kernel install kernel-ml

Configure the default startup version of kernel

$ cat /boot/grub2/grub.cfg | grep menuentry  // look over the list of kernel
$ grub2-set-default 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)'  // set the default startup kernel
$ grub2-editenv list // check result
$ grub2-mkconfig -o /boot/grub2/grub.cfg // enable grub.cfg

Other

Take a look the kernels had been installed

$ rpm -qa | grep kernel

Clean the useless kernel in the system

$ yum remove kernel-3.10.0-327.el7.x86_64
pip设置国内镜像

设置方法

  • 配置全局源

    在用户目录下创建pip.conf配置文件

      $ mkdir ~/.pip && vim ~/.pip/pip.conf
    

    加入如下配置, pip安装需要使用的https加密, 所以在此需要添加trusted-host

      [global]
      trusted-host = mirrors.aliyun.com
      index-url = http://mirrors.aliyun.com/pypi/simple
    
  • 手动指定源

      $ pip -i http://mirrors.aliyun.com/pypi/simple install lxml
    

pip常用国内镜像

http://pypi.douban.com/ 豆瓣

http://pypi.sdutlinux.org/ 山东理工大学

http://pypi.mirrors.ustc.edu.cn/ 中国科学技术大学

http://mirrors.aliyun.com/pypi/simple/ 阿里云

https://pypi.tuna.tsinghua.edu.cn/simple/ 清华大学

Windows 10 Error 0xc000007b Fix

Windows 10 Error 0xc000007b Fix

When you install games or software in windows 10, sometimes you will get this error 0xc000007b, just download the tool and install. The problem will be solved.

Mongodb Setup User and Password

  1. start container with auth

     $ docker run --restart=always --name demo_db -itd -v /data/mongo/db:/data/db  -p 27017:27017 mongo:3 --auth
    
  2. login the database inside docker, user and pwd is unnecessary.

     $ docker exec -it demo_db /bin/sh
     $ mongo
    
  3. add user as admin

     //administrator db
     $ use admin
        
     // add user 'root'
     $ db.createUser({user: "root", pwd: "demo#$%!", roles: [ {role: "userAdminAnyDatabase", db: "admin"} ] })
    
  4. exit, and login with the user ‘root’ and pwd

     $ mongo -u "root" -p "demo#$%!" --authenticationDatabase "admin"
    
  5. authorize

     $ db.auth("root", "demo#$%!")
    
  6. add user for bussness db

     $ use test_db
    
     // add user for test_db and assign read and write permission
     $ db.createUser({user: "test", pwd: "Test", roles: [ { role: "readWrite", db: "test_db" } ]})
    
  7. exit and login with the new user and pwd

     $ mongo -u "test" -p "Test" --authenticationDatabase "test_db"
    
  8. authorize again

     $ use test_db
     $ db.auth("test", "Test")
    
  9. finish and quit.

  10. if using mongoose to access the encrypted db

    mongoose.connect('mongodb://username:[email protected]:port/database?options...');