Sunday, January 18, 2009
Removing Unnecessary Packages (Ubuntu 8.04 LTS)
Love trying new things on Linux. Occasionally, it happens that I need to remove some of the installed and tested packages. However, removing the package with apt-get or Synaptic does not necessary mean you will remove all the packages installed with it (dependences) .
Quick and Elegant
To remove unnecessary (aka "orphan" packages) use the following:
sudo apt-get autoremove
Works like a charm.
Saturday, January 17, 2009
Perfect Cup of Coffee: French Press
This afternoon a thought came to me that we should try that French press again. It has been a while since I used it.
Tools
- French press
- Grinder
Ingredients- Coffee beans, French (dark) roast
- Water
Preparation
I put two larger cups full of clean and good water to boil. I used microwave oven, but stove can do it, too. Please note an emphasis on good water here. Your coffee contains around 99% of coffee so you do not want to use any stinky water (check what is going on with you tap water, use filtered or bottled water).
While the water is getting to boiling grind the coffee. You do not want to overdo the grinding. Make it coarse so it does not clog the press. Having a freshly ground coffee is generally a very good idea regardless of the way you preparing it.
Put coffee into the press and pour the hot water over it. Stir slowly and carefully. Put the lid on and let it brew for about 3-4 minutes. Do not push down the press yet.
After 3-4 minutes push the press down. Turn lid open and pour into the cups.
This is kind of an excellent mix of Turkish coffee and filter coffee. It has that smooth and rich flavor. I do not put anything in my coffee. You can add cream and/or sugar. Whipped cream goes with it well, too.
Friday, January 16, 2009
Critically Low Battery Settings (Ubuntu 8.04) on Dell Vostro Laptop
I recently noticed that my laptop would not gracefully shut down in the event of battery being critically low. It would display a warning message, but it would go off "sudden death" style. I searched the issue and found that I am not alone. I found some suggestions on changing the settings (thresholds) using gconf-editor.

