That's simple enough. When you press the power button a ACPI event triggers the script at /etc/acpi/powerbtn.sh.You can edit that to just run shutdown -h now as the first thing so it looks like:#!/bin/sh# /etc/acpi/powerbtn.sh# Initiates a shutdown when the power putton has been# pressed./sbin/shutdown -h now "Power button pressed"exit 0# leave the old code below (in case you want to revert!)
2013年5月11日
Instant shutdown by pressing the power button (Ubuntu)
2013年5月6日
電腦保養心得
1) 防毒軟件
相信沒有人不安裝防毒軟件, 不過很多人都忽略防毒軟件的更新. 電腦病毒日新月異, 防毒軟件之所以能偵測是因為防毒軟件廠商會每日都會準備病毒樣本更新給自家防毒軟件下載使用. 沒有更新的防毒軟件比沒有安裝防毒軟件更危險, 因為那會給使用者虛假的安全感.
就一般而言, 防毒軟件是會自動上網更新; 但以有例外: i) 電腦沒有連上互聯網; ii) 防毒軟件過期而使用者不留意: 這個情況最常出現於隨廠機附送的防毒軟件試用版.
個人使用Microsoft Security Essentials (MSE): i)小公司商用免費; ii) 即裝即用, 不用每年再行註冊
參考:
[下載] 10套免費防毒軟體 (免破解、免買序號 Free Antivirus)
Microsoft Security Essentials 微軟防毒軟體中文版
2) 定期資料備份
個人使用MozyHome Free, 2GB免費, 會定期自動把文件作備份.
有預算又不想為此煩惱的人可以考慮Backblaze,每個月不用US$5就可以線上備份整台電腦的資料.
參考:
MozyHome Free
3) 定期電腦硬件檢查
電腦中最常出現問題的部分是硬碟(Harddisk)和記憶體(RAM)
PC-doctor
memtest
http://www.passmark.com/products/diskcheckup.htm
4) 定期清理電腦
CCleaner
Disk Defrag
參考:
[下載] CCleaner v3.15.1643 繁體中文版!(清除電腦垃圾,讓Windows跑得更順暢!)
Saving proceduces:
Safe mode + Antivirus
WinPE
相信沒有人不安裝防毒軟件, 不過很多人都忽略防毒軟件的更新. 電腦病毒日新月異, 防毒軟件之所以能偵測是因為防毒軟件廠商會每日都會準備病毒樣本更新給自家防毒軟件下載使用. 沒有更新的防毒軟件比沒有安裝防毒軟件更危險, 因為那會給使用者虛假的安全感.
就一般而言, 防毒軟件是會自動上網更新; 但以有例外: i) 電腦沒有連上互聯網; ii) 防毒軟件過期而使用者不留意: 這個情況最常出現於隨廠機附送的防毒軟件試用版.
個人使用Microsoft Security Essentials (MSE): i)小公司商用免費; ii) 即裝即用, 不用每年再行註冊
參考:
[下載] 10套免費防毒軟體 (免破解、免買序號 Free Antivirus)
Microsoft Security Essentials 微軟防毒軟體中文版
2) 定期資料備份
個人使用MozyHome Free, 2GB免費, 會定期自動把文件作備份.
有預算又不想為此煩惱的人可以考慮Backblaze,每個月不用US$5就可以線上備份整台電腦的資料.
參考:
MozyHome Free
3) 定期電腦硬件檢查
電腦中最常出現問題的部分是硬碟(Harddisk)和記憶體(RAM)
PC-doctor
memtest
http://www.passmark.com/products/diskcheckup.htm
4) 定期清理電腦
CCleaner
Disk Defrag
參考:
[下載] CCleaner v3.15.1643 繁體中文版!(清除電腦垃圾,讓Windows跑得更順暢!)
Saving proceduces:
Safe mode + Antivirus
WinPE
標籤:
solutions,
supporting_docs,
windows
2013年4月17日
Why Chrome windows disappear
One of the possibilities is the boss key function in Chrome Toolbox extension. (shortcut key: alt-`)
http://superuser.com/questions/372025/what-does-alt-do-in-google-chrome
https://code.google.com/p/chromium/issues/detail?id=90422#c9
http://superuser.com/questions/372025/what-does-alt-do-in-google-chrome
https://code.google.com/p/chromium/issues/detail?id=90422#c9
標籤:
apps,
networking,
solutions,
windows
2012年8月1日
gnome-settings-daemon consumes 100% cpu in Ubuntu 12.04
Workaround
sudo mv /usr/lib/https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/969359gnome-settings- daemon- 3.0/keyboard. gnome-settings- plugin ~/
2012年7月4日
libtiff3.dll was not found, GIMP, Separate+
Separate+ in GIMP-Win 2.7.3 (dev):
separate_import.exe - Unable to Locate Component This application has failed to start because libtiff3.dll was not found. Re-installing the application may fix this problem.
http://en.sourceforge.jp/ticket/browse.php?group_id=4063&tid=26293
separate_import.exe - Unable to Locate Component This application has failed to start because libtiff3.dll was not found. Re-installing the application may fix this problem.
http://en.sourceforge.jp/ticket/browse.php?group_id=4063&tid=26293
2012年3月12日
Bootable Linux USB for recovery
1. Download files from
http://www.pendrivelinux.com/downloads/Universal-USB-Installer/Universal-USB-Installer-1.8.8.8.exe
http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/11.10/ubuntu-11.10-desktop-i386.iso
2. Plug in your USB drive with >700MB free space
3. Double click "Universal-USB-Installer-1.8.8.8.exe"
4. Click in "I Agree"
5. Select "Ubuntu 11.10 Desktop" in Step 1
6. Select the downloaded ubuntu-11.10-desktop-i386.iso in Step 2
7. Select the drive letter of your USB drive in Step 3
Do NOT select "Format ?:\ Drive"
8. Set size to 0 in Step 4
9. Click "Create" to proceed
10. Check the alertbox shows 3 actions (instead of 5 actions) and then click "YES"
11. Wait for completion
12. You have your USB drive bootable.
13. Reboot with the USB drive plugged-in.
press F12 or F9 at startup to get a menu and select your USB drive as bootup device.
ref: http://www.tomshardware.com/reviews/windows-pocket,1113-3.html
Then wait for the startup process (or Select "Run Ubuntu from USB" yourself).
14. You should get a desktop, click on the 3rd icon on the left and you can get a file manager.
Plug your portable harddisk and copy your files to it
15. For harddisk checking, click on the 1rd icon on the left desktop,
type the "Disk Utility" and click the icon with "Disk Utility".
In popup window, select the harddisk you have and check SMART Data.
There will be fields called "Bad sector" (which show number of dead region in harddisk)
and "Overall Assessment"
16. For memory checking, select "Test memory" instead of "Run Ubuntu from USB" at startup time.
Then a blue screen shows and the memoey are being tested. It takes about half an hour.
17. For remote desktop access, click on the 1rd icon on the left desktop,
type the "Desktop sharing" and click the icon with "Desktop sharing".
In popup window, click on "Allow other users to view your desktop", "Allow other users to control your desktop" and "Auto config UPnP router...."
Then use Firefox and go to http://checkip.dyndns.org. Tell the address.
Then there will be a yellow-backgrounded text say you can access the desktop with an address, please tell the address. Also tell the reach-ability.
http://www.pendrivelinux.com/downloads/Universal-USB-Installer/Universal-USB-Installer-1.8.8.8.exe
http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/11.10/ubuntu-11.10-desktop-i386.iso
2. Plug in your USB drive with >700MB free space
3. Double click "Universal-USB-Installer-1.8.8.8.exe"
4. Click in "I Agree"
5. Select "Ubuntu 11.10 Desktop" in Step 1
6. Select the downloaded ubuntu-11.10-desktop-i386.iso in Step 2
7. Select the drive letter of your USB drive in Step 3
Do NOT select "Format ?:\ Drive"
8. Set size to 0 in Step 4
9. Click "Create" to proceed
10. Check the alertbox shows 3 actions (instead of 5 actions) and then click "YES"
11. Wait for completion
12. You have your USB drive bootable.
13. Reboot with the USB drive plugged-in.
press F12 or F9 at startup to get a menu and select your USB drive as bootup device.
ref: http://www.tomshardware.com/reviews/windows-pocket,1113-3.html
Then wait for the startup process (or Select "Run Ubuntu from USB" yourself).
14. You should get a desktop, click on the 3rd icon on the left and you can get a file manager.
Plug your portable harddisk and copy your files to it
15. For harddisk checking, click on the 1rd icon on the left desktop,
type the "Disk Utility" and click the icon with "Disk Utility".
In popup window, select the harddisk you have and check SMART Data.
There will be fields called "Bad sector" (which show number of dead region in harddisk)
and "Overall Assessment"
16. For memory checking, select "Test memory" instead of "Run Ubuntu from USB" at startup time.
Then a blue screen shows and the memoey are being tested. It takes about half an hour.
17. For remote desktop access, click on the 1rd icon on the left desktop,
type the "Desktop sharing" and click the icon with "Desktop sharing".
In popup window, click on "Allow other users to view your desktop", "Allow other users to control your desktop" and "Auto config UPnP router...."
Then use Firefox and go to http://checkip.dyndns.org. Tell the address.
Then there will be a yellow-backgrounded text say you can access the desktop with an address, please tell the address. Also tell the reach-ability.
2012年2月24日
Java Cryptography Extension (JCE) Unlimited Strength
To use AES-256 in Java, you need to install extra policy file. As
http://www.ngs.ac.uk/tools/jcepolicyfiles
http://blogs.adobe.com/ADEP/2011/10/configuring-the-jdk-for-rights-management-encryption-using-aes-256-bit-keys.html
If you exported your PKCS#12 file from your browser and used a password that is greater than 7 characters, you may need to download and install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files so that Java applications such as the GSI-SSHTerm can read this file. This is a matter of U.S. policy and U.S. export controls (not due to technical reasons).It seems there are no such restriction in OpenJDK.
http://www.ngs.ac.uk/tools/jcepolicyfiles
http://blogs.adobe.com/ADEP/2011/10/configuring-the-jdk-for-rights-management-encryption-using-aes-256-bit-keys.html
標籤:
java,
networking,
solutions
2012年2月19日
[FIXED] bug in MikTeX -- ps2pdf: No alternate file name found
getting this error when I try to launch ps2pdf:The problem is due to installation path. Try to install with C:\MikTeX make no problem.
ps2pdf: No alternate file name found
ps2pdf: Data: C:\Program Files\MikTeX 2.9
ref: [Sourceforge] ps2pdf not working in MikTeX 2.9
ps. fixed in current version of MikTeX
2012年1月13日
Force IPv4 usage in Java program (eg. zookeeper)
Bug #888643 in zookeeper (Ubuntu): “Zookeeper listen only to IPv6 interface"
JAVA_OPTS="- Djava.net. preferIPv4Stack =true"
2012年1月9日
Windows 7 Aero auto disable at Monday 1am reason: WinSAT
導致 Win 7 Aero 凌晨1點 失效的兇手 WinSAT
開始/執行/輸入 "taskschd.msc"
會出現如下視窗 (可放大) 圖示語系不同但位置相同
於左列找到 Maintenance 資料夾並點選使之反白
接著於視窗右邊選擇 無效化(停用) 即可
2011年12月29日
Anti-alias / smooth font for Java swing program
add "-J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=on" into your java commands
p.s. It works for various Java program, eg. Netbeans
Ref:
http://ubuntuforums.org/showthread.php?t=909327
http://forums.netbeans.org/post-63860.html
http://docs.oracle.com/javase/6/docs/technotes/guides/2d/flags.html#aaFonts
p.s. It works for various Java program, eg. Netbeans
Ref:
http://ubuntuforums.org/showthread.php?t=909327
http://forums.netbeans.org/post-63860.html
http://docs.oracle.com/javase/6/docs/technotes/guides/2d/flags.html#aaFonts
2011年11月6日
Clean Lenovo System Update Temp Cached Files
System Update Disc Usage? - Lenovo Community
Yes, it's ok to remove most files from inside the \Lenovo\System Update\session directory. You should however NOT remove the following files from this location:
- system
- temp
- QuestResponse.xml
- updates.ser
2011年10月18日
dante-client (socksify) broken on Ubuntu 11.04 Natty
ERROR: ld.so: object '/lib/libdl.so.2' from LD_PRELOAD cannot be preloaded: ignored.
Solution:
ln -sf /lib/i386- linux-gnu/ libdl.so. 2 /lib/libdl.so.2
ln -sf /lib/i386- linux-gnu/ libc-2. 13.so /lib/i386- linux-gnu/ libc.so
Ref:
https://bugs.launchpad.net/ubuntu/+source/dante/+bug/767085
Solution:
ln -sf /lib/i386-
ln -sf /lib/i386-
Ref:
https://bugs.launchpad.net/ubuntu/+source/dante/+bug/767085
標籤:
apps,
linux,
networking,
solutions
2011年10月15日
Internet Explorer 6 may change a file name extension from .eps or .ai to .ps
Use Firefox instead.
http://support.microsoft.com/kb/329714/en-us
http://support.microsoft.com/kb/329714/en-us
標籤:
solutions
2011年9月22日
PDF printer disappear after a Adobe Acrobat 8 upgrade
http://acrobatusers.com/forum/deployment-installation/adobe-pdf-printer-disappears-after-81-update#comment-30819
1. Start -> Settings -> Printers and Faxes
2. Add Printer
3. select 'Local printer attached to this computer' (uncheck the 'automatically detect and install my Plug and Play printer' box)
4. In "Use the following port", select "My Documents\*.pdf (Adobe PDF Port)".
5. Pick a random Manufacturer and Printer
6. Printer Name ('Adobe PDF Printer' is what I use).
7. Right-click on your newly created printer in the Printers and Faxes folder -> Properties -> Advanced tab.
8. In 'Driver', select 'Adobe PDF Converter'
9. Done
2011年9月20日
halt problem in Ubuntu 11.04 amd64 and Dell Optiplex 990
Just add the option "reboot=pci" to GRUB_CMDLINE_LINUX in /etc/default/grub
http://ubuntuforums.org/showthread.php?t=1741668&page=7#62
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/768039
http://ubuntuforums.org/showthread.php?t=1741668&page=7#62
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/768039
2011年9月18日
Change Microsoft Security Essentials Update Frequency
1. "C:\Program Files\Microsoft Security Client\Antimalware\MpCmdRun.exe -SignatureUpdate "
http://www.techrena.net/windows/change-microsoft-security-essentials-update-frequency/
2. http://www.mydigitallife.info/fix-microsoft-security-essentials-mse-not-auto-update-virus-and-spyware-definitions-signature-problem/
http://www.techrena.net/windows/change-microsoft-security-essentials-update-frequency/
2. http://www.mydigitallife.info/fix-microsoft-security-essentials-mse-not-auto-update-virus-and-spyware-definitions-signature-problem/
Run Registry Editor (RegEdit).
Navigate to the following registry key:
HKEY_LOCAL_MACHINE/Software/Microsoft/Microsoft Antimalware/Signature Updates
In the right pane, take ownership and grant full control permissions on a registry key, a REG_DWORD value named SignatureUpdateInterval.
Double click on the SignatureUpdateInterval. By default, its value is 24 (in Decimal) or 18 (in Hexadecimal). Change its value to any number between 1 and 24 (both inclusive) in Decimal.
The numerical value determines how frequent and how fast (in hours) Microsoft Security Essentials will check for updates and update the virus and spyware definitions.
Restart the computer.
標籤:
anti-virus,
apps,
solutions,
windows
2011年5月24日
Compile tgif under cygwin (Windows)
Had imake, make, gcc, libX11, libXext, (xterm), libXt(for tgif4.2), libXmu(for tgif4.2), Xming install in your cygwin
Also download tgif (my case 4.1.42)
Then run:
ref:
http://bourbon.usc.edu:8001/tgif/faq/compile.html
http://www.nebadje.org/doku.php?id=forum:blogcls#tgif_on_cygwin
http://uguisu.skr.jp/Windows/app.html
Also download tgif (my case 4.1.42)
Then run:
rm Tgif.tmpl cp Tgif.tmpl-cygwin Tgif.tmpl xmkmf make tgif.exe make install
tgif.exe -display localhost:0
ref:
http://bourbon.usc.edu:8001/tgif/faq/compile.html
http://www.nebadje.org/doku.php?id=forum:blogcls#tgif_on_cygwin
http://uguisu.skr.jp/Windows/app.html
標籤:
apps,
command_line,
linux,
solutions
2011年2月9日
Using Trackpoint in Thinkpad under Linux
我與小黑(ThinkPad X200s)之小紅點
echo -n 1 > /sys/devices/platform/i8042/serio1/press_to_select
sudo apt-get install gpointing-device-settings
2010年12月14日
The AUTORUN.INF file is corrupt or missing
The error message "The AUTORUN.INF file is corrupt or missing" appeer during installation of Microsoft Money(or other software)
It may be due to some protection software, such as antivirus software (Kaspersky actually does) prevent the execution of autorun.inf.
For instance, Kaspersky denies autorun for external devices and processing autorun.inf file in its Access Control protection. In order to disable autorun, do the following:
ref
Corrupt AUTORUN.INF file
Kaspersky :: How to allow/deny autorun for external devices and processing autorun.inf file
It may be due to some protection software, such as antivirus software (Kaspersky actually does) prevent the execution of autorun.inf.
For instance, Kaspersky denies autorun for external devices and processing autorun.inf file in its Access Control protection. In order to disable autorun, do the following:
- Open Kaspersky Anti-Virus.
- Go to the section Protection in the left part of the window.
- Click Device Control and choose Settings in the dialogue box.
- Click the Settings button.
- Uncheck the box "Disable processing autorun.inf" in the block Autorun.
- Reboot the PC to apply the changes.
ref
Corrupt AUTORUN.INF file
Kaspersky :: How to allow/deny autorun for external devices and processing autorun.inf file
標籤:
anti-virus,
apps,
solutions,
system,
windows
訂閱:
文章 (Atom)