Clean that Inbox

December 28th, 2008

Like many other people, I use Linux as a backup server.  The other day, I noticed that daily incremental backup of one of the Windows machines was well over 1 GB even on the day the user was mostly idle.  The only thing the user was doing was … e-mailing.  Aha! (heard the bell?)  It must be that inflated Inbox.

Mozilla-based mail clients like Thunderbird and Seamonkey mail do not physically remove messages that user deletes.  Instead they are only tagged “deleted”.  This is true even after the Trash folder is emptied.  The [supposedly] deleted mails get [really] deleted when Inbox (or any folder for that matter) is compacted.

I went to the blasted machine and did just that and the Inbox went from > 1 GB to a fraction of its original size.

Of course, this is not just Windows.  Huge mail folders can potentially cause trouble and also degrade the performance of the client.  The best strategy to prevent this is to set up an automatic clean up.  In Thunderbird, go to Edit -> Preferences -> Advanced -> Network & Disk Space and then enable the “Compact folders when it will save over…KB” option.

Categories: centos | No Comments

Getting kino to work on CentOS-5

December 20th, 2008

One of the many things I use Linux for at work is to edit movies.  No, not that kind of movies you are thinking about … this is strictly for science work.  Anyway, the first step is to transfer video from a camcorder connected through a firewire port using kino.  I am doing this on a machine running Fedora Core 6.  I attempted to do the work on a CentOS-5 box.  However, going to the capture mode on kino produces an error:

*raw1394 kernel module not loaded or failure to read/write .....

Long story short, this is a known issue, and the kino web site offers a couple of workarounds. I am going to summarize a CentOS version of these workarounds.

Method 1 — requires a kernel from the centosplus repository

(1) Edit /etc/modprobe.d/blacklist-firewire and comment out blacklist firewire-ohci
(2) Reboot
(or run modprobe firewire-ohci to achieve the same without reboot)
(3) Connect the camcorder
(4) Step (3) creates /dev/fw? (? = 0, 1, etc). Change the owner to the logged-in user.
(5) Start kino and go to Capture. Press the Capture button.

Method 2 — Use if Method 1 does not work

(1) Install ieee1394 from the ATrpms repository. Refer to the CentOS Wiki Repository article for the instruction.
(2) Download the kmod-ieee1394 package frpm the ELRepo repository and install it using the rpm -Uvh command. There is no need to reinstall this kernel module upon kernel update.
(3) Download packages libraw1394_8 and libraw1394 from my collection and install them as in (2).
(4) Edit /etc/modprobe.d/blacklist and add these lines:
blacklist firewire_core
blacklist firewire_ohci

(5) Reboot
(6) Chenge the ownership of /dev/raw1394 to the logged in user.

Categories: centos | 2 Comments

Counting [on] CentOS Wiki

December 6th, 2008

CentOS Wiki is filled with information and is one of the most frequently used resources available to CentOS users. But, little known is its statistics page:

http://wiki.centos.org/PageHits

According to Ralph, this page is created through a macro called “PageHits” but not all the details as to how this works are known. Anyway, let’s take a look at some of the top entries as of Dec 05, 2008.

This page shows how often a page was requested since the beginning of
logging. It has no intelligence, every view counts as hit.

 1. 732352 FrontPage
 2. 268550 HowTos
 3. 263042 Repositories
 4. 217961 Repositories/RPMForge
 5. 158478 TipsAndTricks
 6. 136617 FAQ
 7. 112780 HowTos/JavaOnCentOS
 8. 105514 FAQ/CentOS5
 9. 104275 HowTos/Xen/InstallingCentOSDomU
10. 102457 Repositories/CentOSPlus
11.  88726 Manuals/ReleaseNotes/CentOS5.1
12.  77033 Manuals/ReleaseNotes/CentOS5.0
13.  64338 PackageManagement/Yum
14.  64289 HowTos/Custom Kernel
15.  59413 HowTos/I need the Kernel Source
16.  58947 PackageManagement/Yum/Priorities
17.  57351 Manuals
18.  56419 Manuals/ReleaseNotes/CentOS5.2
19.  54229 HowTos/FreeNX
20.  49854 HowTos/PackageManagement/YumOnRHEL
21.  48016 FAQ/General
22.  42976 TipsAndTricks/NTFSPartitions
23.  42750 HowTos/Network/IPTables
24.  41817 TipsAndTricks/YumAndRPM
25.  41442 RecentChanges
26.  40885 HowTos/Nagios
27.  40669 GettingHelp
28.  40373 HowTos/Subversion
29.  37791 TipsAndTricks/WindowsShares
30.  30907 TipsAndTricks/Xen
32.  28906 TipsAndTricks/KickStart
33.  28127 FAQ/CentOS4
34.  27719 HowTos/MigrationGuide/ServerCD 4.4 to 5
35.  27660 Manuals/ReleaseNotes/CentOS5.1/Japanese
36.  26997 TipsAndTricks/VMWare Server
37.  26659 HardwareList


no intelligence … Hmmm, sounds familiar?  Let’s do some analysis. Not so surprisingly, the FrontPage is by far the most often visited page. Also, I knew that the Repositories article was very popular, and that indeed seems to be the case. Things like FAQ or ReleaseNotes are expected to get a lot of hits. What was interesting to me (as a Japanese) was that, among the localized ReleaseNotes, the Japanese version ranked No,1.  This is either because there are so many CentOS users in Japan or the Japanese people do not want to read English (or both).

