2013年6月14日 星期五

修復B2D硬碟

文章來源:http://tr.ykjh.tnc.edu.tw/blog/index.php?op=ViewArticle&articleId=16&blogId=5

1.用系統片開機, 進入主選單
2.選擇「救援光碟」命令列模式
3. fdisk -l 查看硬碟狀況,確認磁區名稱
4. fsck -y /dev/sda2
檢查檔案系統,若一切正常,請重新開機進入原有的系統,並執行
service networking restart 恢復網路介面運作
5.若有出現不正常記錄,請趕快將可以拷貝的重要檔案做備份。

2012年12月23日 星期日

centos6.3 dwa125無線網卡

資料來源:http://usrnotes.blogspot.tw/2012/10/getting-dwa-125-wireless-dongle-to-work.html

Getting the DWA-125 Wireless Dongle to Work in CentOS 5.8

I use an old IBM Thinkpad X32 which doesn't come with a built-in wireless networking card. Fortunately, I still have my D-Link DWA-125 wireless USB adapter lying around. I used this on a previous computer before and it didn't let me down. I was hoping that this time around, it wouldn't let me down either; and I can say that it didn't as I am typing this post using the successful setup of a wireless connection. This time around, I am using CentOS 5.8 as my operating system. Here's how I got it working.

The Driver

This here is the most critical part of getting your hardware device work on a computer. Again, as I have used this USB adapter before on Ubuntu 10.04 LTS, then I know that there is a Linux driver available for it. So the first step is to download these drivers:

[usr@localhost ~]$ wget ftp://www.dlinkla.com/pub/drivers/DWA-125/*LINUX*DWA-125*.tar*gz --directory-prefix=/tmp

The driver is downloaded to the /tmp directory.

Prerequisite

At this point it's quite clear that the driver is in its source code form so it need to be built. To be safe, before attempting the next part of the installation, it's best to install the tool to be used in building the source code. I don't know which exact development tools are going to be used so I installed the "Development Tools" group.

[usr@localhost ~]$ su -c 'yum groupinstall "Development Tools"'

Installing the Driver

Now the source code is downloaded and the tools to build are installed, the last thing to do is to install the driver. And it's all just typing the ff. commands in succession.

[usr@localhost ~]$ cd /tmp
[usr@localhost tmp]$ tar -xzf *LINUX*DWA-125*.tar.gz
[usr@localhost tmp]$ cd 2009_1204_RT3070_Linux_STA_v2.1.2.0
[usr@localhost 2009_1204_RT3070_Linux_STA_v2.1.2.0]$ su -
Password:
[usr@localhost 2009_1204_RT3070_Linux_STA_v2.1.2.0]# make
[usr@localhost 2009_1204_RT3070_Linux_STA_v2.1.2.0]# make install

Starting the Driver

As my computer didn't have a built-in wireless adapter, then I didn't need to blacklist a certain driver from running (PDF). All I needed to do was:

[usr@localhost 2009_1204_RT3070_Linux_STA_v2.1.2.0]# modprobe rt3070sta

A restart should ensure that the driver is started. And that’s it! The driver is now installed and wireless is ready for use.

2012年11月18日 星期日

轉貼---架設YUM伺服器(for CentOS 5.5 x64)




一、YUM Server環境建置:
Step 1) 下載mirrordir套件安裝

Step 2) 下載yum-arch套件安裝(自動產生headers資料夾)

Step3) 安裝createrepo套件(建立索引檔用)
$ yum install -y createrepo

Step 4) 安裝並啟動httpd套件
$ yum install -y httpd

二、YUM Server設定
Step 5) 建立要放置的RPM目錄
建立32-bit CentOS 5.8 packages
$ mkdir -p /var/www/html/yum/centos/5.8/os/i386
$ mkdir -p /var/www/html/yum/centos/5.8/updates/i386
$ mkdir -p /var/www/html/yum/centos/5.8/extras/i386
建立64-bit CentOS 5.8 packages
$ mkdir -p /var/www/html/yum/centos/5.8/os/x86_64
$ mkdir -p /var/www/html/yum/centos/5.8/updates/x86_64
$ mkdir -p /var/www/html/yum/centos/5.8/extras/x86_64

