Skip to content

Instantly share code, notes, and snippets.

View yiquncode's full-sized avatar

Alvin yiquncode

  • Tokyo
View GitHub Profile
config setup
uniqueids=never
conn %default
ikelifetime=60m
keylife=20m
rekeymargin=3m
rekey=no
keyingtries=1
keyexchange=ike
@yiquncode
yiquncode / gist:5220308
Last active December 15, 2015 06:59
rails基础分享,环境部署。
#对于新入门的开发者,如何安装 Ruby, Ruby Gems 和 Rails 的运行环境是个是棘手的问题,本页主要介绍如何用一条靠谱的路子快速安装 Ruby 开发环境。
#解决包的依赖关系
sudo yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
sudo yum install -y wget
wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
sudo rpm -ivh epel-release-5-4.noarch.rpm
sudo yum install -y readline* libyaml* libffi* libtool* bison* libxslt*
#安装RVM
@yiquncode
yiquncode / gist:3235211
Created August 2, 2012 08:12
copy IPHONE5.1 SDK to 10.6.8
sudo cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
sudo cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
sudo cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1\ \(9B176\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/
sudo rm -f /Developer/Platforms/iPhoneOS.platform/DeviceSupport/Latest
cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/
sudo ln -s ./5.1\ \(9B176\) ./Latest
@yiquncode
yiquncode / install_python26.sh
Last active October 7, 2015 03:28
install python26 in centos and replace the old version(2.4)
#python26#
wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
sudo rpm -ivh epel-release-5-4.noarch.rpm
yum -y install python26
ln -f /usr/bin/python2.6 /usr/bin/python
python -V
#EOF python26
#For python2.7#
@yiquncode
yiquncode / rewrite.conf
Created May 12, 2012 12:57
wordpress rewrite rule for nginx
# unless the request is for a valid file, send to bootstrap
if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
}
@yiquncode
yiquncode / scoll_text.html
Created March 24, 2012 02:34
JS实现新闻滚动
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<title>News</title>
<style type="text/css">
.box{width:635px; height:27px;line-height:27px; border:#bbb 1px solid; overflow:hidden;margin-left:-10px;margin-top:-15px;}
.box ul{margin:0; padding:0}
.box li{height:27px; font-size:12px; list-style-type:none;}
@yiquncode
yiquncode / 1.配置运行的环境
Created January 12, 2012 02:44
Run popular products in LAMP
建立 Apache 运行账户
useradd -d /data/www www
建立一个文件夹用于存放网站的文件
/data/www/wwwroot
注意事项
*每一次修改配置文件必须重新启动才会生效
*90%的问题是因为权限不对导致的
*从windows向Linux下传文件可以使用WinScp
@yiquncode
yiquncode / 1.Install_LAMP
Created January 11, 2012 02:22
for the hd users who need a easy doc to study how to install LAMP
1. 安装准备
1) 系统约定
软件源代码包存放位置 /root/src
源码包编译安装位置(prefix) /usr/local/software_name
Apache 网站根目录 /data/www/wwwroot(可按情况设置)
Apache 运行账户 www:www (useradd -d /data/www/;chown www.www /data/www/wwwroot)
2) 系统环境部署及调整
检查系统是否正常
# ifconfig(检查网卡设置是否正确)
# ping www.google.com (检查网络是否正常)
@yiquncode
yiquncode / gist:888230
Created March 26, 2011 12:19
issue_html2haml
Finished in 1.33 seconds
5 examples, 1 failure
rake aborted!
ruby -S bundle exec rspec "spec/html2haml_spec.rb" failed
/usr/lib/ruby/gems/1.8/gems/rspec-core-2.2.1/lib/rspec/core/rake_task.rb:139:in `initialize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1112:in `verbose'
/usr/lib/ruby/gems/1.8/gems/rspec-core-2.2.1/lib/rspec/core/rake_task.rb:131:in `send'
/usr/lib/ruby/gems/1.8/gems/rspec-core-2.2.1/lib/rspec/core/rake_task.rb:131:in `initialize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
@yiquncode
yiquncode / gist:863715
Created March 10, 2011 07:50
SHELL面试题
#!/bin/bash
#group add
for x in 'awk '{print $2}' user.list | sed 's/,/\n/g' | sort | uniq -c|sed 's/[^a-zA-Z]//g''
do
groupadd $x &> /dev/null
done
#back message