Changing the settings
In terminal, run gconf-editor. It will open a window as displayed bellow. Select /apps/gnome-power-manager/thresholds/. My default values are displayed to the right.
My "wild guess" at this time is to increase percentage_critical from 3 to 7, and percentage_low to 15. I am also increasing percentage_action parameter from 2 to 5. That should initiate graceful shutdown of my laptop when the battery is at 5 % left.
The settings need to be tested. They may require some more tuning. Will see if the laptop shuts down properly (not "sudden death" style).
Waiting for Conclusion
I am waiting for my battery to go down to that level and see what happens. If it works the settings need to be adjusted for each user.
Update: It worked!
The laptop did a normal shutdown once the battery percentage level when under the newly preset value. Please note that you need to update settings for all users. I am curious if this can be preset on the system level.
Safe Shutdown of Ubuntu 8.04 with APC UPS (USB)
I recently installed Ubuntu 8.04 LTS server on a nice PowerEdge T300 server from Dell. I am also using APC UPS, model Back-UPS XS 1300 LCD with it. Ubuntu's power monitor does correctly reprots the battery charge, but is not shutting down the system when the battery charge is low/critically low. In order to do that I needed to install a nice utility called apcupsd.
Setup
Install the apcupsd package
sudo apt-get install apcupsd
Edit file /etc/default/apcupsd
sudo gedit /etc/default/apcupsd
and change the following line to "yes"
Set ISCONFIGURED=yes
Now edit the configuration file
sudo gedit /etc/apcupsd/apcupsd.conf
Make sure that the following is set:UPSCABLE usb
UPSTYPE usb
DEVICE
NETSERVER on
NISPORT 3551
You can also adjust these values to what you think fits:
BATTERYLEVEL 8
MINUTES 4
Verify Setup
To start the apcupsd service use following command:
sudo apcupsd start
Status can be checked with the following command:
sudo apcaccess status
Restart PC and makes sure that apcupsd is running by checking the status with the same command.
Final test
Unplug the UPS and monitor the status of the battery. When it comes down to the preset values (in my case 8% or 4 minutes left) your system should initiate and complete shutdown process before your battery runs out.
Reference
http://www.apcupsd.org
Tuesday, January 13, 2009
CentOS 5.2 as Desktop: Installation Notes
I am in constant search for production desktop setup. Currently my first choice is Ubuntu 8.04 LTS. Occasionally, I like to try other things and see how things are developing around. One of the most popular server distros is CentOS. Very stable and robust. Checked an article on howtoforge website (Perfect Desktop with CentOS) and decided to give it a try.
Notes Format
This entry will be more in a form of notes for myself and feel free to ask if there is a need for clarification. The notes were entered as I was doing things. They may not appear to be in perfect order and not all the steps were done the same day.
Installation Notes
1. Download and create net install ISO (image is around 7MB).
2. Boot with the new CD, when asked for network repository for the install, put the following:
mirror.centos.org
centos/5.2/os/i386
When asked for the software select only "Desktop" option at this time. The setup will download all the needed software and install it for you. This step may take around hour or so. After the setup, you will be asked for root password and additional users.
3. Reboot and login into the newly install CentOS. Update is here not expected since the install should have downloaded the latest packages. However, you can open the terminal and run:
yum update
4. In Nautilus file manage, change preferences to explorer view and I like icon size at 75%.
5. Install Midnight Commander and htop, in terminal issue the following command as root:
yum install mc htop
6. To install Sun Java, download Linux binary install from java.sun.com. In my case I downloaded JDK (not JRE). Run the binary setup. As root, move the whole newly created Java folder to /opt/jdk1.6.0_11.
Add newly installed Java to alternatives:
/usr/sbin/alternatives --install /usr/bin/java java /opt/jdk1.6.0_11/bin/java 2
/usr/sbin/alternatives --config java
Same applied to Java compiler (if JDK is installed):
/usr/sbin/alternatives --install /usr/bin/javac javac /opt/jdk1.6.0_11/bin/javac 2
/usr/sbin/alternatives --config javac
Add symbolic link to mozilla plugin:
cd /usr/lib/mozilla/plugins ln -s /opt/jdk1.6.0_11/jre/plugin/i386/ns7/libjavaplugin_oji.so
Create java.sh file:
gedit /etc/profile.d/java.sh
Add the following into the file:
export J2RE_HOME=/opt/jre1.6.0_11 export PATH=$J2RE_HOME/bin:$PATH
7. For latest Netbeans, go to www.netbeans.org, and download Linux binary install. In terminal run the following commands:
cd Desktop
su
chmod a+x netbeans-6.5-ml-java-linux.sh
./netbeans-6.5-ml-java-linux.sh
This should find installed Java JDK and install Netbeans 6.5 into /usr/local folder.
8. Webcore fonts (aka standard Microsoft truetype fonts):
http://avi.alkalay.net/software/webcore-fonts/webcore-fonts-3.0-1.noarch.rpm
Save the RPM file on Desktop. Doubleclick on the file. It will prompt for root password to perform RPM install. Accept and let install.
9. Configure repositories (aka repos)
yum install yum-priorities yumex
Check the following file
nano /etc/yum/pluginconf.d/priorities.conf
Verify the following content (should be there already)
[main]
enabled=1
10. Adobe Acrobat Reader repo:
rpm -Uhv http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
Download Acrobat Reader RPM from Adobe website:
10. RPMforge repo:
http://apt.sw.be/redhat/el5/en/i386/RPMS.rpmforge/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Install additional packages:
yum install libdvdcss libdvdread libdvdplay livdvdnav lsdvd mplayerplug-in mplayer mplayer-gui compat-libstdc++-33 flash-plugin gstreamer-plugins-bad gstreamer-plugins-ugly libquicktime htop
Answer with "y" and let yum install these from RPMforge repos.
11. Install additional codecs:
http://www1.mplayerhq.hu/MPlayer/releases/codecs/mplayer-codecs-20061022-1.i386.rpm
http://www1.mplayerhq.hu/MPlayer/releases/codecs/mplayer-codecs-extra-20061022-1.i386.rpm
Download these and then click on them to install.
12. Skype:
Download RPM from Skype website and install.
13. aMSN:
install tk GUI toolkit package (tk) with yum or Yum Extender
go to aMSN project web page and download an installer for 8.4 Tcl/Tk version
http://www.amsn-project.net/linux-downloads.php
chmod a+x amsn-0.97.2-1.tcl84.x86.package
./amsn-0.97.2-1.tcl84.x86.package
Click Y to allow download of support code and continue.
First time you run aMSN it will ask for TLS. Before trying to login, set Firefox as default browser in Preferences. Then try to login and let aMSN download TLS and install it for you.
Additional packages from RPMforge you might need for aMSN webcam and audio:
dkms-gspca libsnack
14. Opera:
Go to Opera website and download RPM for RHEL 5 and install it.
Additional programs of interest for a desktop:
xchat scribus inkscape
15. Scilab
goto Scilab webpage and download binary tar.gz file. Unpack to Desktop (creates folder scilab-5.0.3) and move the whole folder to /usr/local/.
Add menu item to enable start from menus. An icon can be found in shared folder.
Conclusion
I tried the setup on several PCs (P4 Compaq, P4 Dell Inspiron, Dell Vostro 1400 laptop). I actually got pretty warmed up with the idea to adopt the thing.However, a variety of small issues such as sound card detection, bluetooth detection, and occasional slow down with Firefox made me wait for little newer version. I always loved Red Hat based distros Fedora and CentOS, but for serious desktop use Fedora seems to be too edgy and CentOS too conservative.
References
http://fundaism.blogspot.com/2008/08/microsoft-fonts-on-centos.html
http://jaysonrowe.wordpress.com/2008/08/06/centos-as-a-workstation/
http://www.howtoforge.com/installation-guide-centos5.1-desktop

