Skip to content

Instantly share code, notes, and snippets.

View notsobad's full-sized avatar

notsobad notsobad

View GitHub Profile

安装的版本:

esxi我测试多个版本,发现只有VMware-ESXi-5.5.0-Update2-2068190-HP-5.76.36-Sep2014.iso 这个版本可用。

几个参考链接:

class FakeClass():
def __getattr__(self, key):
def f(*args, **kwargs):
return
return f
f = FakeClass()
f.log('xxx', k1="xxxxx")
f.test('yyy', 'zzzz')
function escapeNonePrintable(_)
local fmt = string.format
return string.gsub(_, "[%z\1-\31,\127-\255]", function (x)
return fmt("\\%d",string.byte(x))
end)
end
print(escapeNonePrintable("a\tb\10c"))

先安装lua5.1, luajit v2.1, luarocks

vagrant@precise64:~$ lua -v
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
vagrant@precise64:~$ luajit -v
LuaJIT 2.1.0-alpha -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/
vagrant@precise64:~$ luarocks --version
/usr/local/bin/luarocks 2.2.2
LuaRocks main command-line interface
vagrant@precise64:~$ luarocks|grep "Lua version"
@notsobad
notsobad / gist:860749603a8fbb33e3c4
Last active August 29, 2015 14:22
install java
cd /opt/
tar xzvf ~/jdk-7u80-linux-x64.tar.gz
sudo update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_80/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_80/bin/javac 1
# vi ~/.bashrc
export JAVA_HOME=/opt/jdk1.7.0_80
@notsobad
notsobad / io.md
Created December 30, 2014 03:42
io

IO性能分析

iostat

$ iostat -x 1
Linux 3.5.2-x86_64-linode26 (linode)    11/08/2012      _x86_64_        (4 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.84    0.00    0.08    1.22    0.07   97.80

lua quick start

variable

num = 42
str = ‘hello’
is_ok = false

t = {key1 = 'value1', key2 = false}
@notsobad
notsobad / docker.md
Last active August 29, 2015 14:10
docker笔记

doker

install

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

sh -c "echo deb http://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list"

apt-get update