Skip to content

Instantly share code, notes, and snippets.

View laozhu's full-sized avatar
👨‍💻
Coding ideas

Ritchie Zhu laozhu

👨‍💻
Coding ideas
View GitHub Profile
@laozhu
laozhu / 42qu Reverse Proxy
Created September 28, 2012 10:13
42qu Reverse Proxy
server {
listen 80;
server_name supyer.com.42qu.com *.supyer.com.42qu.com;
client_max_body_size 512M;
location / {
expires -1;
set $realhost supyer.com;
if ($host ~ "(.*.supyer.com).42qu.com") {
set $realhost $1;
}
@laozhu
laozhu / gist:3847104
Last active October 11, 2015 10:47
gentoo basic setting
# /etc/conf.d/hostname
echo "HOSTNAME=\"mars\"" > /etc/conf.d/hostname
/etc/init.d/hostname restart
# /etc/resolv.conf
domain members.linode.com
search members.linode.com
nameserver 106.187.34.20
nameserver 106.187.35.20
nameserver 106.187.36.20
@laozhu
laozhu / gist:3847115
Last active October 11, 2015 10:48
/etc/make.conf @linode-512M-x86_64-gentoo
# /etc/make.conf @linode-512M-x86_64-gentoo
CFLAGS="-march=core2 -mtune=generic -O2 -pipe"
# CFLAGS="-march=corei7 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
USE="-X -accessibility -gpm -cups -alsa -apache2 -branding -apm
-encode -cairo -fontconfig -truetype -dbus -doc -emacs -examples
-gnome -gtk -kde -opengl -oss -qt4 bash-completion berkdb cgi
@laozhu
laozhu / gist:3847116
Last active October 11, 2015 10:47
gentoo upgrade the whole system
emerge --sync
emerge -av portage
emerge -av python
eselect python set python27
/usr/sbin/python-updater
emerge -avuDN world
emerge -av --depclean
revdep-rebuild
dispatch-conf
etc-update
@laozhu
laozhu / gist:3850560
Created October 8, 2012 03:24
install mysql
emerge -av mysql
eix-installed all | grep mysql
> dev-db/mysql-5.1.62-r1
emerge --config =dev-db/mysql-5.1.62-r1
# 加入开机启动项
rc-update add mysql default
/etc/init.d/mysql restart
rc-status
@laozhu
laozhu / gist:3850567
Last active October 11, 2015 11:17
install php
sudo vi /etc/portage/packge.use
# dev-lang/php fpm xml curl mysql ctype gd hash mysqlnd sqlite3 truetype tidy xmlreader xmlrpc xmlwriter
emerge -av php
rc-update add php-fpm default
/etc/init.d/php-fpm restart
rc-status
@laozhu
laozhu / gist:3850574
Created October 8, 2012 03:28
install nginx
emerge -av nginx
rc-update add nginx default
/etc/init.d/nginx restart
rc-status
@laozhu
laozhu / gist:3850586
Created October 8, 2012 03:31
nginx conf file
server {
listen 80;
server_name www.laozhu.me laozhu.me;
client_max_body_size 512M;
if ($http_host !~ 'www.laozhu.me') {
rewrite ^/(.*)$ http://www.laozhu.me/$1 permanent;
}
location / {
@laozhu
laozhu / gist:3850686
Created October 8, 2012 04:17
install phpmyadmin
mkdir www/phpmyadmin
cd www/phpmyadmin
wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.5.2/phpMyAdmin-3.5.2-all-languages.tar.bz2
tar jxvf phpMyAdmin-3.5.2-all-languages.tar.bz2
@laozhu
laozhu / gist:3850695
Last active October 11, 2015 11:18
nginx conf file phpmyadmin
server {
listen 80;
server_name sql.laozhu.me;
location / {
root /home/laozhu/www/phpmyadmin;
index index.php;
try_files $uri $uri/ /index.php;
}