Step 6) 針對目錄mirror YUM Server更新套件 (國家高速網路與計算中心FTP)
mirror 32-bit CentOS 5.8 RPM目錄
$ mirrordir -v ftp://ftp.twaren.net/Linux/CentOS/5.8/os/i386 /var/www/html/yum/centos/5.8/os/i386
$ mirrordir -v ftp://ftp.twaren.net/Linux/CentOS/5.8/updates/i386 /var/www/html/yum/centos/5.8/updates/i386
$ mirrordir -v ftp://ftp.twaren.net/Linux/CentOS/5.8/extras/i386 /var/www/html/yum/centos/5.8/extras/i386
mirror 64-bit CentOS 5.8 RPM目錄
$ mirrordir -v ftp://ftp.twaren.net/Linux/CentOS/5.8/os/x86_64 /var/www/html/yum/centos/5.8/os/x86_64
$ mirrordir -v ftp://ftp.twaren.net/Linux/CentOS/5.8/updates/x86_64 /var/www/html/yum/centos/5.8/updates/x86_64
$ mirrordir -v ftp://ftp.twaren.net/Linux/CentOS/5.8/extras/x86_64 /var/www/html/yum/centos/5.8/extras/x86_64

Step 7) RPM分析,並在目錄下產生headers資料夾
對32-bit packages目錄產生headers資料夾
$ yum-arch /var/www/html/yum/centos/5.8/os/i386
$ yum-arch /var/www/html/yum/centos/5.8/updates/i386
$ yum-arch /var/www/html/yum/centos/5.8/extras/i386
對64-bit packages目錄產生headers資料夾
$ yum-arch /var/www/html/yum/centos/5.8/os/x86_64
$ yum-arch /var/www/html/yum/centos/5.8/updates/x86_64
$ yum-arch /var/www/html/yum/centos/5.8/extras/x86_64

Step 8) 使用createrepo套件產生XML metadata,並在目錄下產生repodata資料夾
對32-bit packages目錄產生repodata資料夾
$ createrepo /var/www/html/yum/centos/5.8/os/i386
$ createrepo /var/www/html/yum/centos/5.8/updates/i386
$ createrepo /var/www/html/yum/centos/5.8/extras/i386
對64-bit packages目錄產生repodata資料夾
$ createrepo /var/www/html/yum/centos/5.8/os/x86_64
$ createrepo /var/www/html/yum/centos/5.8/updates/x86_64
$ createrepo /var/www/html/yum/centos/5.8/extras/x86_64

Step 9) 建立CentOS 5.x通用的YUM Server目錄,並指向最新的CentOS 5.8 Packages.
$ mkdir /var/www/html/yum/centos/5
$ ln -s /var/www/html/yum/centos/5.8/os /var/www/html/yum/centos/5/os
$ ln -s /var/www/html/yum/centos/5.8/updates /var/www/html/yum/centos/5/updates 
$ ln -s /var/www/html/yum/centos/5.8/extras /var/www/html/yum/centos/5/extras  

Step 10) 若要使Step6), 7), 8)定期更新的話,可以結合crontab.

三、YUM Client設定
Step 10) $ cd /etc/yum.repo.d
Step 11) $ cp CentOS-Base.repo bak.CentOS-Base.repo
Step 12) $ vim CentOS-Base.repo
---------------------------------------------------------------------------
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://YUM-Server-IP/yum/centos/$releasever/os/$basearch/
gpgcheck=1#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
gpgkey=http://YUM-Server-IP/yum/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://YUM-Server-IP/yum/centos/$releasever/updates/$basearch/
gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

gpgkey=http://YUM-Server-IP/yum/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://YUM-Server-IP/yum/centos/$releasever/extras/$basearch/
gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

