2013年6月25日 星期二

停止crontab的寄信通知


Crontab 在執行時, 只要營幕有任何標準輸出, 就會轉成信件寄出通知,初期要 Debug用時還不錯, 但是久了後就很煩, 就想把他丟到 /dev/null 或 改寄到其它地方去, 但是 /dev/null 丟了好多次都沒有用, 才發現到原來是少了 2>&1, 完整命令如下:
於設定時將標準輸出導到 /dev/null
0 * * * * script_name > /dev/null 2>&1
將信件改寄到其它地方, MATILTO="", (不過 "" 的話, 我不知道會寄到哪邊去)
於 Script 最前面加上 MAILTO=""


ref:http://blog.longwin.com.tw/2006/01/stop_crontab_send_mail/

如何在網站、部落格中安裝 LINE 分享、轉貼按鈕?行動網頁?


以下程式碼適用於一般網頁:


reference : http://briian.com/?p=9836

如何重置webmin的使用者密碼

reset Webmin的使用者密碼 
1.使用find找出Webmin安裝目錄下的密碼修改檔changepass.pl  
find / -iname changepass.pl 

2.切換到該檔所在目錄,執行: 
./changepass.pl /etc/webmin 欲修改的帳號 欲修改的密碼 

修改後就可以使用新密碼登入Webmin

ref:http://www.wretch.cc/blog/diskdupe/12322782

2013年6月18日 星期二

Apple Enterprize Developer Account 申請記錄

開始申請時間 5/31

Your Apple Developer Program Enrollment Request


蘋果美國公司來電確認時間 6/18 13:30
詢問三個問題
1. 詢問購買者是否了解企業者帳號無法上架到Apple Store
2. 詢問購買者購買企業者帳號的用途是限於企業內或客戶使用的
3. 詢問購買者是否可以代表公司與蘋果簽約

同意合約 6/18 13:41

Apple Developer Program Enrollment Update


付費購買 6/18 13:55

正在處理你的訂單 W226794118


完成購買時間 6/18 16:58




2013年6月13日 星期四

linux cron

path:

/var/spool/cron


sample:


44 11 * * * /etc/webmin/cron/tempdelete.pl
0 * * * * /etc/webmin/bandwidth/rotate.pl
*/5 * * * * /usr/sbin/ntpdate time.stdtime.gov.tw > /dev/null 2>&1
10 6 * * * /usr/local/sbin/tarDATA_day.sh
*/1 * * * * /usr/local/sbin/webcron/pushcron.sh
59 23 * * * /usr/local/sbin/webcron/webcron.sh

execute url (wget)
and no output result


wget http://p4.milkidea.com/app_tls/api-cron.sea -O /dev/null
wget http://p4.milkidea.com/app_discovery/api-cron.sea -O /dev/null
wget http://p4.milkidea.com/clinic2/api-cron.sea -O /dev/null
wget http://p4.milkidea.com/app_pushme/api-cron.sea -O /dev/null

Linux常用指令

shutdown / reboot , reference from 鳥哥

重起sendmail
service sendmail stop
service sendmail start


重起apache

apache reset
/usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl start


掛上一個裝置

mount -t ext3 /dev/sdb1 /mnt/data2
rm -rf *   刪除,recursive & force
cp -rf * ../data2  複製,recursive & force
fg

symboic link
ln -sf /mnt/data2 /mnt/db_disk
$ ln [參數] 來源檔案或資料夾 要建立的 link 名稱
沒有參數的時候是建立 hard link,沒辦法跨 file system,沒辦法 link directory
-s : symbolic link
-f : 要建立的 link 如果存在,會先移除掉再建立

[root@www ~]# ln -s /etc/crontab crontab2
[root@www ~]# ll -i /etc/crontab /root/crontab2
1912701 -rw-r--r-- 2 root root 255 Jan  6  2007 /etc/crontab
 654687 lrwxrwxrwx 1 root root  12 Oct 22 13:58 /root/crontab2 -> /etc/crontab

rm db_disk
umount /mnt/data
若是busy請離開/mnt/data工作目錄

要複製資料且保留權限要使用
tar cvf * -R
tar xvf 

SFTP to non port 22

注意: -oPort 參數要在前面,以避免某些程式解命令列參數時解錯。
解法範例:
sftp -oPort=6789 jjdai@example.com

apatana git 練習

設定git 執行程式

建立git儲存空間


Git功能選單


Git Add remote



2013年6月1日 星期六

vi 常用指令筆記

command mode

u  : undo
dd : delete a line
x : delete a char
o : new line
y : mask a line
p : paste
$ : goto end of a line
0 : goto start of a line

更多的介紹
c9s Vim Hacks7 是相當好的 vim 學習資源    
http://c9s.blogspot.tw/2009/08/vim-hacks-coscup.html