Skip to content

Instantly share code, notes, and snippets.

View url-encode.lua
local char_to_hex = function(c)
return string.format("%%%02X", string.byte(c))
end
local function urlencode(url)
if url == nil then
return
end
url = url:gsub("\n", "\r\n")
url = url:gsub("([^%w ])", char_to_hex)
View keybase.md

Keybase proof

I hereby claim:

  • I am liukun on github.
  • I am liukun (https://keybase.io/liukun) on keybase.
  • I have a public key ASBPe78wXkMNwdFmIT1OSTUvkl5idgh6YckMmii0IKyTEwo

To claim this, I am signing this object:

View logrotate.d__projc
/home/liukun/log/*.log {
daily
missingok
rotate 2
notifempty
copytruncate
}
View getgist
#!/usr/bin/env bash
if [[ "$1" =~ ^[0-9]+ ]]; then
curl -L "http://gist.github.com/$1/download" | tar zx --strip-components 1
exit 0
fi
curl -L "$1/download" | tar zx --strip-components 1
@liukun
liukun / istatd.cfg
Last active Aug 29, 2015
iStatD configurations
View istatd.cfg
# https://github.com/imvu-open/istatd/wiki/Configuring-istatd
--store /mnt/proC/istatd/store
--settings /mnt/proC/istatd/settings
--pid-file /mnt/proC/istatd/istatd.pid
--log-file /home/liukun/log/istatd.log
--log-level 2
--num-files 50000
--local-stats localhost
--thread-count 3
--stat-port 18001
@liukun
liukun / @LogStash
Last active Aug 29, 2015
Setup LogStash on test server
You can’t perform that action at this time.