Meta

Category Archives: Linux

If you are looking for a secure cloud storage service that is hosted in Germany, encrypts your data before it is uploaded into the cloud and has a client that runs on Windows, Mac, Linux and Android, then Hornetdrive is a possible choice. The business account allows for collaboration in a team without charging you for each user, which I find to be the one feature that truly sets it apart from most other offers. In summary, I looked around at the time and found them to be the best choice in terms of features provided and price. I have no affiliation with the company.

Now, the client software is supplied by the company for Windows, Mac and Linux. The linux version comes in two flavours, a .run-file for “RHEL 6 (or derivatives e.g. CentOS 6, Oracle Linux 6) and above, latest versions of Fedora & SUSE Linux” and a .deb-file for “Debian Linux, Ubuntu Linux (latest versions and current Ubuntu LTS release)“.

This post briefly describes how to get a package for arch linux that can then be installed like any other package using the pacman packet manager. The route taken is to use the debtap script/programme to automatically convert the .deb package into an arch package without having to do any work. Well, almost none. I have chosen this path because I have no knowledge of package maintenance myself, and while interested in general, I simply can’t find the time to learn more about it at the moment. So, thank you to the people who created the amazingly useful debtap package.

After you have installed the debtap programme, change into the folder that contains the Hornetdrive.deb package and call on it using debtap as follows (no super-user rights required):debtap ./Hornetdrive.deb

The programme will ask you for a name for the package. I put “hornetdrive”.

Next it will ask you for the license for the package. At this stage I am unsure what to refer to. The .deb package includes information on “section” and calls it “non-free/net”, so that is what I entered.

The final step asks whether you would like to edit the created .PKGINFO file. Here you have to say yes i.e. choose an editor. This is necessary because arch linux recently unsplit the libdbus package into the core/dbus package, and so we have to make a small change to the dependencies of the automatically generated .PKGINFO file.

I am running arch-linux with KDE and the plasma desktop. I downloaded the minitube application to stream youtube videos outside of the browser. When I started the application it would not work as expected and reported back:

Error downloading https://www.****** server reply:forbidden.

A search online told me that I need a youtube API key to get it to access youtube and work. This can either be set at compile time or in an environmental variable. When installed as a pre-compiled application using the package manager, it sets a file at /etc/profile.d/minitube.sh where the variable may be set.

The api-key may be obtained here as shown at the beginning of this youtube video or described here. Make sure to enable the API key (you may have to create a project to get to this stage) and then create a browser-key, not a server key! Note this key and set it in the minitube.sh file.

Unlike mentioned in some posts, the preset variable name is correct and should be kept at GOOGLE_API_KEY and not changed to APP_GOOGLE_API_KEY. Now you can set the environmental variable by sourcing the file with source /etc/profile.d/minitube.sh or by logging out and back in.

Now, I moved the minitube.sh file from the system wide profile in /etc/profile.d/ into the user profile space at ~/.profile/minitube.sh and that may be the reason for the following problem. In any case, the application only found the GOOGLE_API_KEY variable when started from the terminal. The KDE/Plasma session didn’t have the variable set. I thus set a symbolic link ~/.kde4/env/minitube.sh -> ~/.profile/minitube.sh which solved that problem. Now it works when called as any other application form the desktop.

Note: this is a partial post. I may fill in more information at a later time. However, the solution is stated at the bottom and may be helpful already.

The Problem history

A few days ago I set up a rsnapshot backup solution and when i ran it for the first time, my linux software raid-1 (2x 3TB – 6GB/s SATA) fell over. It wasn’t tragic, since after a reboot it simply re-synced. However, this happened reliably every time I did a backup and then the re-syncs started to fail as well.

Turns out my motherboard (Asus P7H57D-V EVO) is using a Marvell 88SE6111 chip for the two SATA 6GB/s SATA connectors it provides and which I am using for the two disks in question. All my other disks are attached to an intel chip that only offers SATA 3GB/s connections. This Marvell chip seems to have poor support under linux. However, the controller is set in the BIOS to work via AHCI and the disks do work under normal conditions without a problem.