gpgkey=http://YUM-Server-IP/yum/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-5
--------------------------------------------------------------------------- 
※ http://YUM-Server-IP/ 指的是YUM伺服器的Domain Name或是IP Address.
※ 因為YUM Client為CentOS 5.5 x86_64,也就是5.x系列,故此處的$releasever會等於「5」,而$basearch會等於「x86_64」
※ 若在/etc/yum.repo.d/CentOS-Base.repo不只有[base], [updates], [extras]的話,請記得將沒有用到的,如:[addons][centosplus][contrib]的enabled參數設定為0
 

以上資料參考自:http://paul.pixnet.net/blog/post/10980468

2012年11月15日 星期四

Lubuntu setting 打包紀錄PLURK PASTE


資料來源:

阿剛老師的異想世界


(1001029更新)檔案分享:ubuntu1110-LXDE+Clonezilla+DRBL+Spfdisk四合一客製化版本


自己用了ubuntu11.10一段時間了,Unity及Gnome-shell用來用去,還是沒有LXDE介面用的習慣,而且自己的筆電效能也不是好,用新的介面一直都都覺得用起來頓頓的,所以最後還是決定使用LXDE來當我的慣用介面,為此,我自己用UCK把我常用的軟體及一些小設定都打包成一個iso檔了,並把live模式也改為LXDE介面,以下是我的iso載點:

Ubuntu11.10 LXDE載點 (約1.9G)


今天在找資料時,找到了可以把Clonezilla打包進去的方式,又順便去研究了ACFS中的SPFdisk的寫法,所以我試了一下,一起把Clonezilla、DRBLSPFdisk這三個工具一起包進去了,以下是新的iso載點,內容跟上個版本都一樣,只是在使用Live開機時,選單會多出Clonezilla、DRBL及SPFdisk可以選擇:


Ubuntu11.10 LXDE +Clonezilla+DRBL+SPFdisk 四合一載點 (約2.4G)


md5: 92997b6ac15144971d95c352060576ae






另外,以下是我用UCK打包時,做的事情的紀錄(想知道預裝了什麼可以看看)


我的打包紀錄

簡單說明一下,雖然預設是以LXDE介面為主,但系統中已經預包了gnome-shell (gnome3介面)及傳統gnome2介面,還有本來ubuntu11.10預設的Unity及Unity2D的介面,安裝後登入前都可以自由選擇,也把預設的中文輸入法改為gcin,並修正了在Unity中無法顯示圖示的問題了,至於其他安裝了什麼軟體,就請直接看上面打包紀錄吧!

另外,因為我會在教室中使用wiimote白板,所以一些wiimote白板的套件我都預裝了,而其中ardesia這個桌面繪圖的軟體需使用到桌面特效,所以我在LXDE 的工具列上預設開啟了Fusion Icon這個軟體,如果要使用ardesia的話,只要在工具列上的Fusion icon上按右鍵,先在〔Select Windows Manager〕中選〔Compiz〕,再按下〔Reload Windows Manager〕,就可以啟用桌面特效了,啟用桌面特效後就可以使用Ardesia了!




打包紀錄
apt-get update
apt-get upgrade

##安裝gcin並設為預設
apt-get install gcin
im-switch -z zh_TW -s gcin

##移除所有語言套件
apt-get purge language-pack-aa language-pack-*

##安裝繁中套件
apt-get install language-pack-zh-hant language-pack-kde-zh-hant language-pack-gnome-zh-hant

##新增kdenlive blender medibuntu套件庫
add-apt-repository ppa:cheleb/blender-svn
add-apt-repository ppa:sunab/kdenlive-svn
add-apt-repository "deb http://packages.medibuntu.org/ natty free non-free"

##新增lucid的acnonical套件庫,為了安裝java6
add-apt-repository "deb http://archive.canonical.com/ lucid partner"


