Nolan's Blog

a PHP JS UI APP developer

Linux

CentOS 6.5 PHP Update to 5.4 5.5 5.6

A best rpm:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

yum install php(54w/55w/56w) php55w-bcmath php55w-cli php55w-common php55w-devel php55w-fpm php55w-gd php55w-imap php55w-ldap php55w-mbstring php55w-mcrypt php55w-mysql php55w-odbc php55w-pdo php55w-pear php55w-pecl-igbinary php55w-xml php55w-xmlrpc php55w-opcache php55w-intl php55w-pecl-memcache

继续阅读》

Install / Setting vsftp in CentOS

1. Install
yum install vsftp

2. Config
vi vsftpd.conf


# turn off anonymous login
anonymous_enable=NO
# use userlist user for ftp
userlist_deny=NO
# open passive mode
pasv_enable=YES
pasv_min_port=10000
pasv_max_port=10010
# login banner
ftpd_banner=Welcome to Putike.cn

3. Create user for ftp
useradd –s /sbin/nologin –d /ftp/home/path username
passwd username

4. Add user to userlist
vi user_list

5. Virtual user if need
a. create virtual user list
touch vuser
eg:
username
password

b. build users db
db_load –T –t hash –f /etc/vsftpd/vuser /etc/vsftpd/vuser.db

c. edit /etc/pam.d/vsftpd, add lines:


auth required pam_userdb.so db=/etc/vsftpd/vuser
account required pam_userdb.so db=/etc/vsftpd/vuser

d. config vsftp


guest_enable=YES # enable guest
guest_username=vuser # user vuser db
pam_service_name=vsftpd # use pam

e. set virtual user config path
user_config_dir=/etc/vsftpd/vsftpd_user_conf

f. config the virtual user settings accoring to your needs.
touch username


anon_world_readable_only=NO # view ftp path
anon_upload_enable=YES # allow download
anon_mkdir_write_enable=YES # create and delete dir
anon_other_write_enable=YES # rename or delete file
local_root=/path/ # define user's root 

继续阅读》

, ,

Ubuntu Install and Use Shadowsocks+privoxy

1. INSTALL Shadowsocks-qt5
The document and help on Github is here.
(Github 上有中文安装说明,但是要跳转几次。[传送门]


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

2. Start Up
Setting server,port,username..(GUI). Not say more.

3. privoxy
INSTALL:
apt-get install privoxy
CONFIG:
vi /etc/privoxy/config
INSERT A NEW LINE
forward-socks5 / 127.0.0.1:1080 . (注意最后的点不是我失误
RESTART privoxy
service privoxy restart

继续阅读》

, , ,

Use proxychains to set up a proxy for some program in Linux

Install:
ubuntu apt-get install proxychains
Document: http://proxychains.sourceforge.net/howto.html

Settion:
Config files be loaded order by:
1) ./proxychains.conf
2) $(HOME)/.proxychains/proxychains.conf
3) /etc/proxychains.conf
So change the config in etc/ or create a new one in $home

Config:


## Order by list. auto skip the failed proxy
#dynamic_chain

## Order by list. not skip
strict_chain 

## Order by random
#random_chain

[ProxyList]
## Add the Proxy list, Eg: shadowsocks
socks5 127.0.0.1 1080

To use it:


proxychains ./sudio.sh 

继续阅读》

, ,

Ubuntu Mount the Windows’ partition

Sometime, we need share the folder for word, likes apache’s root path or any other project’s folder.
So we need mount the other partition on start-up Ubuntu.

Step:
1. CMD sudo blkid
View all the partition of disks.


