无远弗届

talk is cheap.


  • 首页

  • 分类

  • 归档

  • 标签

  • 公益404

  • 搜索
close

Creating a local yum repository mirror server

发表于 2016-12-27   |   分类于 Tech   |     |   阅读次数

安装配置Rsync服务

安装Rsync

1
$ yum -y install rsync

创建Yum Repository存放的目录

1
2
3
4
$ mkdir -p /opt/nginx/html/centos
$ mkdir -p /opt/nginx/html/epel
$ mkdir -p /opt/nginx/html/repoforge
$ mkdir -p /opt/nginx/html/exclude

创建Rsync同步脚本

1
2
3
4
5
6
7
8
9
10
11
12
$ cat <<EOF > /opt/nginx/html/rsync_cron.sh
#!/bin/bash
# Yum Repository Server.
/usr/bin/rsync -avrt --delete-excluded rsync://mirrors.tuna.tsinghua.edu.cn/centos/ --exclude-from=/opt/nginx/html/exclude/exclude_centos.list /opt/nginx/html/centos/
/usr/bin/rsync -avrt --delete-excluded rsync://mirrors.tuna.tsinghua.edu.cn/repoforge/ --exclude-from=/opt/nginx/html/exclude/exclude_repoforge.list /opt/nginx/html/repoforge/
/usr/bin/rsync -avrt --delete-excluded rsync://mirrors.tuna.tsinghua.edu.cn/epel/ --exclude-from=/opt/nginx/html/exclude/exclude_epel.list /opt/nginx/html/epel/
exit 0
EOF
阅读全文 »

Customization after Ubuntu 16.10 new installation

发表于 2016-12-26   |   分类于 Tech   |     |   阅读次数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
# Created By liuxiaohui @2016/12/26
## System
# system update
sudo apt update
sudo apt upgrade
# vim
sudo apt remove vim-tiny
sudo apt install vim
# terminator
sudo apt install terminator
# shutter
sudo apt install shutter
# rar
sudo apt install rar unrar
# bleachbit
sudo apt install bleachbit
# grub customizer
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt update
sudo apt install grub-customizer
# sougou pinyin
wget "http://pinyin.sogou.com/linux/download.php?f=linux&bit=64" -O "sougou_64bit.deb"
sudo dpkg -i sougou_64bit.deb
sudo sed -i 's/deb/#deb/' /etc/apt/sources.list.d/sogoupinyin.list
# chrome
wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" -O "chrome_64bit.deb"
sudo dpkg -i chrome_64bit.deb
# corebird
sudo apt install corebird
# proxychains
sudo apt install proxychains
sudo echo "socks5 127.0.0.1 1080" >> /etc/proxychains.conf
# shadowsocks
sudo apt install python-gevent python-pip
sudo pip install --upgrade pip
sudo pip install shadowsocks
sudo bash -c 'cat << EOF > /etc/shadowsocks.json
{
"server": "SHADOWSOCKS_SERVER_IP_ADDRESS",
"server_port": 9000,
"local_address": "127.0.0.1",
"local_port": 1080,
"password": "PASSWORD",
"timeout":300,
"method": "aes-256-cfb",
"fast_open": false,
"workers": 1,
"remarks": "",
"auth": false
}
EOF'
sudo bash -c 'cat << EOF > /home/$USER/.config/autostart/sslocal.desktop
[Desktop Entry]
Type=Application
Exec=/usr/local/bin/sslocal -c /etc/shadowsocks.json /dev/null 2>&1 &
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[zh_CN]=Shadowsocks
Name=Shadowsocks
Comment[zh_CN]=Shadowsocks
Comment=Shadowsocks
EOF'
# dropbox
wget "https://www.dropbox.com/download?dl=packages/ubuntu/dropbox_2015.10.28_amd64.deb" - O "dropbox_2015.10.28_amd64.deb"
sudo dpkg -i dropbox_2015.10.28_amd64.deb
proxychains dropbox start -i
## Media
# vlc
sudo apt install vlc
# media codec
sudo apt install ubuntu-restricted-extras
## Development
# develop tools
sudo apt install git make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils
# haroopad markdown editor
wget "https://bitbucket.org/rhiokim/haroopad-download/downloads/haroopad-v0.13.1-x64.deb" -O "haroopad-v0.13.1-x64.deb"
sudo dpkg -i haroopad-v0.13.1-x64.deb
# texlive pandoc
sudo apt intall texlive texlive-latex-extra pandoc
# bluefish
sudo apt install bluefish
# pyenv
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
cat <<EOF >> ~/.bashrc
# pyenv settings
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
EOF
# pyenv-virtualenv
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
exec "$SHELL"
# pycharm
wget "https://download.jetbrains.com/python/pycharm-professional-2017.1.3.tar.gz" -O "pycharm.tar.gz"
tar -xvf pycharm.tar.gz
mkdir ~/Application
mv pycharm-professional-2017.1.3 ~/Application/
# mysql-server
sudo apt install mysql-server
# mongodb
sudo apt install mongodb
# redis-server
sudo apt install redis-server

