This file contains 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
/* | |
Serve is a very simple static file server in go | |
Usage: | |
-p="8100": port to serve on | |
-d=".": the directory of static files to host | |
Navigating to http://localhost:8100 will display the index.html or directory | |
listing file. | |
*/ | |
package main |
This file contains 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
@echo off | |
cd "%~dp0" | |
backup-mysql.cmd | |
backup-mssql.cmd |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Threading.Tasks; | |
using System.Web.Http; | |
using System.Web.Http.Dispatcher; | |
using System.Web.Http.SelfHost; | |
namespace SelfHost | |
{ |
This file contains 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
# 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 |
This file contains 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
#!/bin/bash | |
sudo apt-get -y install dialog | |
DIALOG=${DIALOG=dialog} | |
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$ | |
trap "rm -f $tempfile" 0 1 2 5 15 | |
$DIALOG --backtitle "请选择您要安装的选项" \ | |
--title "专业系统安装" --clear \ |
This file contains 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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This file contains 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
@@http_auth_headers = %w(X-HTTP_AUTHORIZATION HTTP_AUTHORIZATION Authorization) | |
# gets BASIC auth info | |
def get_auth_data | |
auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) } | |
if auth_key.present? && request.env[auth_key].to_s =~ /^Basic\s+(.*)/m | |
Base64.decode64($1).split(':')[0..1] | |
else | |
[nil, nil] | |
end | |
end |
This file contains 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
# 启动时不显示欢迎屏幕 | |
startup_message off | |
# 定义screen的功能键为Ctrl-Z。向终端输入Ctrl-Z时应按 Ctrl-Z z。 | |
escape ^Zz | |
# 屏幕缓冲区 1024 行。 | |
defscrollback 1024 | |
# 关闭错误提示 |
This file contains 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
""""""""""""""""""""""""""""""""""""""" | |
" URL: https://gist.github.com/alvin2ye/318212 | |
" 安装方法 | |
" git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle | |
" curl -sL https://gist.githubusercontent.com/alvin2ye/318212/raw/.vimrc > ~/.vimrc | |
" Launch vim, run :BundleInstall | |
""""""""""""""""""""""""""""""""""""""" | |
""""""""""""""""""""""""""""""""""""""" | |
"平台判断 |