Skip to content

Instantly share code, notes, and snippets.

@chensoren
chensoren / tree gems.md
Last active January 2, 2016 13:59
ruby tree gems
@chensoren
chensoren / phonegap_notes.md
Created January 2, 2014 09:59
PhoneGap Develop

##Phonegap log debug Add 'Web Console' filter in LogCat, the key is by Log Tag should be Web Console

##Show Scrollbar for Panel View

layout: {
            type: 'vbox',
 align: 'start',
@chensoren
chensoren / plugins.md
Created December 31, 2013 05:52
Phonegap plugins
@chensoren
chensoren / chrome.extention.md
Last active January 1, 2016 04:29
Awesome chrome extentions
@chensoren
chensoren / pg_commands.md
Last active October 19, 2016 07:33
Debian下postgresql服务

Debian下启动postgresql服务

/usr/lib/postgresql/8.4/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

登录数据库

psql -U dbuser -d exampledb -h 127.0.0.1 -p 5432

使用homebrew安装后使用下面用户登录

@chensoren
chensoren / uninstall_mysql.sh
Created December 19, 2013 14:08
uninstall mysql dmg installation
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
@chensoren
chensoren / clean_berw.sh
Created December 19, 2013 11:20
cleanup homebrew
brew ls | xargs brew rm
brew prune
brew cleanup
brew ls --unbrewed | xargs -I {} rm -rf /usr/local/{}
@chensoren
chensoren / block_config.rb
Created December 6, 2013 09:00
Block Configuration
class Configuration
attr_accessor :username, :password
def initialize
yield self
end
end
c = Configuration.new do |config|
@chensoren
chensoren / linux.md
Last active December 29, 2015 17:09
linux shell command collection
  • 通过ssh传输文件

    scp -rp /path/filename username@remoteIP:/path #将本地文件拷贝到服务器上# scp -rp username@remoteIP:/path/filename /path #将远程文件从服务器下载到本地# tar cvzf - /path/ | ssh username@remoteip "cd /some/path/; cat -> path.tar.gz" #压缩传输# tar cvzf - /path/ | ssh username@remoteip "cd /some/path/; tar xvzf -" #压缩传输一个目录并解压# rsync -avh /path/to/file/or/dir user@host:/path/to/dir/or/file rsync -avh user@host:/path/to/file/or/dir /path/to/file/or/dir