2009年2月27日 星期五

[linux]修改vim的顏色

1. 先安裝vim
sudo apt-get install vim

2. 複制設定檔
cp /etc/vim/vimrc ~/.vimrc

3. 修改設定檔
vi ~/.vimrc
把裏面syntax on前面的引號"刪掉
存檔

2009年2月23日 星期一

DBN 練習

↓按一下畫面執行結果:








今天做了個dbn的小練習
讓字跟著mouse座標動

然後點的時候有線跟著走

不過dbn真的很陽春, 指令要背起來的話也沒有幾個
語法部份可以參考這邊→DBN wiki

我寫的這只程式碼如下
Load dbnletters.dbnLoad dbngraphics.dbn

Fast
Size 200 200 
forever
{
 paper 0
 set X (<mouse 1>+3) //滑鼠X座標
 set Y (<mouse 2>+3) //滑鼠Y座標
 set P <mouse 3> //滑鼠有否被按下
Same? P 0
{
  Letter 12 X Y //letter 'L'
  Letter 3 (X+15) Y //letter 'C'
  Letter 20 (X+30) Y //letter 'T'
 }
Same? P 100

  Letter 12 X Y
  Letter 3 (X+15) Y
  Letter 20 (X+30) Y
  line 0 0 X Y
  line 200 200 (X+40) (Y+20)
  line 0 200 X (Y+20)
  line 200 0 (X+40) Y
 }
refresh
}

要把dbn的執行結果放在網頁上, 可透過下列程式碼

<APPLET CODE="DbnApplet" ARCHIVE="dbn.jar" codebase="./" WIDTH="400" HEIGHT="400">

<PARAM NAME="mode" VALUE="grid">

<PARAM NAME="graphics_width" VALUE="400">

<PARAM NAME="graphics_height" VALUE="400">

<PARAM NAME="slowdown" VALUE="true">

<PARAM NAME="program0" VALUE="name.dbn">


</APPLET>

把相關的程式檔dbn.jar和library如dbngraphics.dbn都放在網路的空間上,
codebase="./"則改為網路空間的位置
再修改長寬參數,把name.dbn改為自己檔案的名稱
這樣就可以了

2009年2月12日 星期四

[linux] 排程指令

單次排程指令 at
先編輯at.allow/ at.deny以確保哪些使用者可以執行排程

at 23:00 2009-02-15 #建立在2009/2/15日, 23:00時的工作排程
at>.... #開始輸入指令, 預設目錄在/bin/sh
at> #ctrl+ d, 結束

查詢已建立的排程
atq

刪除排程
atrm 5 #刪除編號為5的排程工作


循環性的排程工作 cron (crond)

先編輯cron.allow/ cron.deny以確保哪些使用者可以執行排程

編輯
crontab -e
59 23 5 1 * mail zen < /home/lct/birthday.txt

分 時 日 月 年 command

#在任何一年1月5日23:59把/home/lct/birthday.txt這個檔案mail給zen

查詢
crontab -l

刪除全部排程
crontab -r

刪除個別排程要使用編輯進去修改


[linux] 安裝LAMP

安裝apache, MySQL, PHP
需要sudo權限

apt-get install apache2 #安裝apache
apt-get install mysql-server-5.0 #安裝MySQL 5.0.3

apt-get install php5 #安裝php5

apt-get install phpmyadmin #安裝mySQL client端

MySQL資料庫預設目錄:/var/lib/mysql
apache網頁預設目錄:/var/wwwApache
設定檔:/etc/apache2/apache2.conf

2009年2月10日 星期二

[linux] 使用者、群組管理

關於使用者
adduser 新增使用者
adduser zen #新增zen這個使用者

usermod 修改使用者
usermod [-cdegGlsuLU] username
參數參考:http://linux.vbird.org/linux_basic/0410accountmanager.php#users_adduser

userdel 刪除使用者
userdel zen #刪除帳號zen
userdel -r zen #連zen的home 一連刪除

passwd 修改密碼

finger 查詢使用者資料
finger zen #查詢zen的個人資料