The kernel-related pages are also well visited despite the fact custome kernels are not supported by the CentOS team.  Alan’s efforts among others are well paid for.  Ned’s IPTables is quite popular, too.  Note this page is relatively young compared to others.

My own small contributions, NTFS and WindowsShares, are listed there indiating a good number of CentOS users still stuck with the other OS.

Categories: centos | No Comments

More about colors – thunderbird

November 22nd, 2008

While we are talking about colors …

As you know, thunderbird has gobs of options you can play with. I usually do not care much about how it looks and just use the default settings. The only thing I have done was to change the background color of sub-windows.

Thunderbird in color

Thunderbird in color

This was easily done by editing the userChrome.css file in ~/.thunderbird/xxxxxx/chrome/ .

#folderPaneHeader,
#folderTree treecol,
#folderTree
{background-color: #ccf !important;}


#acctCentralGrid
{background-color: #cfc !important;}


#threadTree treecol,
#threadTree
{background-color: #fcc !important;}


#msgHeaderView,
#attachmentList
{background-color: #cfc !important;}


#folderpane_splitter,
#threadpane-splitter,
#attachment-splitter
{background-color: #00d !important;}

Categories: centos | No Comments

Why the colorful prompt is good for CentOS

October 20th, 2008

It is rather an old trick – adding a color to your prompt.  But it was resurrected when someone asked a question on a CentOS forum:

how can I change color of root@localhost inside console????

After some cheerful exchange, it turned out that this person wanted to know how to color the root’s prompt.  As usual, a nice team work of regular helpers (especially between Alan and Ned) brought about colorful answers.

In fact, making the root’s prompt a colorful one is indeed a good idea.  It reminds you of the root status in a much nicer way than the usual # prompt.  I put in my root’s ~/.bashrc the following:
export PS1="\[\e[31;1m\][\u@\[\e[34;1m\]\H \W]# \[\e[0m\]"
This gives me  [root@apollo ~]# which, in a way, has some American touch.  Hmmm.

This is all good for bash.  However, my own acount uses (t)csh.  Not to worry.  csh supports colors, too.  For example, putting this line in the .login file (one line):
set prompt =
"\[%{\033[32m%}%n@%{\033[34m%}`echo $cwd`%{\033[0m%}\]$ "

produces  [toracat@/home/toracat]$

I also have an alias for “cd” (one line):
alias cd 'cd \!* ; set prompt =
"\[%{\033[32m%}%n@%{\033[34m%}`echo $cwd`%{\033[0m%}\]$ "'

to get a consistent look (csh again).

Why is this good for CentOS? You can see it in the original CentOS thread:

The person who asked the question was so happy with the help he received that he decided to make a donation to CentOS.  What really helped here was the “please donate” message in the Ned’s signature.  :-)

Categories: centos | No Comments

Socks proxy with auto-config

September 30th, 2008

OpenSSH has built-in support to act as a SOCKS proxy. In my case, there are web sites I can access only from work computers and I need to get to them from home. So, I issue the command from my home computer:

ssh -D 1080 my work IP

However, I do not want to redirect all traffic through work.  Fortunately, you can redirect only selected URLs fairly easily by using a proxy auto-config file.

In firefox, Go to Edit -> Preferences -> Advanced -> Network -> Settings

In the Connection Settings box, select “Automatic proxy configuration URL:” and enter:
file:///path/to/proxylist.pac
The proxylist.pac file may look like this:

function FindProxyForURL(url, host)
{
// Proxy direct connections to these hosts
if (
shExpMatch(url, "http://www.jbc.com/*") ||
shExpMatch(url, "*.sgmjournals.org/*") ||
shExpMatch(url, "http://www.ncbi.nih.gov/*")
) {
return "SOCKS localhost:1080; DIRECT";
}
// Otherwise go directly
else return "DIRECT";
}

For more details on the pac file and auto config, see
http://en.wikipedia.org/wiki/Proxy_auto-config

Categories: centos | No Comments

sshfs – Remote filesystem access made easy

September 21st, 2008

If you often need to access files on a remote machine and do it by ssh login, there is a handy way – sshfs. Here is a simplified howto that works on CentOS.

(1) Set up the rpmforge repository if not done yet (see Installing RPMForge on CentOS )
(2) Either use the dkms-fuse with the stock CentOS kernel or use the centosplus kernel that contains the fuse kernel module.

[root@mybox ~]# yum install dkms-fuse && modprobe fuse

(3) Also install the fuse libraries:

[root@mybox ~]# yum install fuse

(4) Then install the fuse-ssh filesystem:

[root@mybox ~]# yum install fuse-sshfs

(5) Add yourself to the group ‘fuse’:

[root@mybox ~]# usermod -a -G fuse user1

(6) Re-logon to your account
(7) Create a local directory:

[user1@mybox ~]$ mkdir remotedir/

(8) To mount (remote username=usr2):

[user1@mybox ~]$ sshfs user2@machine.example.com: remotedir/

(9) To unmount:

[user1@mybox ~]$ fusermount -u remotedir

Categories: centos | No Comments