Skip to content

Instantly share code, notes, and snippets.

View liyang85's full-sized avatar

Yang Li liyang85

View GitHub Profile
@liyang85
liyang85 / .cvimrc
Last active August 6, 2018 02:36
my .cvimrc for cVim extension of Google Chrome
set noautofocus
let blacklists = ["https://checkvist.com/*","https://inbox.google.com/*","https://calendar.google.com/*","https://drive.google.com/*","https://keep.google.com/*","https://mail.google.com/*","https://mubu.com/*","https://leanote.com/*","https://docs.google.com/*","https://mynoise.net/*","https://onedrive.live.com/*","https://kiwivm.64clouds.com/*","https://dida365.com/*","http://localhost/*","https://dynalist.io/*","http://cv.ftqq.com/*","https://todoist.com/*","https://www.youtube.com/*"]
let mapleader = ","
map <Leader>x :restore<Space>
" You can use <Space>, which is interpreted as a
" literal " " character, to enter buffer completion mode
@liyang85
liyang85 / change-hostname-on-centos.sh
Created September 13, 2017 06:47
Change hostname on CentOS
# Part 1: CentOS 6
vim /etc/sysconfig/network
HOSTNAME=my_hostname
source /etc/sysconfig/network
# `hostname` can set the host name until reboot,
# it also can show the host name
hostname
@liyang85
liyang85 / yum-install-fail2ban-on-centos6.sh
Created August 17, 2017 04:23
Install Fail2ban to protect SSH on CentOS 6
# part 1: installation
yum install epel-release
yum install fail2ban
# part 2: configure local settings
#
# You can find a file with default values called `/etc/fail2ban/jail.conf`.
# Since this file may be overwritten by package upgrades, we shouldn't edit it in-place.
# Instead, we'll write a new file called `/etc/fail2ban/jail.local`.
@liyang85
liyang85 / compile-php-5.3.27-and-run-as-fastcgi-mode.sh
Last active April 8, 2020 13:46
Compile php-5.3.27 and run as FastCGI mode with Nginx & MySQL
cd /home/oldboy/tools
# 1. Install dependencies
# Part 1: yum install
yum install -y \
freetype-devel \
gd-devel \
libcurl-devel \
libjpeg-turbo-devel \
libpng-devel \
@liyang85
liyang85 / essential-settings-after-centos69-minimal-installation.sh
Last active July 13, 2017 06:06
最小化安装CentOS 6.9之后的必要设置
# Part 1: network
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.ori
sed -i 's/ONBOOT=no/ONBOOT=yes/; s/BOOTPROTO=dhcp/BOOTPROTO=none/' /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i '$a IPADDR=192.168.6.240\nPREFIX=24\nGATEWAY=192.168.6.1' /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i '$a DNS1=223.5.5.5\nDNS2=119.29.29.29' /etc/sysconfig/network-scripts/ifcfg-eth0
ifdown eth0 && ifup eth0
# If you use a VMware cloned virtual machine, you'll see an error:
# `Device eth0 does not seem to be present, delaying initialization.`, you can change DEVICE name and HWADDR to solve it.
cat /etc/udev/rules.d/70-persistent-net.rules
@liyang85
liyang85 / yum-install-pip-centos7.sh
Last active June 13, 2017 07:15
How to Install Pip on CentOS 7
# copy from https://www.liquidweb.com/kb/how-to-install-pip-on-centos-7/
# First, we’ll install the EPEL repository
yum install epel-release
# As a matter of best practice we’ll update our packages:
yum -y update
yum -y install python-pip
# Check the version of Pip that is installed: