Customizing SeaMonkey

With the latest Firefox update (31.2.0) I decided to migrate to something more traditional, like SeaMonkey. I am not going to list all the reasons for my decision to abandon Firefox, as it will turn into a rant (and who cares?). I do not exactly like the path the browser has taken and I am tired of doing so many tweaks (including installing addons) in order to make it look like it used to. All that being said, I do respect the developers behind the project and wish Firefox all the best. If an addon appears that can restore the previous look and feel, I will come back to it. There’s this discussion at Slashdot.

Now SeaMonkey. At the moment it is version 2.30, installed on Slackware 14.1 by slackpkg. I went to the browser’s Extensions collection and went through the Interface Customizations category. The following caught my attention:

  • Menu Wizard: Removing, moving and renaming of menus.
  • Tab Wheel Scroll: Switch tabs by scrolling with the mouse wheel.
  • CuteButtons — Cystal SVG: Add icons to buttons/menus/anywhere.
  • Sea Fox: Transform SeaMonkey into Firefox 3..
  • SeaTab-X: Adds Firefox-style tab closers into SeaMonkey.
  • MonkeyFix: Fixes up numerous SeaMonkey browser interface issues (eg. adding support for popup ALT attributes), as well as adding some handy features for developers and power users (eg. configure source viewer, work online/offline).

I played with them and in the end I left only Tab Wheel Scroll, SeaTab-X and MonkeyFix. The last one is great, adding a lot of functionality to the interface, including additional buttons. I also rearranged some of the buttons, added the search fields, etc. In the end I got something very much to my liking.

Screenshot?

Screenshot - 11072014 - 07:16:47 PM

Leave a comment

Filed under desktop, network

GTK1 engine and theme

I like to set a theme for GTK1, so the few programs that use the toolkit do not look as ugly. There is the Industrial engine and theme for GTK1, which has not been developed for a long time, but works just fine. It can be installed from SBo and it does not conflict with the gtk-engines package.

Once the engine/theme has been installed, it is time to select it to be used for GTK1 programs. A tiny, little program that can do this is gtk1-theme-switch, also available from SBo. It will list all GTK themes, as well as any XFCE window manager themes. So don’t get confused by the long list and make sure the theme you select “Industrial”.

Why would anyone want to set a theme for GTK1? Well, at least for me there are still some programs that I use that rely on GTK1. XMMS, that comes with the default Slackware install, is an example. Now, its Preferences window looks much better:

Screenshot - 11012014 - 01:00:27 PM

Other programs are the various XMMS plug-ins, Grip2, Arka.

I have mentioned about setting a GTK1 theme before, but I decided it needed its own post…

Leave a comment

Filed under desktop

Convert mp3 tags encoding

I need to change the language encoding of some mp3 files, because they are not displayed properly in Clementine. The song names and albums are in Cyrillic, so I wanted to convert all tags text to CP1251. I googled around and found the solution here. I decided to use the mid3iconv method. I installed mutagen from SBo, and executed the following in the folder with the files:

find . -name "*.mp3" -print0 | xargs -0 mid3iconv -e CP1251 -d

The music in question is Nautilus Pompilius – MP3 КОЛЛЕКЦИЯ. The disc contains several albums and is sold as an mp3 collection.

Leave a comment

Filed under media

Batch resize of pictures

I had generated graphics from the Simple Modular Architecture Research Tool (S.M.A.R.T.) in the highest possible resolution. However, later on I needed to scale down the graphics.

How to do that? I searched a bit and I found these explanations about the convert command, part of Imagemagic. Very useful tips there, however I needed something that will batch process a bunch of picture files. The command mogrify, also part of Imagemagic, is what I needed.

Just go to the folder with the pictures and do:

mogrify -resize 50% *

This will resize in half everything in the current folder, overwriting the original files. In case, you may need the original files later, better back them up. Also, Imagemagic comes with the standard Slackware installation.

Leave a comment

Filed under Academic, media

Firefox: disable the built-in PDF viewer

When the built-in PDF viewer arrived for Firefox, I was quite excited. However, I have to admit that it does not always work well. Sometimes fonts look weird and pictures distorted.

If it does not work well enough — let’s disable it! I searched and found the answer here. Open about:config and set the following to True:

pdfjs.disabled

Now, to make Firefox embed my preferred PDF viewer, I installed mozplugger from SBo. Its configuration file is /etc/mozpluggerrc and the PDF settings start at line 219 for this release (version 2.1.4). Edit to your liking, but even xpdf works very nicely, embedded into Firefox.

You may need to do one last thing. Go to Edit > Preferences > Applications, search for PDF and make Firefox use MozPlugger:

Screenshot - 09252014 - 08:14:04 PM

That’s it. Restart the browser if settings do not take effect.

By default, Adobe Acrobat (acroread) is commented out in /etc/mozpluggerrc. Since this is the particular PDF viewer I like to use, I uncommented it and proceeded as described previously. The instructions are for Seamonkey, but the steps work analogously for Firefox.

Leave a comment

Filed under network, office, SlackBuilds

Converting html

I need to convert a simple webpage to PDF and picture format. Usually, I would just take a screenshot, however it is too big. I searched and I found a nice little tool, called wkhtmltopdf. It can be easily installed from SBo. To convert a webpage to PDF, using default settings, is extremely easy. Just do the following in the terminal:

wkhtmltopdf example.html example.pdf

I was pleasantly surpised to find an additional program in the package, called wkhtmltoimage. It does what the name suggests — converts your html file to an image. Its use is also very easy:

wkhtmltoimage --format png --quality 100 example.html example.png

