Skip to navigation

Java plugin in Firefox

April 8th, 2008

I used to have trouble with the system wide installation of Firefox on Gutsy (though I don’t remember what the trouble was), so I installed it on a user basis in each user’s home directory and made all the relevant icons point to /home/user/firefox/firefox

Because of this, I had to create a symlink in that user-based Firefox’s plugin directory:

cd /home/user/firefox/plugins
ln -s /usr/lib/firefox/plugins/libjavaplugin.so

(I don’t recall installing Java. sudo aptitude search java shows I have following installed:)

sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-plugin

Getting 256 color support working for mutt in xfce4-terminal

April 5th, 2008

Mutt supports 256 colors if you terminal does, and that in turn seems to depend both on the terminal and on ncurses.

For me, using Xfce on Xubuntu Gutsy, running mutt in a xfce4-terminal, 256 color support didn’t work out of the box. Putting any colorN into the ~/.muttrc yielded a “colour not supported by term” hiccup during mutt startup, and mutt just displayed the relevant item in white (the default fg color). It is also possible to find out how many colors a terminal supports with tput colors, and for me, this showed “8”.

To solve the problem:

sudo aptitude install ncurses-term

Additionally, I had to change the xfce4-terminal preferences. In the “Advanced” tab, in the field for “$TERM setting:”, change the name to xterm-256color

Voila:

$ tput colors
256

And mutt now supports lines such as

color   index       color214  default   ~O

in the ~/.muttrc.

BTW, default as the background color makes mutt use the transparent terminal background, if you have one.

Addendum

If you want to set up mutt to use some of those pretty 256 colors, you probably want to see a palette relating the numbers to the colors. At least I did, and I didn’t see a very easy way to do this at first, but I found one here. Specifically, download this perl script and execute it in your terminal to show a palette of colors relating each to its number. Pick the numbers you like and translate their number N to colorN in your ~/.muttrc where you normally would use one of the named colors.

Addendum 2

Changing the $TERM setting to “xterm-256color” caused two problems, both of which you can work around:

  • When I ssh into some remote servers, some apps have problems and say something about “xterm-256color not defined.”. I’ve put in an alias into my .bashrc for these servers to do export TERM=xterm && ssh SERVERNAME.
  • Mutt did not recognize the backspace key anymore in the index and pager (I had set a “bind” and a “macro”. Thanks to Kyle on the mutt-users mailing list, I learned to find the information with
    $ infocmp -1 -L xterm-256color | grep key_backspace
                   key_backspace=^H,
    $ infocmp -1 -L xterm | grep key_backspace
                   key_backspace=\177,

    … and then I just changed <backspace> to \177 in the .muttrc, and now it works.

CiteULike: upload pdf files to a group

April 1st, 2008

The good

CiteULike now offers a feature that makes it much more useful: You can not only upload personal pdf copies of papers, but you can finally share them with others in your group.

The bad

This is only possible for private groups, not for public groups.

The ugly

There is no explicit mention anywhere in your group whether it is “private” or “public”. It seems private groups are those where you have to invite others to join, so check for that criterion. Furthermore, if you’ve already created a group and it is public, you need to e-mail CiteULike for them to change it to private for you (which they promptly do).

Confusingly, the CiteULike interface does not prevent you from presumably posting pdf copies to public groups. I had such a “public” group, which only had me and one other user as member. Erroneously thinking it “private”, for numerous articles, when posting the article I ticked the checkboxes next to my personal library and the group library (both showed up), and I uploaded a pdf and ticked the checkbox “I have the right to distribute this document” which showed up underneath the pdf upload field conveniently labeled “You can upload a PDF to private groups which you are a member of. If you wish to do this, you must indicate that you have the right to do so.” (see image)

CiteULike text when uploading pdf to public group

However, the pdf files never got posted to the group, since it was in fact “public”. If you do this, no pdf files get posted to the group, but there is no error message alerting you to this fact. So do make sure first that the group is private, and if in doubt, check with CiteULike. If you don’t, there is no easy way to transfer your pdf files from your user account to your group via the regular interface. Instead, the interface asks you to upload a new pdf file for each article, this time to the group, even if you already have a pdf file in your personal library. Copying and duplicating don’t copy or duplicate the pdf file to your group. Luckily, when I ran into this problem, the CiteULike folks were kind and responsive and copied the pdf files to the group library.

Conclusions

  1. With the possibility to post pdf files to a private group, CiteULike has made a huge leap in usefulness for academic collaboration.
  2. Watch out and make sure your library is private before you upload pdf files to it.
  3. CiteULike staff are helpful and responsive, but the web interface still needs some work.

Mutt: delete duplicate e-mail messages

March 31st, 2008

Sometimes, if you consolidate different mailboxes where some of the messages are in both mailboxes, you end up with duplicates.

With mutt, it is really easy to delete one copy of each duplicate. I got this tip from here.

You need to have set duplicate_threads = yes, either put it in your ~/.muttrc, or check whether it is on by default (it is for me). To see the value of a variable, while you’re running mutt, say

:set ?duplicate_threads

and it will display the current value (note the leading colon, and of course replace “duplicate_threads” with the variable name you want to see).

You also need to have your mailbox sorted by message threads. This is a nice feature in general, similar to the messages threads in Gmail (but mutt’s implementation is much more user friendly, in my opinion). If you haven’t already set sort=threads in your ~/.muttrc, you can sort “on the fly” while you’re in a mailbox: type o (to sort; mutt then asks for the criterion to sort on, and tells you the options) followed by d (for date).

Now say T to tag a certain pattern, put in ~= as the pattern. Duplicates (one copy of each message that mutt sees twice in the folder) are now tagged. To delete them, either type just d (this will work if you have set auto_tag=yes), or type ; to apply the next command to all tagged messages, then hit d.

Addendum

Actually, it’s much easier, you can skip the tagging step and just do D (for “delete matching pattern” followed by ~=. If you’re adventurous, you can set Mutt to automatically rid your mailboxes of duplicates using a folder-hook, like this (in your ~/.muttrc)

folder-hook . push "<delete-pattern>~=<enter>"

This is handy together with

folder-hook . 'set record="^"'

which always puts your “sent” copy into the current mailbox — handy for developing meaningful threads of incoming mails and replies. However, of course it results in duplicates if you are on the cc or if the mail is going to a mailing list you’re subscribed to. Enter the above folder-hook — no more duplicates.

If you’re even more adventurous, you could add updating your mailbox (i.e., purging messages marked for deletion) to the above folder-hook, like this:

folder-hook . push "<delete-pattern>~=<enter>$"

Sort printer (cupsys & lpq) password problem and quickly cancel print jobs

March 26th, 2008

My Brother HL-2030 printer got recognized automatically and printed without a problem, but until now I wasn’t able to fully manage it: both the web interface (http://localhost:631) and the settings in Xfce Menu → Settings → Printing kept asking for a password but wouldn’t accept my username and password.

I had to add my user to the group lpadmin. In the Xfce Menu, go to System → Users and Groups. Click on “Manage Groups”. Select lpadmin and click on “Properties”. Check the members you want to add.

Problem sorted. To quickly cancel all jobs, I just have to open a terminal window and type:

cancel -a