原创 讀書筆記《Ruby On Rails中文版》第13章

本章知識點13.1 單例類 1 定義方法 a class<<obj def twice b def str.tw

原创 crontab 用法與注意

1 建立crontab 的輸入文件 vim testcron #分鐘 小時 日 月 星期 命令 20-30 9 * * * date >> /h

原创 Shell 重定向

#ls >redout.lst (等同於ls 1>redout.lst,標準輸出重定向)系統先執行>redout.lst,生成一個空文件,然後系統執行

原创 date 命令的使用方法

date --helpdate --date="3 days" +%Y%m%ddate -d "1 day ago" -udate --date

原创 Ubuntu 詞霸安裝

Ubuntu上有沒有“金山詞霸”這樣的軟件呢? 星際譯王(StarDict)“就是這樣一款軟件。Ubuntu缺省沒有安裝它,但是它確實存在於Ubu

原创 SHELL 變量

有兩種方法執行shell scripts,一種是新產生一個shell,然後執行相應的shell scripts;一種是在當前shell下執行,不再啓用

原创 應用Rails進行敏捷WEB開發學習筆記---1

問題: 書62頁,當運行命令ruby script/generate scaffold Product Admin 後會報Error

原创 SQLite3 安裝及在Ruby下的使用

sudo apt-get install libsqlite3-devsudo gem install sqlite3-ruby-1.2.5.gem不要安裝sudo gem install sqlite3,如果已經安裝了要 sudo ge

原创 Linux 表達式

expr 10 + 10 注意中間的空格expr 10 \* 10 乘法運算符要進行轉義,而其他的預算符號不需要轉義

原创 Install libxml-ruby

Must install libxml2-dev first ,otherwise there will be errors like sudo apt-get install libxml2-devgem

原创 Ubuntu 快捷鍵 設置

目標:設置Alt+Ctrl+x作爲開啓終端的快捷鍵設置方法: System —> Preferences ->Keyboard Shutcuts -> Desktop -> Run a Terminal 然

原创 修改root密碼

mysqladmin -uroot -p123456 password 456789 將密碼設置爲空密碼:mysqladmin -uroot -p123456 password ''

原创 ActiveRecord belong_to ,has_one 行爲

當一個ActiveRecord A引用了另外的ActiveRecord B時,如果B是new 的 ActiveRecord,則當調用 A#save方法時,B會被自動保存。如果B是已經在數據庫裏面的記錄,在B

原创 here document 問題

str<<EOF this is the first line this is the second lineEOF貌似不能解決縮進問題,<<EOF 和 <<-EOF 的區別看不到

原创 關於around_filter 的調用

def call_filter(chain, index) return (performed? || perform_action_without_filters) if index &gt;= chain.size