The current kernel is stated below:

Linux 3.10.7-1-ARCH x86_64 GNU/Linux

I checked the disks (both are new) using smarctctl and found no issues. When the raid was synced, everything worked fine and the smartctl command showed good new disks. Once the backup had toppled the raid or the re-sync failed, smartctl failed with the following errors shown in dmesg:

[ 7483.951154] program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO
[ 7483.951179] program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO

Checking dmesg for a hint on why the disks/raid failed, I found the following errors (the relevant hard drives are /dev/sdf and /dev/sde. (… marks sections where I cut repetitions):

The way I read this was as follows. The physical symptoms are that the raid stops to respond for about 30 seconds, and then works again. These freeze problems then lead to a timeout on the rsync backup or the re-sync action. The cause for the freeze may ultimately be the Marvell controller (since my software raid-5 with 3 disks on the Intel chip has no such problems), but it may well be due to an overload during backup / sync_action.

My solution to the problem

Since I could not find a better driver for the Marvell chip, and since hours of research on the web did not yield a better solution, I decided to prevent the cause instead of curing it. It seems that the software raid only falls over when it is under immense load, such as during a re-sync or when the rsnapshot tool is continuously spitting data at the raid. By setting bandwidth limits for the mdadm sync_action and the rsync tool underlying the rsnapshot software, I was able to prevent the problem from occurring again.

Setting a bandwidth limit on the mdadm re-sync action as described here:

sysctl -w dev.raid.speed_limit_max=value

I chose the value of 124000, which is slightly lower than the speed stated by mdstat during successful syncing i.e. before the re-sync action overloaded the raid. To get that value, type the following while the raid is happily re-syncing:

$ cat /proc/mdstat

Check the current limits for the resync action:

# sysctl dev.raid.speed_limit_min
# sysctl dev.raid.speed_limit_max

To permanently override the default, I added this line to /etc/sysctl.conf:

To prevent rsnapshot from overloading the raid during a backup, I set the bwlimit parameter in the rsnapshot config file at /etc/rsnapshot.conf. As you can see, I also set a 3min timout to give the raid some time to unfreeze, should that happen again:

This post explains the installation of the email indexing programme notmuch and its integration with the mutt email programme under openSuSE 11.4.

I have recently changed the way I use email. Previously, I had my email auto-sorted into folders, which meant that I had unread emails scattered over several folders and often neglected to read emails in categories that I felt were not immediately important.
In order to change that, I emptied my INBOX, which contained hundreds of unsorted messages, and moved them all into folders. It is now my resolution to work through my email once it comes in, and then move it into an appropriate folder. This way I should keep a nice and empty INBOX and I know that anything which is still in there, has yet to be addressed.

However, mutt does not allow you to search in more than one mailbox at a time. Now, if I need to look up a certain email, I would have to run the same search in all my folders. This is unacceptable. To address the issue, I looked into indexers that work with mutt. After reading zack’s post from 2009 on mairix, maildir-utils and nmzmail, and his newer post on notmuch, I decided to go with notmuch.

Notmuch is not currently in any of the openSuSE repositories, so you will have to grab it from the web. I simply google searched for “notmuch rpm” and found the latest version (notmuch-0.5-4.fc15.i686.rpm) on http://rpm.pbone.net

The following dependencies have to be satisfied:

libgmime-2.6

libtalloc (version > 2.0.2)

libgmime

This requirement may be fulfilled by installing the gmime-2.5.1-4.fc15.i686.rpm (this is a fedore package from http://rpm.pbone.net)

libtalloc

libtalloc may be found in the openSuSE online package search. I used the
libtalloc-2.0.5-8.fc15.i686.rpm package from http://rpm.pbone.net. Make sure that the installed version of libtalloc is 2.0.2 or higher.

other

The following packages aren’t required at the time of the installation, but if you later get an error when you first try to use notmuch from mutt, then it may be because you are missing the following packages:

perl

perl-MailTools

perl-Email-Sender

perl-Mail-Box

You will also need libxapian and sqlite3, but those dependencies may be resolved automatically when you install notmuch.

setup and indexing

Now that notmuch has been successfully installed, you need to run the configuration and then the indexing. In order to run the setup, open a terminal and enter “notmuch setup”, then press enter. This will take you through a short setup procedure which should be self-explanatory.

Once the setup is complete, it asks you to start the indexing by executing “notmuch new” in the terminal. Depending on how much mail you have, this may take some time. Future indexing is done incremental and will only take a very short time.

notmuch integration with mutt

As explained in Zack’s post, you should download the mutt-notmuch script and save it to a location of your choice. Then make it executable by the user (chmod u+x ./mutt-notmuch). Now you only need to include a macro in your mutt configuration file. The instructions are here.

notmuch integration with offlineimap

You could use a cron job to repeatedly run the “notmuch new” command, but I personally prefer to use the posthook command in the offlineimap configuration file. This way, every time I gab new mail, the indexer runs automatically. Since I grab mail from several imap servers, I set the number of simultaneous connections to 1 in the offlineimaprc config file (maxconnections = 1), this way offlineimap works through the accounts one after the next and I simply set the postsynchook in the last account i.e.

[Account last-account]
postsynchook = notmuch new

Alternatively you could write a short bash script, first calling offlineimap and then notmuch new

Now, if all went well, you should be able to call a search from within mutt simply by pressing the F8 key. It works wonderfully for me.

I bought I new PC system, based on a motherboard with the H57 chipset and the intel core i3 530 CPU. After a faultless installation of openSUSE 11.2, I had some initial problems getting the integrated Intel HD graphics to work. A kernel update to linux kernel-2.6.34-35 using the latest openSUSE 11.3 Milestone7 DVD, solved the problem for me. Read on for a few more details.

The System

The components for my new PC arrived last week and I finally got a chance to put it all together last night. The system components were chosen with low-energy consumption and silent operation in mind. The specs are as follows:

ASUS P7H57D-V EVO motherboard

Intel Core i3 530 2.93GHz Socket 1156

Zalman CNPS10x Flex CPU cooler (intended to operating without fans)

2x Crucial 1GB DDR3

OCZ 400W Stealth XStream PSU (140mm Fan for silent operation)

Seagate Barracuda LP ST3500412AS 500GB HD SATA2 5900 rpm 16MB Cache

Evidently, I did not really see the low-energy idea through to the end. If I had, I would have traded the ATX motherboard for one of the mini-ITX LG1156 motherboards from ZOTAC.

Installing openSUSE 11.2

The installation from an openSUSE 11.2 DVD completed without problems. It was only on the first boot-up, that the problem with the integrated Intel HD Graphics became apparent. The system attempted to start the X server, but just flashed the screen a few times and then reverted to a console login.

The solution

openSUSE 11.2 (kernel-2.6.34-25) on intel core i3

Reading some more information on the internet revealed that the problem could most likely be solved by a kernel upgrade and/or that of the xf86-video-intel graphics driver. The trouble is, that the most current kernel for openSUSE 11.2 is still the kernel-2.6.31 release.

So in short, the solution was to download last nights build of the very latest and greatest openSUSE 11.3 Milestone7 DVD using wget from the console. I then started YAST in the graphical console mode and added the openSUSE 11.3-Milestone7-DVD iso-file as a repository. After this, the new kernel-2.6.34.35 shows up in the normal YAST Software Management tool, and can be installed like any other package. A reboot of the system presented me with the lovely green login-screen of an openSUSE 11.2 installation. The graphics now work, wobbly windows, animations, cube-switcher and all. The current kernel is 2.6.34-35-default.

Notice, that I haven’t yet upgraded the xf86-video-intel driver. I am going to do that next , just for fun.

Ok, so this wasn’t too hard, but there was a little hiccup and so I thought I’d briefly note down the solution.

The first step is to find the actual driver because the iP4500 model not listed in the standard set of drivers (at least not in mine). Choosing one of the other PIXMA drivers (like the 4100) will only result in blanc pages.

1) Find the drivers on the Canon website (google search for it. I would post the link but the page is currently not working for me, it did so a minute ago though).
There are two files, one is a common driver (file name: cnijfilter-common-2.80-1.i386.rpm) and the other one is the model specific driver (file name: cnijfilter-ip4500series-2.80-1.i386.rpm). They need to be installed in order, so I suggest you also download the instructions, a file called: guideip4500series-pd-2.80-1.tar.tar
The instructions are very clear and come in flavours for Fedora 7, openSUSE 10.3 and Ubuntu 7.04 (all the same file).

2) After the installation I tried to print but without success. Looking at the printer properties (Control Center – Printer – <printer name> (right click) -> Properties) I found the error message:

/usr/lib64/cups/backend/cnij_usb failed

I did a google search, and the solution is the following (as found on Linuxuser LigLog).

GtkWidgets are derived from GObjects. They can be cast back and forth using the G_OBJECT() and GTK_WIDGET() macros. Use g_object_set_data() to attach a gpointer and its key to a GObject of your choice (find the definition at library.gnome.org). The pointers can then be retrieved wherever the GObject that they have been attached to, is available. This is done using g_object_get_data(). Attaching two pointers to two different GtkWidgets to the main window widget, will enable you to call on them from any callback function you use.

I hope the code below may be useful to some people. I am new to GTK+ myself so I am not sure whether this is the best solution, but it is certainly on of the better ones. Other solutions would be to use globals or possibly structs.

What the function does:
It is a simple callback function that has been connected to the GladeXML file by the following line:glade_xml_signal_connect(gxml, "on_execute_recording_button_clicked", G_CALLBACK(on_execute_recording_button_clicked));
where gxml is the main GladeXML file that was created using Glade-3. Look on Micah Carrick’s blog for information and tutorials on Glade.

Using glade_get_widget_tree() we can get hold of the GladeXML file inside the callback function without using globals. From there is it easy, we simply use the glade_xml_get_widget() function to create the widgets we want.

The problem:
I am using an interface from National Instruments for the General Purpose Instrumentation Bus (GPIB) and when I tried to execute the program in the terminal, I only got an “Aborted” message back. The program had been working before and still compiled without errors or warnings but it would not execute. The program terminated imediatey after it was called, before even entering main().