How to install CentOS7 with kickstart

发表于 2016-12-21   |   分类于 Tech   |     |   阅读次数

准备工作

关闭防火墙

1
2
$ systemctl stop firewalld
$ systemctl disable firewalld

关闭SELinux

1
2
$ setenforce 0
$ sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

配置Web服务

安装Nginx

1
2
3
$ wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
$ rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
$ yum -y install nginx

配置CentOS镜像

1
2
3
$ wget http://mirrors.163.com/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1611.iso
$ mkdir -p /usr/share/nginx/html/centos
$ mount -t iso9660 CentOS-7-x86_64-Minimal-1611.iso /usr/share/nginx/html/centos
阅读全文 »

How to install zcash cpu miner on CentOS6

发表于 2016-12-21   |   分类于 Tech   |     |   阅读次数

目前,Zcash钱包只有Linux版本,没有Windows版本;而能拿来开箱即用的Zcash Miner,却只有Windows版本,没有Linux版本,于是,如果想在Linux上挖矿,就只好自己编译了。

升级编译器

1
2
3
4
$ wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
$ yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran cmake libcxx
$ scl enable devtoolset-2 bash
$ source /opt/rh/devtoolset-2/enable

安装Boost

1
2
3
4
5
6
$ wget http://downloads.sourceforge.net/project/boost/boost/1.62.0/boost_1_62_0.tar.gz
$ tar -xzvf boost_1_62_0.tar.gz
$ cd boost_1_62_0
$ ./bootstrap.sh
$ ./b2
$ ./b2 install

安装Miner

1
2
3
4
5
6
$ git clone -b Linux https://github.com/nicehash/nheqminer.git
$ cd nheqminer/cpu_xenoncat/Linux/asm/
$ sh assemble.sh
$ cd ../../../Linux_cmake/nheqminer_cpu_xenoncat
$ cmake .
$ make -j $(nproc)
阅读全文 »

Make the python requests work via socks proxy on CentOS server

发表于 2016-07-27   |   分类于 Tech   |     |   阅读次数

让爬虫脚本拥有翻墙能力是很重要的:)

在CentOS上安装Shadowsocks

系统环境

1
2
3
4
5
6
7
8
9
$ cat /etc/issue
CentOS release 6.6 (Final)
Kernel \r on an \m
$ python --version
Python 3.5.2
$ pip --version
pip 8.1.2 from /usr/local/lib/python3.5/site-packages (python 3.5)

通过pip安装ShadowSocks

1
2
3
4
5
6
7
8
9
$ pip install shadowsocks
Collecting shadowsocks
Using cached shadowsocks-2.8.2.tar.gz
Building wheels for collected packages: shadowsocks
Running setup.py bdist_wheel for shadowsocks ... done
Stored in directory: /root/.cache/pip/wheels/c9/d8/ff/5425932823af361970658e9421b4d53ac50b08dcbe6fd41e5f
Successfully built shadowsocks
Installing collected packages: shadowsocks
Successfully installed shadowsocks-2.8.2
阅读全文 »

Hello World

发表于 2016-06-06   |   分类于 Tech   |     |   阅读次数

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

Xiaohui

Xiaohui

6 日志
1 分类
10 标签
RSS
GitHub Twitter Weibo Douban
Creative Commons
© 2016 - 2017 Xiaohui
由 Hexo 强力驱动
主题 - NexT.Pisces