sudo apt-get update
sudo apt-get install openshot kdenlive
apt-get install sun-java6-jdk sun-java6-plugin
apt-get install w32codecs libdvdcss2
apt-get install gnome
apt-get install wine1.3
apt-get install winff vlc audacity dvdstyler smplayer guvcview
apt-get install furiusisomount
apt-get install scribus
apt-get install dia emesene ekiga kompozer filezilla
apt-get install stellarium
apt-get install supertux2 supertuxkart neverputt
apt-get install shutter 
apt-get install wiican mouseemu
apt-get install lxde
apt-get install vim synaptic p7zip p7zip-rar

#安裝準備好的deb
adobReader_cht eXe chrome google-earth meiga pps python-whiteboard
teamviewer6 umplayer xournal

dpkg -i *.deb
apt-get -f install

##修正google earth6
sudo apt-get install lsb-core libfreeimage3 libqt4-webkit

--------------


apt-get install flashplugin-installer
apt-get install libreoffice-l10n-zh-tw
apt-get install blender
apt-get install imagination sox libsox-*
apt-get install kde-l10n-zhtw k3b

##安裝cailibre
python -c "import urllib2; exec urllib2.urlopen('http://status.calibre-ebook.com/linux_installer').read(); main()"

來源:http://paste.plurk.com/show/708197/

2012年5月1日 星期二

限制網頁連線範圍


限制網頁連線範圍

限制網頁連線範圍
例如有些網頁只想讓校內的電腦可以瀏覽,那我們就可以如下的作法來達成:
#mkdir -p /var/www/html/phcno1
#vi /etc/httpd/conf/httpd.conf
在檔案尾加入:
Deny from all
Allow from 192.168.1.0/255.255.255.0 //限制只能從 192.168.1.0/24來讀取
Options Indexes FollowSymLinks
/etc/rc.d/init.d/httpd restart
測試:http://localhost/phcno1/
*****************************************************
另解
在 /etc/apache2/conf.d
建立ideapic資料夾規則 ra-ideapic
vi /etc/apache2/conf.d/ra-ideapic
order deny,allow
deny from all
allow from 163.26.181.0/24 127.0.0.1
Options followSymLinks MultiViews
重新啟動apache2
service apache2 restart
在 /var/www 建立資料夾ideapic
存入網頁資料
重新啟動apache2
service apache2 restart
轉貼自仁德國小網管http://www.rdes.tnc.edu.tw/phpbb/viewtopic.php?t=228

Win Xp 防毒策略


Win Xp 防毒策略

順序備忘:
1、cmd叫出命令提示字元
2、先crtl+Alt+Delete進入工作管理員,關閉explorer.exe檔案總管
3、c:
4、打上 dir *.exe;*.com;*.pif;*.bat;*.com;*.dll;*.cab;*.msi;*.ocx /AS /AH /S /TC
5、將找出的檔案如 ghost.bat 做以下處理
attrib -S -H -R ghost.bat
6、rename ghost.bat ghost.bat.txt
基本上,就可以清除了
ntdetect.com決不可以清
隨身碟的清法
H:\dir /AS /AH /TC
以上過程請選擇使用
以免造成資料毀損
本人不負起任何責任

優化Ubuntu Linux的系統服務


優化Ubuntu Linux的系統服務

linux的各大發行版,都有些不必要的服務被默認開啟了,針對ubuntu,我們可以採用選擇性關閉的方法加速起動,提高系統性能。
   這裏我們安裝一個軟體:
sudo apt-get install sysv-rc-conf
   然後這樣起動:
