Skip to content

Instantly share code, notes, and snippets.

View bububa's full-sized avatar
💭
I may be slow to respond.

Prof Syd Xu bububa

💭
I may be slow to respond.
View GitHub Profile
#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
ghs.cmded.net
199.27.134.76
Current Settings New Settings
NS21.DOMAINCONTROL.COM elsa.ns.cloudflare.com
NS22.DOMAINCONTROL.COM jeff.ns.cloudflare.com
@bububa
bububa / gist:1268664
Created October 6, 2011 21:02
Adding a remote to existing git repo
git remote add --track master origin git@github.com:caius/foo.git
http://caiustheory.com/adding-a-remote-to-existing-git-repo
@bububa
bububa / gist:1271971
Created October 8, 2011 06:58
The Procedure for Amoeba1 Server Reboot
1. stop mysql
sudo /etc/init.d/mysql stop
2. restart sphinx search
kill searched
sudo searchd /etc/sphinx/searchd.conf
3. start mongodb
sudo mongod --config /etc/mongodb/r0.conf
@bububa
bububa / gist:1292093
Created October 17, 2011 07:06
make a file executable
chmod a+x myfile
chmod 755 myfile
@bububa
bububa / .htaccess
Created October 17, 2011 07:08 — forked from hkdobrev/.htaccess
.htaccess rules for chrome frame
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
@bububa
bububa / Mac下开机自动连接ssh -D.txt
Created November 18, 2011 21:03 — forked from iksky/Mac下开机自动连接ssh -D.txt
Mac下开机自动连接ssh -D
首先我们来生成公钥文件。Terminal下面输入
ssh-keygen -t rsa
之后在Terminal的提示里按回车。直到生成id_rsa.pub文件,生成的id_rsa.pub文件在 ~/.ssh下面。Terminal下面输入
cd ~/.ssh
cp id_rsa.pub authorized_keys
上面第一句的意思是进入~/.ssh文件夹,第二句是复制id_rsa.pub为authorized_keys文件。
@bububa
bububa / gist:1385254
Created November 22, 2011 09:08
remove git sensitive file from history
For all practical purposes, the first thing you should be worried about is CHANGING YOUR PASSWORDS! It's not clear from your question whether your git repository is entirely local or whether you have a remote repository elsewhere yet; if it is remote and not secured from others you have a problem. If anyone has cloned that repository before you fix this, they'll have a copy of your passwords on their local machine, and there's no way you can force them to update to your "fixed" version with it gone from history. The only safe thing you can do is change your password to something else everywhere you've used it.
With that out of the way, here's how to fix it. GitHub answered exactly that question as an FAQ:
git filter-branch --index-filter 'git update-index --remove filename' <introduction-revision-sha1>..HEAD
git push --force --verbose --dry-run
git push --force
Keep in mind that once you've pushed this code to a remote repository like GitHub and others have cloned that remote repository, you're now in a sit
@bububa
bububa / gist:1405197
Created November 29, 2011 15:34
Python Webkit DOM Bindings
最近研究了下pythonwebkit,于是就想如果可以在python中运行js 还有操作dom 那该多好啊,于是google了一翻,发现了一些比较有用的资料(Python Webkit DOM Bindings),pythonwebkit 的开发版本已经支持dom的操作,不过需要你编译最新的源代码,这样的话你就可以获得一些额外的函数来进行dom的操作.
官方介绍的步骤:
1,git clone git://git.savannah.gnu.org/pythonwebkit.git
// 这个方法是获取pythonwebkit 的源代码,
//如果你已经安装了pythonwebkit可以先卸载掉
2,git checkout -b python_codegen
// checkout python_codegen 分支,请确定你一定要在python_codegen 分支上
//这个是以后你成功的关键 可以通过 git branch 来确定你在哪个分支上
@bububa
bububa / gist:1408886
Created November 30, 2011 12:22
Setup Rails 3.1 for Cloud Foundary on Mac OsX Lion
1. edit ~/.bash_profile
::
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH
export PATH=$PATH:/Users/syd/.rvm/gems/ruby-1.9.2-p290/bin/
export GEM_PATH=$GEM_PATH:/Users/syd/.rvm/gems/ruby-1.9.2-p290/
alias mysql="/usr/local/mysql/bin/mysql"
alias mysqld="sudo /Library/StartupItems/MySQLCOM/MySQLCOM"
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"