Category Archives: Linux

YUM資料庫損毀修復方式

最近管理的CentOS Server下yum指令時,都會出現db->close()不正常訊息。查了一下發現可能是因為yum安裝/移除/更新途中不正常停止造成暫存檔無法刪除,下次執行yum 時系統發現有這些暫存檔就出現錯誤了。 修正方法請參照 http://edumeme.blogspot.com/2009/04/yum.html

Posted in Linux, Linuxamp;FreeBSD | Leave a comment

我的 vim 設定配置

調了好久,統整好的vim設定終於完成。(有更新設定) 我的vim 設定檔,存放在~/.vimrc : set nocompatible colorscheme asmanian2 “colorscheme elflord syntax on set hls set ls=2 set cursorline set nu set ai set softtabstop=4 set shiftwidth=4 set ic set t_Co=256 let g:AutoComplPop_IgnoreCaseOption=1 “let g:acp_completeOption = ‘.,t,i,b’ set ignorecase set statusline=%<%f … Continue reading

Posted in Linux, Linuxamp;FreeBSD, vim | Leave a comment

[Linux] IRQ

From setserial manual … The “standard MS-DOS” port associations are given below: /dev/ttys0 (COM1), port 0x3f8, irq 4/dev/ttys1 (COM2), port 0x2f8, irq 3/dev/ttys2 (COM3), port 0x3e8, irq 4/dev/ttys3 (COM4), port 0x2e8, irq 3 Due to the limitations in the design … Continue reading

Posted in Linux, Linuxamp;FreeBSD | Leave a comment

[Linux] [Windows] SVN Service 的架設與使用

為了管理我那大大小小的文件與程式碼,自己架設了一個SVN Server。以下是架設與使用方法。 先記一下,有空再整理。 Note: 在設定<Location 位置> Block時,位置中的目錄路徑不可以跟現有的網頁目錄重疊,否則Apache會辨認不出來。 Reference SVN基本指令教學 SVN中文書 SVN Server On CentOS(Linux)1 SVN Server On CentOS(Linux)2 SVN Server(Client) On Windows. SVN: How to do permission control?

Posted in Linux, Linuxamp;FreeBSD, svn, 程式設計 | Leave a comment

[Linux] 編譯2.6.30-020630rc3-generic Kernel

聽說2.6.28以後的核心,對於Intel 內建顯示晶片顯示效能有顯著的提升,事不疑遲,Compile下去… 聲明:我大部份都是從Ref(1) 看來的,建議看這篇的同時,不妨去該作者的Blog看看,有很多東西喔。 1. 先去http://mirrors.kernel.org/ubuntu/pool/main/w/wireless-crda/wireless-crda_1.7_i386.deb 下載wireless-crda套件。 2.linux~#] sudo apt-get install kernel-package libncurses5-dev fakeroot 下載 kernel-package libncurses5-dev fakeroot 等套件。 3.再到http://www.kernel.org/pub/linux/kernel/v2.6/ 下載linux-2.6.30.tar.gz 4.linux~#] tar xzvf  linux-2.6.30.tar.gz 5.linux~#] cd linux-2.6.30 [Kernel設定] 6. linux~#] sudo cp /boot/config-`uname -r` .config   (載入你的設定檔) 7 .linux~#] … Continue reading

Posted in Linux, Ubuntu | Leave a comment

Backup MySQL with bash

這是一個簡單的範例程式,用來備份mysql用的。 以下假設我的MySQL使用者帳號為user,密碼為123,database名稱為db1 backupmysql.sh: =編輯開始= #!/bin/sh#Program:#      This code backup MySQL database with date.#      Author: Allen#History:#      2009/1/1 #take datedate=`date +%Y%m%d` #database namedb_name=’db1‘db_user=‘user”db_password=’123‘ mysqldump $db_name -u $db_user –password=”$db_password” > 備份目錄/$db_name$date.sql =編輯結束 = 然後將這支bash程式權限設定為 700 (chmod 700 backupmysql.sh)。 如果你要讓它定期幫你備份的話,加入crontab就好囉。 例如我要讓它每七天都幫我備份的話,只要加入以下: #Allen: 每七天的01:00執行一次 backupmysql.sh ,自動備份資料檔案0 … Continue reading

