Jul 10 2015

Thunderbird links open in Chrome / Chromium in incognito mode

For quite some time, I have tried to get links in Thunderbird to open automatically in Chrome or Chromium instead of defaulting to Firefox. Moreover, I have Chromium start in incognito mode by default, and I would like those links to do the same. This has been a problem for me since I don’t use a full desktop environment like KDE, GNOME, or even XFCE. As I’m really a minimalist, I only have my window manager (which is Openbox), and the applications that I use on a regular basis.

One thing I found, though, is that by using PCManFM as my file manager, I do have a few other related applications and utilities that help me customise my workspace and workflows. One such application is libfm-pref-apps, which allows for setting preferred applications. I found that I could do just what I wanted to do without mucking around with manually setting MIME types, writing custom hooks for Thunderbird, or any of that other mess.

Here’s how it was done:

  1. Execute /usr/bin/libfm-pref-apps from your terminal emulator of choice
  2. Under “Web Browser,” select “Customise” from the drop-down menu
  3. Select the “Custom Command Line” tab
  4. In the “Command line to execute” box, type /usr/bin/chromium --incognito --start-maximized %U
  5. In the “Application name” box, type “Chromium incognito” (or however else you would like to identify the application)

Voilà! After restarting Thunderbird, my links opened just like I wanted them to. The only modification that you might need to make is the “Command line to execute” portion. If you use the binary of Chrome instead of building the open-source Chromium browser, you would need to change it to the appropriate executable (and the path may be different for you, depending on your system and distribution). Also, in the command line that I have above, here are some notes about the switches used:

  • –incognito starts Chromium in incognito mode by default (that one should be obvious)
  • –start-maximized makes the browser window open in the full size of your screen
  • %U allows Chromium to accept a URL or list of URLs, and thus, opens the link that you clicked in Thunderbird

Under the hood, it seems like libfm-pref-apps is adding some associations in the ~/.config/mimeapps.list file. The relevant lines that I found were:

[Added Associations]
x-scheme-handler/http=userapp-chromium --incognito --start-maximized-8KZNYX.desktop;
x-scheme-handler/https=userapp-chromium --incognito --start-maximized-8KZNYX.desktop;

Hope this information helps you get your links to open in your browser of choice (and with the command-line arguments that you want)!

Cheers,
Zach

Jun 19 2015

Amavisd – debugging and logging startup failures

Recently, I wrote an article about amavisd not running with Postfix, and getting a “Connection refused to 127.0.0.1″ error message that wasn’t easy to diagnose. Yesterday, I ran into another problem with amavisd refusing to start properly, and I wasn’t readily able to figure out why. By default, amavisd logs to your mail log, which for me is located at /var/log/mail.log, but could be different for you based on your syslogger preferences. The thing is, though, that it will not log start-up errors there. So basically, one is seemingly left in the dark if you start amavisd and then realise it isn’t running immediately thereafter.

I decided to take a look at the init script for amavisd, and saw that there were some non-standard functions in it:


# grep 'extra_commands' /etc/init.d/amavisd
extra_commands="debug debug_sa"

These extra commands map to the following functions:


debug() {
ebegin "Starting ${progname} in debug mode"
"${prog}" debug
eend $?
}

debug_sa() {
ebegin "Starting ${progname} in debug-sa mode"
"${prog}" debug-sa
eend $?
}

Though these extra commands may be Gentoo-specific, they are pretty easy to implement on other distributions by directly calling the binary itself. For instance, if you wanted the debug function, it would be the location of the binary with ‘debug’ appended to it. On my system, that would be:


/usr/sbin/amavisd -c $LOCATION_OF_CONFIG_FILE debug

replacing the $LOCATION_OF_CONFIG_FILE with your actual config file location.

When I started amavisd in debug mode, the start-up problem that it was having became readily apparent:


# /etc/init.d/amavisd debug
* Starting amavisd-new in debug mode ...
Jun 18 12:48:21.948 /usr/sbin/amavisd[4327]: logging initialized, log level 5, syslog: amavis.mail
Jun 18 12:48:21.948 /usr/sbin/amavisd[4327]: starting. /usr/sbin/amavisd at amavisd-new-2.10.1 (20141025), Unicode aware, LANG="en_GB.UTF-8"

