-
gcc -M hello.c可以得到某文件依赖的头文件。 -
grep processor /proc/cpu_info显示当前的CPU数目 -
sudo shutdown -r now重启机器 -
sshfs yourname@host:/path/to/your/dir ~/localsshfs挂载到本地 -
sudo -u fleuria bash: 切换用户
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
| #Newbie programmer | |
| def factorial(x): | |
| if x == 0: | |
| return 1 | |
| else: | |
| return x * factorial(x - 1) | |
| print factorial(6) | |
| #First year programmer, studied Pascal |
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
| #Person | |
| class Person | |
| end | |
| #class method | |
| class Person | |
| def self.address | |
| puts "hangzhou" | |
| end | |
| end |
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
| #0> non-block call | |
| Thread.new do | |
| blahbla... | |
| end | |
| #1> 4 simple ways to call shell or cmd | |
| `ps aux` |
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
| def block_new | |
| puts Proc.new.call | |
| end | |
| block_new{"hello"} | |
| #slow practice | |
| def herp_pass_block(&block) | |
| derp_call_block &block | |
| end |
This is a Quick Guide to deploy OpenStack IceHouse on top of Ubuntu 14.04, it is IPv6-Ready!
It is compliant with OpenStack's official documentation (docs.openstack.org).
The tenant's subnets are based on Neutron, with ML2 plugin and Single Flat Network topology, dual-stacked.
The Single Flat Network is the simplest network topology supported by OpenStack (I think). So, it is easier to understand and follow.
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
| from sre_parse import Pattern, SubPattern, parse as sre_parse | |
| from sre_compile import compile as sre_compile | |
| from sre_constants import BRANCH, SUBPATTERN | |
| class Scanner(object): | |
| def __init__(self, tokens, flags=0): | |
| subpatterns = [] | |
| pat = Pattern() |
- HTTP 形式:
git clone https://github.com/owner/git.git
- SSH 形式:
git clone [email protected]:owner/git.git