Posted in Linux, Linuxamp;FreeBSD | Leave a comment

CentOS yum設定檔

最近Lab網頁主機替換,我為它裝上了CentOS 5.2,發現鳥哥網站寫的直接在mirrorlist加入&cc=tw 的方法對於學術網路的安裝與更新來說,實在太慢了。 研究了一下,終於將它換成對應到義守大學檔案伺服器的mirror。如此,連線速度就可以快很多倍囉! 以下是我的設定檔(位於/etc/yum.repos.d/CentOS-Base.repo): [base]name=CentOS-$releasever – Base#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&cc=twbaseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/os/$basearch/gpgcheck=1gpgkey=http://ftp.isu.edu.tw/pub/Linux/CentOS/RPM-GPG-KEY-CentOS-5 #released updates[updates]name=CentOS-$releasever – Updates#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&cc=twbaseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/updates/$basearch/gpgcheck=1gpgkey=http://ftp.isu.edu.tw/pub/Linux/CentOS/RPM-GPG-KEY-CentOS-5 #packages used/produced in the build but not released[addons]name=CentOS-$releasever – Addonsbaseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/addons/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons&cc=twgpgcheck=1gpgkey=http://ftp.isu.edu.tw/pub/Linux/CentOS/RPM-GPG-KEY-CentOS-5 #additional packages that may be useful[extras]name=CentOS-$releasever – Extrasbaseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/extras/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&cc=twgpgcheck=1gpgkey=http://ftp.isu.edu.tw/pub/Linux/CentOS/RPM-GPG-KEY-CentOS-5 #additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever – Plus#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&cc=twbaseurl=http://ftp.isu.edu.tw/pub/Linux/CentOS/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://ftp.isu.edu.tw/pub/Linux/CentOS/RPM-GPG-KEY-CentOS-5 … Continue reading

Posted in Linux, Linuxamp;FreeBSD | 2 Comments

Vim 鍵盤指令圖解

ref:http://blog.linux.org.tw/~jserv/archives/001675.html

Posted in Linux, Linuxamp;FreeBSD, vim, 程式設計 | Leave a comment

automake,autoconf,libtool,Kdevelop

Automake,autoconf,libtools Kdevelop manaul Kdevelop 快速上手(簡體中文)

Posted in Kdevelop, Linux, Linuxamp;FreeBSD, 程式設計 | Leave a comment

Linux proftp 架設範例 1

最近幫系上老師架設FTP,架設成功了許久,但是一直沒有寫下架設方法。為了避免忘記,就把心得寫了下來…設備環境:Linux (Fedora Core 6) + Proftpd 需求: 一個系有上課的有3個年級,每個年級有專屬的ftp帳號 user1,user2,user3,使用者只能上傳檔案,上傳之後不能下載,也不可以切換到其他使用者目錄(如user1可以切換到user2的資料夾),檔案上傳之後不可以刪除。也不可以複寫檔案! 需要有一個專門給大家下載公用檔案的帳號:download。該使用者只能下載,不能刪除,不能上傳檔案,也不能切換到其他使用者目錄。只有BigUser可以複寫檔案,與刪除檔案,上傳檔案。 需要有一個可以將檔案上傳到每個user資料夾,也可以把檔案刪除的大總管BigUser。 作法:因為每個使用者只能上傳不能刪除與下載檔案,所以我把/etc/proftpd.conf設定檔加了以下設定: # Edit by Allen<Directory /home/download>AllowOverwrite on<Limit READ>AllowAll</Limit><Limit WRITE>AllowUser BigUserDenyUser download</Limit></Directory> <Directory /home/user1>AllowOverwrite off<Limit WRITE>AllowAll</Limit><Limit DELE RMD>AllowUser BigUserDenyUser user1</Limit><Limit READ> AllowUser BigUserDenyUser user1</Limit></Directory> <Directory /home/user2>AllowOverwrite off<Limit WRITE>AllowAll</Limit><Limit DELE RMD>AllowUser BigUserDenyUser user2</Limit><Limit READ>AllowUser BigUserDenyUser user2</Limit></Directory><Directory /home/user3>AllowOverwrite … Continue reading

Posted in Linux, Linuxamp;FreeBSD | Leave a comment