Skip to content

Instantly share code, notes, and snippets.

View RobinWu's full-sized avatar

吴少斌 RobinWu

View GitHub Profile
"source $VIMRUNTIME/vimrc_example.vim
"""""""""""""""""""""""""""""""""""""""
"平台判断
"""""""""""""""""""""""""""""""""""""""
function! MySys()
if has("win32")
return "windows"
else
return "linux"
@alvin2ye
alvin2ye / dyndns-client.rb
Last active September 26, 2015 02:18
事先检查可以防止dyndns 抛 abuse
#!/usr/bin/ruby
# 自动同步 dyndns
# 事先检查可以防止dyndns 抛 abuse
DOMAIN = "xxx.dyndns-ip.com"
USER_PWD = "xxx:yyy"
IPREGX = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/
@RobinWu
RobinWu / backup.rake
Created January 20, 2011 06:21
backup rails log and mysql rake script
# m h dom mon dow command
# 0 3 * * * cd /var/www/do8 && /usr/bin/rake backup:log:all > /dev/null 2>&1
# 5 3 * * * cd /var/www/do8 && /usr/bin/rake backup:db:mysql RAILS_ENV=production > /dev/null 2>&1
# https://gist.github.com/787497
require 'fileutils'
namespace :backup do
desc 'backup log'
namespace :log do
# upload your file to tu.6.cn
# short url by tinyurl
# copy the url to you clipboard
require 'rubygems'
require "win32/clipboard"
include Win32
$filename = ARGV[0]
TYPES = %w{.jpg .gif .png .jpeg}
# http://gist.github.com/466673
# upload your file to tu.6.cn
# short url by tinyurl
# copy the url to you clipboard
require 'rubygems'
require "win32/clipboard"
include Win32
$filename = ARGV[0]
@trevorturk
trevorturk / gist:216549
Created October 23, 2009 02:10
nginx init.d
We couldn’t find that file to show.