Jun 18 12:48:22.200 /usr/sbin/amavisd[4327]: Net::Server: 2015/06/18-12:48:22 Amavis (type Net::Server::PreForkSimple) starting! pid(4327)
Jun 18 12:48:22.200 /usr/sbin/amavisd[4327]: (!)Net::Server: 2015/06/18-12:48:22 Unresolveable host [::1]:10024 - could not load IO::Socket::INET6: Can't locate Socket6.pm in @INC (you may need to install the Socket6 module) (@INC contains: lib /etc/perl /usr/local/lib64/perl5/5.20.2/x86_64-linux /usr/local/lib64/perl5/5.20.2 /usr/lib64/perl5/vendor_perl/5.20.2/x86_64-linux /usr/lib64/perl5/vendor_perl/5.20.2 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl/5.20.1/x86_64-linux /usr/lib64/perl5/vendor_perl/5.20.1 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.20.2/x86_64-linux /usr/lib64/perl5/5.20.2) at /usr/lib64/perl5/vendor_perl/5.20.1/Net/Server/Proto.pm line 122.\n\n at line 82 in file /usr/lib64/perl5/vendor_perl/5.20.1/Net/Server/Proto.pm
Jun 18 12:48:22.200 /usr/sbin/amavisd[4327]: Net::Server: 2015/06/18-12:48:22 Server closing!

In that code block, the actual error (in bold text) indicates that it couldn’t find the Perl module IO:Socket::INET6. This problem was easily fixed in Gentoo with emerge -av dev-perl/IO-Socket-INET6, but could be rectified by installing the module from your distribution’s repositories, or by using CPAN. In my case, it was caused by my recent compilation and installation of a new kernel that, this time, included IPV6 support.

The point of my post, however, wasn’t about my particular problem with amavisd starting, but rather how one can debug start-up problems with the daemon. Hopefully, if you run into woes with amavisd logging, these debug options will help you track down the problem.

Cheers,
Zach

Jun 10 2015

The Parker Fund

Hello all,

I don’t usually post very personal things here on The Z-Issue, but rather use it for 1) posting information that may be of interest to others (e.g. solving technical problems [especially with regard to the world of Linux Engineering]), 2) mentioning articles that I found helpful, amusing, or otherwise interesting, or 3) just babbling about who knows what. This article, though, is about something that is very special to me, and one that is intimately and inextricably tied to who I am as a person.

For those of you who have read the about me page, you know that I have devoted the majority of my academic life to studies of Child and Adolescent Development / Psychology and Education. Understanding and helping children work through their difficult times is one of my biggest passions in this life.

Over the past decade or so, I’ve given a lot of thought to having children of my own and have decided that I would rather adopt than have kids who are biologically mine. My rationale is multifaceted, but primarily, I just think that there are enough children already here that could use loving homes, and I would like to offer that to one of them instead of bringing another one into the world. So, for several years now, I’ve been trying to put any little bit of extra money that I have into savings for adopting a child. In the past year, I have started to pursue adoption more actively from a lot of angles (discussing it with attorneys, researching adoption agencies and policies, et cetera). I have also tried to squirrel away even more money by doing side jobs and such. Though I’ve been relatively successful at saving money for the adoption, I have a very long way to go based on the estimate that I have been given (approximately $85,000 USD). At the time of this writing, I have saved a mere ~17% of the funds that I will need in order to get started on the process.

Why bring up any of these things about my personal life and goals? Simply put, the idea of crowdfunding is enticing in this situation. I post my articles hoping that they will help people who find themselves in similar situations (as mentioned, particularly relating to Linux, but also to travels, and so on) as the ones in which I have found myself over the years. And, thankfully, according to the analytics for the site and comments on various posts, people are finding the articles helpful. In particular, a couple of my Linux articles have been viewed tens of thousands of times on certain days. I’ll cut to the chase: if any of my articles have been helpful to you, please consider donating ANY amount that you comfortably can to The Parker Fund–helping me reach my goal of being able to adopt. Absolutely every dollar helps, so any donation will be greatly appreciated!

Why “The Parker Fund?” As I’ve said, I have more actively started to pursue the adoption within the past year or so. I’ve pondered many different aspects of the process, and have decided that I would like to adopt a boy first. I have also chosen the name Parker, and so to keep the goal alive and real in my mind, I refer to him by name, though he may not have even been born yet. Again, to keep my motivation up through setback after setback, I have started to decorate a room for him:


Parker's room
Click to enlarge

These types of little things help keep me focused on my goal, even if they seem a little premature.

So, in effort to expedite the start of the adoption process, if you can spare any funds and would like to help me, you may contribute to The Parker Fund by using the PayPal “Donate” button in the top widget on the right-hand side of the page. As I said, every dollar helps and will be greatly appreciated! Even if you can’t or don’t want to contribute, thank you for reading the Z-Issue and taking time out of your day to read about a personal aspiration that is very near and dear to my heart.

Cheers,
Zach

Older posts «