The solution:

The problem lies with the ni-488.2 driver and may be solved by upating the driver. Every kernel update will result in the “Aborted” error reappearing. Every kernel update thus requires an update of the driver if you want to use the ni488 interface in your software.

The steps to take are similar to the initial installation. The following steps are quoted directly from the NI 488.2 README file:

1. Ensure you have installed kernel-source and kernel-syms packages
corresponding to the version of the currently running kernel. You can
determine the currently running kernel version by issuing the commanduname -r.
2. Change the directory to the /usr/src/linux-<version>directory, where
<version> corresponds to the currently running kernel version.
3. Run make cloneconfig as root to configure the sources for the
currently running kernel.
4. Run make modules_prepare as root to prepare the headers for
compilation.

Now go to /usr/local/bin and run the “updateNIDrivers” utility as root. That should update your NI driver and remove the problem.

Today, while reading up on possible suppliers of HV-supplies, my Adobe Reader complained that it could not read part of a document without the Japanese language extension pack. Very conveniently the pop-up warning message contains the address of the adobe website where one can download the language extension for free (make sure you get the correct file for your version of acrobat reader):
http://www.adobe.com/products/acrobat/acrrasianfontpack.html

Its a simple matter of unpacking the tar.gz file, entering the created folder (“JPNKIT” in my case) in a terminal window, switching to root and typing: ./INSTALL
However, as part of the installation procedure, the install script asks for the correct location of your Adobe Reader installation. Now maybe it’s because I am not a linux Pro, but I did not know which directory the script was asking for. It was not the /usr/bin/acroread path. After a very unlucky search on google for the correct path, I finally figured it out. The path to use was the following:/usr/lib
The installer finished and I can go on with my work. Maybe someone out there will find this post helpful.