Skip to content

Instantly share code, notes, and snippets.

View lanrion's full-sized avatar
🎯
Focusing

lanrion lanrion

🎯
Focusing
  • guǎng zhōu
View GitHub Profile
@lanrion
lanrion / gist:11163168
Created April 22, 2014 02:11
sudo tee
sudo tee
Usage: tee [OPTION]... [FILE]...
Copy standard input to each FILE, and also to standard output.
-a, --append append to the given FILEs, do not overwrite
-i, --ignore-interrupts ignore interrupt signals
--help display this help and exit
比如:
@lanrion
lanrion / gist:11104201
Created April 20, 2014 03:26
git remove remote cache file
git rm --cached asd
git commit -m "the file asd is gone from the repository"
@lanrion
lanrion / gist:10435761
Created April 11, 2014 01:17
vim快捷键
1, 翻页:
ctrl+f, ctrl+b 向下翻页,向上翻页
ctrl+d, ctrl+u 向下半翻页,向上半翻页
2,移动:
$ 移动行尾
0 移动行首
w 移动下一个词
@lanrion
lanrion / gist:10381833
Created April 10, 2014 13:23
linux 添加组,用户 命令
user
alias 和 alias_method 区别 ruby

1

class User

  def full_name
@lanrion
lanrion / gist:10241916
Created April 9, 2014 08:34
linux scp命令使用

scp是有Security的文件copy,基于ssh登录。操作起来比较方便,比如要把当前一个文件copy到远程另外一台主机上,可以如下命令。

scp  / home / daisy / full . tar . gz root@ 172.19 . 2.75 : / home / root

然后会提示你输入另外那台172.19.2.75主机的root用户的登录密码,接着就开始copy了。

如果想反过来操作,把文件从远程主机copy到当前系统,也很简单。

@lanrion
lanrion / gist:10015146
Last active August 29, 2015 13:58
git submodules
@lanrion
lanrion / gist:9967961
Last active August 29, 2015 13:58
multi_xml适配器模式的实现

摘自 multi_xml 适配器模式的实现,加载某个gem正常,则相应的使用某个解释器来解释XML

# Get the current parser class.
def parser
  return @parser if defined?(@parser)
  self.parser = self.default_parser
  @parser
end
@lanrion
lanrion / gist:9867179
Created March 30, 2014 03:45
手把手教你在ubuntu上安装apache和mysql和php