/dev/sda1: LABEL="SYSTEM" UUID="6A4031254030F981" TYPE="ntfs" PARTUUID="c52dc52d-01"
/dev/sda5: LABEL="WORK" UUID="841C686D1C685C64" TYPE="ntfs" PARTUUID="c52dc52d-05"
/dev/sda6: LABEL="DOCUMENT" UUID="E604677704674A1F" TYPE="ntfs" PARTUUID="c52dc52d-06"
/dev/sda7: LABEL="OTHER" UUID="D2AC7ADBAC7ABA15" TYPE="ntfs" PARTUUID="c52dc52d-07"
/dev/sdb1: UUID="6efcb250-6c3c-4b2b-a9c5-3e3857d5c680" TYPE="ext4" PARTUUID="3051b101-01"
/dev/sdb5: UUID="6ec85b42-afc6-4e48-bee9-65c6028d514b" TYPE="swap" PARTUUID="3051b101-05"

2.Update config vim /etc/fstab
Each line need contain the following contents:
<file system> <mount point> <type> <options> <dump> <pass>
<file system> : Partition positioning, UUID or LABEL. Eg: /dev/sda2
<mount point> : Mount point, Eg: /media/C
<type> : Partition type. Eg: ntfs or fat32
<options> : default option is defaults
<dump> : Backup partition, default is 0
<pass> : Check partition, default is 0

Add your new partition:


# disk WORK
/dev/sda5 /media/nolan/WORK/ ntfs defaults 0 0

3. Test
sudo mount -a

4. Options
About the options

async / sync
(Yes/Not) Synchronous
Recommend “async” (better performance).

auto / noauto
(Yes/Not) Auto mount
Default is “auto”.

rw / ro
Read and Write / Read only

exec / noexec
(Yes/Not) Executable
This option will control the all files in partition can be execution or not.

user / nouser
(Yes/Not) Allow default user mount partition.
Generally, we choose not allow.

suid/nosuid
(Yes/Not) Have suid auth.
Allow SUID ?

defaults is same of “rw, suid, dev, exec, auto, nouser, async”.

继续阅读》

, ,

Ubuntu 14.10 mirrors

apt-get update ## update repos
apt-get dist-upgrade ## update package

sohu源:

deb http://mirrors.sohu.com/ubuntu/ utopic main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ utopic-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ utopic-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ utopic-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ utopic-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ utopic main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ utopic-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ utopic-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ utopic-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ utopic-backports main restricted universe multiverse

aliyun源:

deb http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse

163源:

deb http://mirrors.163.com/ubuntu/ utopic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ utopic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ utopic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ utopic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ utopic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ utopic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ utopic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ utopic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ utopic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ utopic-backports main restricted universe multiverse

继续阅读》

, ,

Backup 备份一下自己的Vim设置/插件

插件

ctags:
先生成tags文件,在命令行下进入到你的项目文件,执行命令:ctags -R,在当前目录下就会生成一个tags文件,生成tags数据库索引,在gvim中执行:


set tags=/home/cry/test/tags

需要进行函数名、变量名、结构名、结构成员补全时输入 Ctrl+X Ctrl+O, (
需要头文件名补全时输入 Ctrl+X Ctrl+I,
需要文件路径补全时输入 Ctrl+X Ctrl+F,
需要跳转到函数的定义处 Ctrl+] 或 Ctrl+左键单击

NERD_tree:一个文件管理工具

project:一个项目管理工具

winmanager:界面管理

Emmet.vim:zenCoding工具,前段必备

git-vim:git工具

xptemplate:代码片段补全 使用“Ctrl+l,”代码补全

下载:vim_2014_1.zip

继续阅读》

,

SVN的安装配置

一.安装subversion

首先安装服务端程序subversion1.x.x和客户端程序TortoiseSVN-1.x.x.xxxx(是两个网站)。subversion在服务器端客户端都需要安装,TortoiseSVN只要在客户端安装就行。TortoiseSVN的语言包下载和TortoiseSVN的下载都在其官网的同一页。

如果使用了eclipse并且用插件的话,则可以不用TortoiseSVN。

从 http://subversion.tigris.org/downloads/subversion-1.3.2.tar.gz 下载最新版的Subversion源码包解压后运行
或者直接yum啦

./configure –prefix=/subversion
make
make install

二.创建资料库

/subversion/bin/svnadmin create /home/sub_ku

继续阅读》

, , ,

Powered by WordPress.org.