2016年2月27日 星期六

CLI readline shortcuts

Some useful line editing key bindings provided by the Readline library:
  • Ctrl-A: go to the beginning of line
  • Ctrl-E: go to the end of line
  • Alt-B: skip one word backward
  • Alt-F: skip one word forward
  • Ctrl-U: delete to the beginning of line
  • Ctrl-K: delete to the end of line
  • Alt-D: delete to the end of word
 
 
Ctrl + a – go to the start of the command line
Ctrl + e – go to the end of the command line
Ctrl + k – delete from cursor to the end of the command line
Ctrl + u – delete from cursor to the start of the command line
Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
Ctrl + xx – move between start of command line and current cursor position (and back again)
Alt + b – move backward one word (or go to start of word the cursor is currently on)
Alt + f – move forward one word (or go to end of word the cursor is currently on)
Alt + d – delete to end of word starting at cursor (whole word if cursor is at the beginning of word)
Alt + c – capitalize to end of word starting at cursor (whole word if cursor is at the beginning of word)
Alt + u – make uppercase from cursor to end of word
Alt + l – make lowercase from cursor to end of word
Alt + t – swap current word with previous
Ctrl + f – move forward one character
Ctrl + b – move backward one character
Ctrl + d – delete character under the cursor
Ctrl + h – delete character before the cursor
Ctrl + t – swap character under cursor with the previous one
 
 
 
http://cnswww.cns.cwru.edu/php/chet/readline/readline.html 

Change time zone

The correct way to set the system timezone is to clobber /etc/localtime.  This should work across most distros.
sudo cp /usr/share/zoneinfo/Europe/London /etc/localtime



Raspberry Pi 安裝中文輸入法與字型

raspi-config
sudo apt-get install scim-chewing

安裝中文字型:文泉驛微米黑、文泉驛正黑、文泉驛點陣宋體:
sudo apt-get install ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy



http://blogger.gtwang.org/2014/12/raspberry-pi-chinese-input-method.html

2016年2月26日 星期五

Synology for loop shell script

zip following folders

2013/20130401
...
2013/20131231

into 201304.zip  ... 201312.zip


synology using standard POSIX shell
--------------
for m in $(seq 201304 201312)
do
     zip -r $m.zip 2013/$m*
done
--------------

2016年2月23日 星期二

104下W2工作記錄

20160226

設定影音放送王
網路電話IP
討論資訊設備採購
刪除多餘備份
壓縮校務系統備份檔案


設定raspberry pi thin client
安裝chromium on rpitc

wget https://dl.dropboxusercontent.com/u/87113035/chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb
wget https://dl.dropboxusercontent.com/u/87113035/chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
wget https://dl.dropboxusercontent.com/u/87113035/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb

sudo apt-get install xdg-utils

sudo dpkg -i chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb


sudo apt-get install lsb-release

參考資料
https://www.raspberrypi.org/forums/viewtopic.php?t=121195&p=818455


20160223
上午網路聯外速度緩慢

20160222
網頁博覽會資料上傳
製作光碟

調整電腦教室電腦六年級學生Desktop資料夾權限

2016年2月19日 星期五

104下W1工作記錄

20160220
檢修B201網路電話
廠商送回2台網路電話  一台放回C303教室
需使用ping工具  才能重新正常連線

協助製作博覽會網頁

20160219
C203教室擴大機 中間麥克風輸入孔 會有雜音
將電腦音源接至右邊輸入孔 聲音輸出正常
廣播系統接至中間輸入孔
請老師觀察 未來廣播效果 如無法接受再到總務處報修


20160218
製作博覽會網頁
B201教室電腦重灌  網路電話疑似故障

修改 DRBL PXE 開機選單

20160217
C203電腦無法上網
檢視該電腦後發現上網所需服務無法正常啟動
重新還原系統後恢復正常

Cacti系統 log爆滿
/var/log/ mysqld.log 占用20G  將/var/log/ mysqld.log移除
並修復資料表

協助 C202教師 設定解壓縮程式
C102教室電腦C槽已滿 請老師將教學電子書 移置D槽


20160216
修改防火牆 允許 IPV6 WAN to LAN WWW 服務
修改後 市網中心即可透過ipv6正常連線至本校網頁伺服器

F301 C302 教室無法播音 調整音源線後恢復正常
財產盤點
圖書室接用 圓形裁紙刀 圓規刀

20160215
設定moodle課程
還原 謝老師 密碼

2016年2月15日 星期一

2016年1月21日 星期四

網頁製作相關資源

Web 編輯器:

令人驚艷的 Web 編輯器 - Brackets
Brackets 是一個開放原始碼的 Web 編輯器,而且是由 Adobe 所開發的
http://download.brackets.io/ 
介紹: http://kevintsengtw.blogspot.tw/2013/01/web-brackets.html

BlueGriffonT
 http://bluegriffon.org/pages/Download

SharePoint Designer 2007
https://www.microsoft.com/zh-tw/download/details.aspx?id=21581

Expression Web
https://www.microsoft.com/expression/cht/


fancybox:
https://www.freshdesignweb.com/jquery-image-slider-slideshow/


Open Source Web Design
http://www.oswd.org

templatemo.com
http://www.templatemo.com

freecsstemplates.org
http://www.freecsstemplates.org

MyFreeCSSTemplates.com
http://www.myfreecsstemplates.com

以上資料來源: http://www.wibibi.com/info.php?tid=129




CSS3教學
http://www.w3schools.com/css/css3_gradients.asp
http://www.study-area.org/coobila/tutorial_535.html


設定某樣式內的連結顏色:
.nav a:link, .nav a:visited {color: #004444;}
.nav a:hover {color:#923f76; color: #2267DA; }

CSS線上產生器
http://enjoycss.com/code/

CSS3圓角框產生器:http://border-radius.com/
色票選擇
http://rgb.to/


http://www.oxxostudio.tw/articles/201408/sticky-ball.html

網頁作品:
http://www.eztrust.com.tw/html/works/index.aspx



THE FREE HTML EDITOR 10.1http://www.coffeecup.com/free-editor/



線上製作 APP
http://appinventor.mit.edu/explore/

http://ezoui.com/project/dashboard.html

Smart App Creator  (單機須付費)


重新介紹 JavaScripthttps://developer.mozilla.org/zh-TW/docs/Web/JavaScript/%E9%87%8D%E6%96%B0%E4%BB%8B%E7%B4%B9_JavaScript

Crontab

crontab -e 是針對使用者的 cron 來設計的,如果是『系統的例行性任務』時修改/etc/crontab


*/10 * * * *  root  cmd  //每十分鐘以root身分執行命令
00 * * * *  root  cmd  //每整點以root身分執行命令

分 時 日 月 週 執行者身份  指令串



crontab -e  格式:
分 時 日 月 週 指令串

參考:
http://linux.vbird.org/linux_basic/0430cron.php#whatiscron_type

http://www.puritys.me/docs-blog/article-20-cron-jobs-crontab-%E6%8E%92%E7%A8%8B%E6%95%99%E5%AD%B8.html

使用 tail -f /var/log/cron 這個指令來檢查 /etc/crontab 中的程式,是否有正確的被執行。

如何讓 cron job 自動 SCP 備份資料

首先我們要啟用 SSH Agent,有了 SSH Agent ,就能夠執行 scp 指令,並且自動通過輸入密碼的過程。
先在個人目錄下新增 .bash_profile ,並加入以下的內容,加入完成後得重新載入 .bash_profile , 使用指令「source ~/.bash_profile」,之後我們就可以用 start_agent 啟動 SSH Agent。
.bash_profile
  1. SSH_ENV=$HOME/.ssh/environment
  2. function start_agent {
  3. echo "Initialising new SSH agent..."
  4. /usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
  5. echo succeeded
  6. chmod 600 ${SSH_ENV}
  7. . ${SSH_ENV} > /dev/null
  8. ssh-add id_rsa
  9. }
接下來修改 /etc/crontab ,將備份的指令輸入就可以了,如果想看執行的 Log ,可以在指令的最後補上 「 2>&1 &> ~/cronLog」,這樣程式就會將結果存到 ~/cronLog。
/etc/crontab auto scp
  1. 1 1 * * * userxx . /home/userxx/.ssh/environment && /usr/bin/scp puritys.me:~/var/backup/* ~/
這個範例是每天自動備份另一台機器的資料,但是時間一久 ,備份的資料會越來越多,最後硬碟會撐不住,所以又要加一個自動刪除舊檔的 cron job,下面這個範例會自動刪除五天前的 gz 備份檔。
/etc/crontab auto rm
  1. 40 1 * * * userxx /usr/bin/rm `date --date="-5 day" +"\%Y-\%m-\%d"`*.gz
日期運算另一種寫法 date -d "-1 day" +"%Y-%m-%d"

2016年1月18日 星期一

104上W21工作記錄

20160120
整理機房 將多餘紙箱回收

20160118
設定XOOPS2016 班級網頁多人模組
處理資安通報
研判為DNS放大攻擊