sudo sysv-rc-conf
   在這個軟體裏,可以用鍵盤的方向鍵移動,用空格選取,也可以直接用滑鼠選取,最後用q保存退出,一下列出服務的名稱和基本的解釋。
   acpi-support 這個是關於電源支持的默認是1,2,3,4,5下啟動,我認為你可以把它調整到s級別。
   acpid acpi的守護程式,默認是2-5開啟,我認為可以不用管。
   alsa alsa聲音子系統,應該不用開啟它。
   alsa-utils 這個服務似乎取代了alsa,所以開啟這個就可以了,我在S級別開啟它。
   anacron 這是一個用於執行到時間沒有執行的程式的服務,我認為它無所謂,所以關了它,這個可以隨便。
   apmd 也是一種電源管理,我認為電腦如果不是很老,它就沒有開啟的必要了。
   atd 和anacron類似,我把它關了。
   bluez-utiles 傳說中的藍牙服務,然後遺憾我沒有,所以關了。
   bootlogd 似乎使用來寫log的,安全期間開著他也許比較好。
   cron 指定時間運行程式的服務,所以開著比較好的。
   cupsys 印表機服務,所以如果你有,就開啟吧。
   dbus 消息匯流排系統,非常重要,一定要開。
   dns-clean 撥號連接用的,如果不用,就關了它。
   evms 企業卷管理系統,由於我並不明白什麼叫做企業卷,所以我關了它。
   fetchmail 用於郵件守護,我關了它。
   gdm gnome桌面管理器,我關了它,然後用startx啟動gnome。
   halt 關機用的,不要更改
   hdparm 這個我剛才有講,如果沒有ide硬碟也就不用開啟它了。
   hotkey-setup 這個是給某些品牌筆記本設計的熱鍵映射,臺式機用戶請關了它
   hotplug 這個是用於熱插拔的,我已經測試過了,在某些電腦上關閉它會使音效卡無效,請在S級別開啟它。
   hplip hp印表機專用的,應該可以關了它。
   ifrename 網路介面重命名,好像沒用,關了。
   ifupdown 這個使用來打開網路的,開著它。
   ifupdown-clean 同上。
   klogd linux守護程式,接受來自內核和發送資訊到syslogd的記錄,並記錄為一個檔,所以請開著它。
   linux-restricted-modules-common 這個使用來使用受限制的模組的,你可以從/lib/linux-restricted-modules下查看,如果沒有什麼,你可以關掉它。
   lvm 邏輯卷管理器,如果你沒有請關了它。
   makedev 用來創建設備到/dev/請不要動他。
   mdamd 管理raid用,如果你沒有請關閉它。
   module-init-tools 從/etc/modules 加在擴展模組的,這個一般開著。
   networking 增加網路介面和配置dns用,將它開啟。
   ntp-server 與ubuntu時間伺服器進行同步的,關了。
   pcmcia 啟動pcmica設備,遺憾我有生以來都沒有見過這樣的設備,關了它。
   powernowd 用於管理cpu的用戶端程式,如果有變頻功能,比如amd的quite' cool 那麼就開啟它吧。
   ppp 撥號用的,我關了它。
   ppp-dns 一樣,也關了。
   readahead 預載入服務,讓我想起了win的預讀,當然他們不同,它會使啟動變慢3-4妙,所以我關了它。
   reboot 重啟用的,不要動。
   rmnologin 如果發現nologin,就去除它,在筆記本上不用開啟。
   rsync rsync協定守護,請視情況而定。
   screen-cleanup 一個清除開機螢幕的腳本,隨便。
   sendsigs 重啟和關機時向所有進程發送消息。所以不要管它。
   single 啟動但用戶模式,不用管它。
   stop-bootlogd 從2,3,4,5級別停止bootlogd,不用管它。
   sudo 這個不用說吧,不用管它。
   sysklogd 用於記錄系統日誌資訊,不用管它。
   udev 用戶空間dev檔系統,不用管它。
   udev-mab 同上。
   umountfs 用來卸載檔卷的,不用管它。
   urandom 生成隨即數的,不知道怎麼用,不用管它。
   usplash 那個漂亮的啟動畫面,但是我關了它,它也存在,所以想關他需要把內核起動參數中的splash一句刪掉。
   vbesave 顯卡bios配置工具,不用管它。
   xorg-common 設置x服務ice socket。不用管它。
資料來源:http://www.test104.com/tw/tech/86.html