關於群組

groupadd 新增群組
groupadd group1 #新增群組group1
grep group1 /etc/group /etc/gshadow #用關鍵字找尋檔案

groupmod 修改群組
groupdel 刪除群組

[linux] vi按鍵功能表

http://linux.vbird.org/linux_basic/0310vi.php#vi_command

[linux]目錄配置

http://linux.vbird.org/linux_basic/0210filepermission.php#dir
檔案屬性、目錄配置說明

[linux] 檔案的所屬權管理

chown 變更檔案的擁有者

chown zen test.txt #把test.txt的擁有者改為zen
chown fool:root hi.txt #把hi.txt的擁有者改為fool, 擁有群組改為root

可配合-R 遞迴修改資料夾內的內層檔案
chown -R zen file1 #file1為資料夾, 使file1裏的檔案都改為zen所擁有


chgrp 變更檔案的擁有群組

chgrp group1 test.txt #把test.txt設為group1這個群組所屬


chmod 修改檔案的存取權
r:4 w:2 x:1
讀 寫 存取目錄

chmod 755 secert.txt
#第一位為owner權限, 二為group權限, 三為others權限
#使secert.txt這個檔案,
#7= 4+2+1: owner rwx
#5 = 4+1: group r-x
#5 = 4+1: others r-x
另外, 是否可存取亦要視乎檔案屬性, 像是資料夾就沒有x就不能進入資料夾內

2009年2月9日 星期一

[linux]網路問題檢查

lsmod 檢查網路卡的模組是否已被載入

dmesg 檢查是否已經捉到網路卡

ifconfig 檢查網路卡的運作狀況
Powered By Blogger

Label Cloud

2009 (1) 不能連localhost (1) 內嵌音訊 (1) 求職 (1) 面試 (1) 音樂 (1) 動畫師 (1) 帳號管理 (1) 排程 (1) 畢展 (1) 創意市集 (1) 惡意程式 (1) 電腦動畫 (1) 權限管理 (1) adobe (1) android (4) animation (1) animator (1) apache (3) art (5) art taipei 2008 (1) audio (2) bbs (1) birthday (1) black and white (1) browser (2) career (2) certification (1) cgw (1) cinematography (1) code (3) Collie (1) color (2) command (16) competition (1) computer science (3) connection (1) cover (1) crafyJS (1) creative (1) CSS (1) DBN (2) design (7) developer (1) display (1) drawing (1) eclipse (3) embed (1) engine (1) EntityJS (1) exception (1) exhibition (1) flower (1) frame (1) freebsd (11) french (1) friends (3) function (1) game (1) google (2) graphic (3) html (2) HTML5 (1) https (1) illustrator (1) image processing (1) interactive storytelling (1) internet (3) interview (1) introduce (1) ip (1) japan (1) java (4) javascript (3) JIT (1) jmonkey (1) job (1) jquery (1) LAMP (1) LimeJS (1) linux (8) liquid galaxy (1) ListView (1) localhost (1) log (1) mail (1) marquee (1) midi (1) mime-type (1) mis (1) MIT (2) mo-cap (1) mobile (1) Modernizr (1) motion capture (1) movie (1) music (3) narrative (2) NCCU (3) news (1) note (10) originality (1) otaku (1) painting (4) performance (1) photography (2) photoshop (7) php (1) player modelling (1) poster (1) postfix (1) programming (5) QuarkJS (1) resource (1) schema (1) scroll (1) self aware (1) semantic (1) server (1) share (1) sketch (2) software (4) solve (2) Sonivox (1) speaking (1) ssl (1) SSLPeerUnverifiedException (1) streaming (1) Subversion (1) sunspider (1) SVN (3) svn server (1) system (1) taipei (1) test (1) tfam (1) tool (1) TortoiseSVN (1) tutor (1) ubuntu (3) update (1) uri (1) video (1) vim (1) w3c (1) wap wcss css css2.0 (1) web (8) WebGL (1) webkit (2) well-form (1) wiimote (1) wiiusej (1) workshop (1) xhtml (1) xml (2)