2022年2月28日 星期一
2016年9月25日 星期日
2010年11月23日 星期二
[Tips] Tips to make Ubuntu faster
最近遇到問題是檔案夾開啟的速度非常緩慢,就看看是否有什麼方法可以調整一下Ubuntu的效能,目前照網路上常見的幾招來改,看起來效果不錯: )
1.更改置換檔(swap)使用率設定
2.使用readahead(不用設定)
3.使用localepurge清除不需要的語言檔
4.使用Preload(不用設定)
5.使用Prelink
6.關閉不需要的Gnome作業階段
7.關閉不必要的系統服務(Service)
以sysv-rc-conf修改不同runlevel服務啟動的狀態
8.同步啟動(Concurrent Booting)
修改啟動的rc設定檔
有些設定還沒完全瞭解原理,之後碰到再寫清楚吧
reference: Ubuntu 進階優化和調校
1.更改置換檔(swap)使用率設定
$ sudo vim /etc/sysctl.conf新增一行
vm.swappiness=10重啟sysctl讓設定生效
$ sudo sysctl -p
2.使用readahead(不用設定)
$ sudo apt-get install readahead
3.使用localepurge清除不需要的語言檔
$ sudo apt-get install localepurge
4.使用Preload(不用設定)
$ sudo apt-get install preload
5.使用Prelink
$ sudo apt-get install prelink修改設定
$ sudo vim /etc/default/prelink新增一行
PRELINKING=yes執行cron
$ /etc/cron.daily/prelink
6.關閉不需要的Gnome作業階段
System -> Preferences -> Startup Applications
7.關閉不必要的系統服務(Service)
以sysv-rc-conf修改不同runlevel服務啟動的狀態
$ sudo apt-get install sysv-rc-conf
$ sudo sysv-rc-conf
8.同步啟動(Concurrent Booting)
修改啟動的rc設定檔
$ sudo vim /etc/init.d/rc修改CONCURRENCY從none改為shell
CONCURRENCY=shell
有些設定還沒完全瞭解原理,之後碰到再寫清楚吧
reference: Ubuntu 進階優化和調校
2009年2月28日 星期六
[轉錄]Enable Multiple Concurrent Remote Desktop Connections in Windows XP
1.Download the patched termsrv.dll:
Windows XP RTM, SP1 and SP2: termsrv.dll (version 5.1.2600.2055)
Windows XP SP2: termsrv.dll (version 5.1.2600.2180)
Windows XP SP3: termsrv.dll (version 5.1.2600.5512)
2.In safe mode, replace the patched termsrv.dll in the %windir%\System32, %windir%\ServicePackFiles\i386 and %windir%\System32\dllcach folder
3.Modify/Add the registry as follows:
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\Licensing Core]
"EnableConcurrentSessions"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"EnableConcurrentSessions"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"AllowMultipleTSSessions"=dword:00000001
4.Modify the Group Policy Editor by gpedit.msc:
Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services -> Limit Number of Connections = 5
Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services -> Allow users to connect remotely to this computer = enabled
Fast User Switching in Control Panel -> User Accounts -> Change the way users log on or off = enabled
5.Restart and enjoy it
see here
Windows XP RTM, SP1 and SP2: termsrv.dll (version 5.1.2600.2055)
Windows XP SP2: termsrv.dll (version 5.1.2600.2180)
Windows XP SP3: termsrv.dll (version 5.1.2600.5512)
2.In safe mode, replace the patched termsrv.dll in the %windir%\System32, %windir%\ServicePackFiles\i386 and %windir%\System32\dllcach folder
3.Modify/Add the registry as follows:
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\Licensing Core]
"EnableConcurrentSessions"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"EnableConcurrentSessions"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"AllowMultipleTSSessions"=dword:00000001
4.Modify the Group Policy Editor by gpedit.msc:
Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services -> Limit Number of Connections = 5
Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services -> Allow users to connect remotely to this computer = enabled
Fast User Switching in Control Panel -> User Accounts -> Change the way users log on or off = enabled
5.Restart and enjoy it
see here
Linux Trouble Shooting
忘記密碼:
1.重新開機後, 按ESC進入開機管理程式(GRUB)
2.輸入e進入編輯模式
3.選擇 kernel /boot/vmlinuz 這行
4.輸入e進入編輯模式
5.輸入runlevel (若要修改密碼, 輸入1或輸入single), 按下enter退出編輯模式
6.輸入b並重開機則進入single user mode without password
MBR壞掉:
1.使用rescue光碟開機: linux rescue
2.grub-install /DEVICE ( 例如: /dev/hda )
3.若 /sbin/grub: not found.
4.進入grub模式: grub
5.grub> root (hd0, 0) # (hd0, 0) 第二個0是linux boot partition mark
6.grub> setup (hd0)
7.grub> quit
/etc/fstab壞掉
1.使用single user mode登入系統
2.mount -n -o remount,rw /
3.重新修改/etc/fstab
1.重新開機後, 按ESC進入開機管理程式(GRUB)
2.輸入e進入編輯模式
3.選擇 kernel /boot/vmlinuz 這行
4.輸入e進入編輯模式
5.輸入runlevel (若要修改密碼, 輸入1或輸入single), 按下enter退出編輯模式
6.輸入b並重開機則進入single user mode without password
MBR壞掉:
1.使用rescue光碟開機: linux rescue
2.grub-install /DEVICE ( 例如: /dev/hda )
3.若 /sbin/grub: not found.
4.進入grub模式: grub
5.grub> root (hd0, 0) # (hd0, 0) 第二個0是linux boot partition mark
6.grub> setup (hd0)
7.grub> quit
/etc/fstab壞掉
1.使用single user mode登入系統
2.mount -n -o remount,rw /
3.重新修改/etc/fstab
2008年3月31日 星期一
FreeBSD Services
其實service和daemon我是混著用的 :Q
在FreeBSD, service有兩種啟動方式, stand-alone和super-server(inetd), 兩種方式各有優缺點, 看個人需求而定... 而這兩種服務的設定分別由rc.d system和inetd.conf來控制
根據手冊所說, "從2002年起, FreeBSD 整合了NetBSD的 rc.d機制來作為系統服務啟動機制..."
rc.d system是Stand-Alone模式的設定, 包含
/etc/rc
而Super-Server透過/etc/inetd.conf來控制, 但是服務名稱需參考/etc/services
在FreeBSD, service有兩種啟動方式, stand-alone和super-server(inetd), 兩種方式各有優缺點, 看個人需求而定... 而這兩種服務的設定分別由rc.d system和inetd.conf來控制
根據手冊所說, "從2002年起, FreeBSD 整合了NetBSD的 rc.d機制來作為系統服務啟動機制..."
rc.d system是Stand-Alone模式的設定, 包含
/etc/rc
- # 系統啟動所執行之script, 並執行/etc/rc.subr
- # 使/usr/local/etc/rc.d/*下的script作用
- # 透過ports或packages所安裝的軟體, 通常會新增*.sh在此目錄下(須配合/etc/rc.conf)
- # 系統網路設定與開機所要啟動的服務
- # 預設之系統服務設定
- # 個別服務啟動之script
- # shutdown命令所執行之script
而Super-Server透過/etc/inetd.conf來控制, 但是服務名稱需參考/etc/services
2008年2月26日 星期二
在VMWare上安裝Windows 98
由於手上這片Windows 98無法開機, 因此剛安裝時手忙腳亂了一下, 在此簡述我的安裝步驟...
- 先到allbootdisk下載Windows98開機片
- 以此一開機片開機, 選取Start computer with CD-ROM support
- 切到C分割區, fdisk喜歡的樣式
- 重開機, 選擇以光碟開機
- 切到A分割區, format c:
- 掛載Windows 98 ISO於CD-ROM
- 切到E分割區, dir若可看到setup執行檔, 就可開始安裝了
2008年1月22日 星期二
Windows Startup
Windows Startup Disk includes:
Windows Boot:
- Ntldr
- Ntdetect.com
- Boot.ini
- Ntbootdd.sys
Windows Boot:
- After the power-on self test(POST) loads the system BIOS into memory. the BIOS reads the contents of the master boot record(MBR). The MBR takes control, finds the active partition, and loads the boot sector from the active partition.
- The boot sector program reads the root directory and loads Windows Loader(NTLDR).
- NTLDR loads the basic memory configuration and switches to 32-bit mode(protected mode). NTLDR then places itself into high memory to free as much memory space as possible.
- NTLDR reads boot.ini to find the operation system. If boot.ini is not present, NTLDR assumes the Windows OS is in the C:\Windows directory.
- NTLDR switches back to 16-bit mode and loads ntdetect.com, which is a 16-bit aplication. NTDETECT determines the computer's physical environment. This determination occurs every time Windows OS starts, so the environment can change for each boot.
- NTLDR loads into memory and reads the resource map that NTDETECT builds.
- NTLDR switches the system back to protected mode. NTLDR then sets up the ring 0 mode for the kernel and loads the proper kernel(NTOSKRNL) for the computer. NTLDR pulls in the proper Hardware Abstraction Layer(HAL) and all boot drivers. Everything that NTDETECT collects becomes the HKEY_LOCAL_MACHINE/HARDWARE Registry key.
- NTLDR starts the run process for NTOSKRNL.
2008年1月10日 星期四
FreeBSD之使用者帳號建立
從Linux轉換到FreeBSD, 第一步就踢到鐵板 @@"
FreeBSD的使用者帳號建立有兩招,
第一招是使用互動式命令列adduser, 第二招是修改/etc/passwd和/etc/group和建立home目錄後再pwd_mkdb,
pwd_mkdb步驟是根據/etc/passwd所讀入的檔案, 產生帳號資料庫...
似乎比較麻煩, 但事實上系統為了存取效率, 實際上系統並沒有直接使用passwd及master.passwd兩個文字檔, 而是將之轉成database型式的另外兩個檔案pwd_db及spwd_db, 這是由指令pwd_mkdb所產生的(本句轉載自成大turtle)
由以上可知, FreeBSD之帳號資料不真正儲存於/etc/passwd, /etc/group, /etc/master.passwd, 若不進行pwd_mkdb, 一切都是假的...
可由chpass修改帳號資料後出現的錯誤訊息(chpass: entry inconsistent)看出,
而指令id則是讀取pwd_db及spwd_db內真正之帳號資料...
而刪除帳號簡單多了, 只要刪除/etc/passwd, /etc/group使用者資料, 刪除/home, /var/mail目錄即可...
最後順便註記一下, FreeBSD和Linux小地方的差異, 例如
#chown -R USER:USER /tmp/DIR //FreeBSD和Linux都可
#chown USER:USER -R /tmp/DIR //FreeBSD出現錯誤訊息(chown: -R: No such file or directory)
FreeBSD的使用者帳號建立有兩招,
第一招是使用互動式命令列adduser, 第二招是修改/etc/passwd和/etc/group和建立home目錄後再pwd_mkdb,
pwd_mkdb步驟是根據/etc/passwd所讀入的檔案, 產生帳號資料庫...
似乎比較麻煩, 但事實上系統為了存取效率, 實際上系統並沒有直接使用passwd及master.passwd兩個文字檔, 而是將之轉成database型式的另外兩個檔案pwd_db及spwd_db, 這是由指令pwd_mkdb所產生的(本句轉載自成大turtle)
由以上可知, FreeBSD之帳號資料不真正儲存於/etc/passwd, /etc/group, /etc/master.passwd, 若不進行pwd_mkdb, 一切都是假的...
可由chpass修改帳號資料後出現的錯誤訊息(chpass: entry inconsistent)看出,
而指令id則是讀取pwd_db及spwd_db內真正之帳號資料...
而刪除帳號簡單多了, 只要刪除/etc/passwd, /etc/group使用者資料, 刪除/home, /var/mail目錄即可...
最後順便註記一下, FreeBSD和Linux小地方的差異, 例如
#chown -R USER:USER /tmp/DIR //FreeBSD和Linux都可
#chown USER:USER -R /tmp/DIR //FreeBSD出現錯誤訊息(chown: -R: No such file or directory)
2007年12月13日 星期四
Embedded Linux
最近這幾天在上課... Embedded Linux
課程時間短, 因此內容並沒有很深入,
而教學內容不外乎介紹linux programming和如何porting,
還使用了Minidoochun和SkyEye的模擬器,
一般講開發Embedded Linux大概分為...
1. Kernel
2. Root File System
3. Boot Loader
4. Applications
待續...
課程時間短, 因此內容並沒有很深入,
而教學內容不外乎介紹linux programming和如何porting,
還使用了Minidoochun和SkyEye的模擬器,
一般講開發Embedded Linux大概分為...
1. Kernel
2. Root File System
3. Boot Loader
4. Applications
待續...
2007年11月5日 星期一
到底該選哪一套OS呢?
讓Google告訴你:
11,000,000 : CentOS
63,000,000 : Debian
34,200,000 : Fedora
13,700,000 : Mandrake
31,200,000 : RedHat
32,500,000 : SuSE
73,400,000 : Ubuntu
34,900,000 : FreeBSD
9,140,000 : NetBSD
11,200,000 : OpenBSD
我真看不出選擇RedHat的原因,
Debian, FreeBSD, 我來了!
11,000,000 : CentOS
63,000,000 : Debian
34,200,000 : Fedora
13,700,000 : Mandrake
31,200,000 : RedHat
32,500,000 : SuSE
73,400,000 : Ubuntu
34,900,000 : FreeBSD
9,140,000 : NetBSD
11,200,000 : OpenBSD
我真看不出選擇RedHat的原因,
Debian, FreeBSD, 我來了!
訂閱:
意見 (Atom)
