This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install openvpn | |
| cp /usr/share/doc/openvpn/examples/easy-rsa/2.0 ~/ -r | |
| source ./vars | |
| ./clean-all | |
| ./build-ca | |
| ./build-key-server | |
| ./build-key | |
| ./build-dh | |
| sudo cp server.conf /etc/openvpn/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE DATABASE `databasename` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; | |
| CREATE USER 'user'@'localhost' IDENTIFIED BY 'mypass'; | |
| GRANT ALL ON databasename.* TO 'user'@'localhost'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # max-routes 600 | |
| route 1.51.0.0 255.255.0.0 net_gateway | |
| route 1.184.0.0 255.254.0.0 net_gateway | |
| route 27.148.0.0 255.252.0.0 net_gateway | |
| route 49.52.0.0 255.252.0.0 net_gateway | |
| route 49.120.0.0 255.252.0.0 net_gateway | |
| route 49.140.0.0 255.254.0.0 net_gateway | |
| route 49.208.0.0 255.254.0.0 net_gateway | |
| route 58.17.0.0 255.255.0.0 net_gateway | |
| route 58.18.0.0 255.254.0.0 net_gateway |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| D=$'\e[37;40m' | |
| PINK=$'\e[35;40m' | |
| GREEN=$'\e[32;40m' | |
| ORANGE=$'\e[33;40m' | |
| WHITE=$'\e[33;0m' | |
| YELLOW=$'\e[33;33m' | |
| function parse_git_dirty { | |
| [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
| } | |
| function parse_git_branch { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var element = $("#element"); | |
| var screenWidth = $(window).width(); | |
| var elementLeft = (screenWidth - element.outerWidth())/2 ; | |
| element.css('left', elementLeft + 'px'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| JAVA_HOME="/usr/local/jdk1.7.0" | |
| CLASS_PATH="$JAVA_HOME/lib:$JAVA_HOME/jre/lib" | |
| PATH=".:$PATH:$JAVA_HOME/bin" | |
| CATALINA_HOME="/usr/local/tomcat" | |
| export JAVA_HOME CLASS_PATH PATH CATALINA_HOME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~/project $ git init | |
| ~/project $ git add . | |
| ~/project $ git commit -m "first commit" | |
| ~/project $ cd ~/Dropbox/git | |
| ~/Dropbox/git $ mkdir project.git | |
| ~/Dropbox/git $ cd project.git | |
| ~/Dropbox/git $ git init --bare | |
| ~/Dropbox/git $ cd ~/project |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "中文嚟嘎".match(/\p{han}+/u) | |
| /@([\w\p{han}]{2,12})/ # 长度为@2-12的中英字符 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| skip_before_filter :verify_authenticity_token | |
| <%= tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_authenticity_token) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mongodump -h dbhost -d dbname -o output_directory | |
| mongorestore -h dbhost -d dbname --directoryperdb form_directory |