The above command will convert the html file to png, with high quality (100). Very nice!

Leave a comment

Filed under misc, office

GenomeTools

I need to export gene coordinates and exon organisation as a figure. I have prepared the annotations in UniPro Ugene, which I have installed from SBo. A nice tool for graphical representation of such data is provided by the GenomeTools software. It can be easily installed from SBo, too.

So, what is the strategy?

First, in UniPro Ugene select the annotations you want to export, right click and go Export > Export annotations. Then, select the gff format for the exported file, e.g. “example.gff“.

Now, it’s time to convert example.gff to graphics with the help of GenomeTools. Open up a terminal, navigate to the folder where the example.gff file is and execute the following command:

gt sketch -format svg -style my.style -start 1 -end 40000  output1.svg example.gff

Detailed explanations and instructions can be found in the corresponding section of the GenomeTools web-site.  Brief explanation below:

  • gt sketch will use the AnnotationsSketch library to create a drawing
  • -format svg specifies the drawing to be a SVG. Other formats include PNG, PDF or PostScript
  • -style my.style tells the program to use a custom style file
  • -start 1 -end 40000 tells the program to render a sketch between nucleotides 1..40000
  • output1.svg is the name of the output file
  • example.gff is the name of the input, annotations file

Therefore, this will create a SVG output file from example.gff, called output1.svg, using a custom style for the region between nucleotides 1..40000.

The SVG file can be additionally edited with Inkscape, if necessary. And here’s an example of what GenomeTools can do (from the program’s site):

annotation

Beautiful, isn’t it?

Leave a comment

Filed under Academic, SlackBuilds

Clearing syslog

Due to some reason, my /var/log/syslog had grown over 500MB. Since I have /var mounted to a separate partition I noticed it easily. I had never had such an issue, so I googled around and found this very old post. Decided to give it a try and just renamed the file and restarted syslog as it says:

mv /var/log/syslog{,.`date +%Y-%m-%d`}
kill -HUP `cat /var/run/syslogd.pid`

I saved the old syslog to another partition so I can check it later (still haven’t done it) and see what the problem was.

importantI just want to make it very clear, that I do not know if this is harmless.

So far I don’t seem to have any issues.

Leave a comment

Filed under misc, system

Amino acid sequence as a column

I need to present an amino acid sequence as a column, so I can paste it in a spreadsheet document (to serve as a reference to other analyses). There is a relatively straightforward way to do this. I have EMBOSS suite and the associated EMBASSY installed from SBo. I used the tool called SHOWPEP, with sequence only display format:

showpep

 

And below, from the Advanced Options, I set “Width of sequence to display” to 1:

showpep1Press the GO button and it’s done. Now you can just copy and paste it.

Great!

Leave a comment

Filed under Academic

Sound in Skype 4.3

Since version 4.3, Skype for Linux requires PulseAudio. It is available from SBo, but since Skype is a 32bit program only, the necessary 32bit compatibility packages should be installed as well. I am running Slackware64 14.1 -multilib system and I have a virtual machine with Slackware 32. So what I did was:

First of all, PulseAudio needs its own group and user. You can add them like this:

# groupadd -g 216 pulse
# useradd -u 216 -g pulse -d /var/lib/pulse pulse

In the virtual machine, I compiled the following from SBo:
speex | an audio compression format designed for speech
json-c | JSON library in C
pulseaudio | PulseAudio Sound Server

I converted the m to compat32 packages on my host machine like this:

convertpkg-compat32 -i speex-1.2rc1-i486-3_SBo.tgz -e tgz

In case you have no virtual machine at hand, you can use sbotools which is capable of creating compat32 packages from SlackBuilds.org, like this:

sboinstall --compat32 speex

However, with the above approach, the compilation of pulseaudio broke.

Then, I compiled the above packages on the host x86_64 system and installed them together with the ready compat32 packages and Skype. This worked for me right away. I had sound notifications, could hear the Skype test call and was able to record a message and hear it back.

There has been an active discussion about it on LQ where people reported various problems. There were also many suggestions, solutions and a user even prepared packages. From reading the discussion, I decided to configure an un-intrusive set up of PulseAudio. Following the Arch Linux Wiki article, I modified these files as suggested:

/etc/pulse/daemon.conf | Replace these with the proper values:

exit-idle-time = 0 # Exit as soon as unneeded
flat-volumes = yes # Prevent messing with the master volume

/etc/pulse/client.conf | Replace these with the proper values:

# Applications that uses PulseAudio *directly* will spawn it,
# use it, and pulse will exit itself when done because of the
# exit-idle-time setting in daemon.conf
autospawn = yes

/etc/pulse/default.pa | Replace the entire content of this file with this:

.fail
    # Set tsched=0 here if you experience glitchy playback. This will
    # revert back to interrupt-based scheduling and should fix it.
    #
    # Replace the device= part if you want pulse to use a specific device
    # such as "dmix" and "dsnoop" so it doesn't lock an hw: device.
    
    # INPUT/RECORD
    load-module module-alsa-source device="default" tsched=1
    
    # OUTPUT/PLAYBACK
    load-module module-alsa-sink device="default" tsched=1 
    
    # Accept clients -- very important
    load-module module-native-protocol-unix

.nofail
.ifexists module-x11-publish.so
    # Publish to X11 so the clients know how to connect to Pulse. Will
    # clear itself on unload.
    load-module module-x11-publish
.endif

To be honest, I don’t know it this helps or makes things better…

Leave a comment

Filed under desktop, media, multilib, network, SlackBuilds, system