Monday, December 31, 2012

FBReader on Android

Finally, I used the FBReader on an Android tablet. It is far easier to read on it than I had expected. The 7inch screen is a very convenient alternate to the paperback.

I ended the year 2012 by reading two stories - perhaps symbolic for the last day of the year.

Kurt Vonnegut's 2BR02B and Kafka's Metamorphosis.

I had read Metamorphosis 40 years ago and its impact had been so strong and saddening that although I had downloaded the book months ago, I had been hesitating to read it again. Yesterday, I heard Kafka's A Hunger Artist and overcame my hesitation. Rereading it was an amazing experience even on a tablet.

Saturday, November 3, 2012

Renewing and speeding up my desktop

I had decided to buy a new desktop as the current one seemed too slow. It just did not seem useful to buy more cpu cores for primarily browsing the web.

I had been looking for solid state disk options for the last few months after reading about their prices crashing. Unfortunately, this was not reflected in the prices of these disks in my area. However, recently I found an online store offering a reasonably attractive price for a 60GB SSD. It was delivered to me the day I read Linus Torvalds"Get thee behind me, Satan" comment . A very nice coincidence.

Indeed, my desktop's performance now is terrific. I can save it from a landfill for another few years :)

Saturday, August 11, 2012

VBA Macros of Indian Income Tax forms failed on current LibreOffice

I had experimented with filing Indian tax returns using OpenOffice earlier. Last year, I had used LibreOffice and filed my return. The effort was minimal as I had not felt the need to document it.

This year, the result was painful. The simplest of forms failed with LibreOffice 3.5 and I could not even make any sense of the problems. I tried older versions (3.4) that I found on some of my partitions and those failed as well.

In desperation, as the deadline was approaching, I downloaded OpenOffice and, surprisingly, that worked on ITR1 (simplest return). However, editing the macros needed for the other forms was a pain. Running the macro from within the editor started the execution from the first line of the file and not from the selected macro. I found the behavior confusing in comparison to LibreOffice and preferred to give up :)

I realized that I had used version 3.3 last year and I had an old partition with an old version of ArchLinux - which had the 'right' version of LibreOffice. The process of filling the tax return forms was very tedious. I had to find the password for the sheets, unlock them and make some manual changes to the cell formulas. However, at the end of it, I did manage to submit the returns using the open source tools.

I had planned to experiment and see if I can find out what changed from LibreOffice 3.3 to 3.4 to cause this 'regression' but now I will wait till the 3.6 version is available through ArchLinux or Fedora.

Meanwhile, I plan to preserve the old ArchLinux partition for next year and, hopefully, thanks to this entry, I won't struggle too much.

Tuesday, June 26, 2012

Drupal 7 - Creation of Content Disappeared - Problems of Point and Click

I have been exploring Drupal 7,  particularly in trying to control access to creation of content followed by moderation by the appropriate editor. Even though I may be convinced that the level of control sought is unnecessary; but since it should be doable, might as well make it available.

I added the Workbench Access and Workbench Moderation modules. After I had suitably configured everything along with LDAP authentication, I found that the content just could not be created. I repeated the process, without LDAP, and still the same result.

I created a new content type and it worked the way it was intended. I just could not figure out what was going wrong with existing content types.

In a moment of "inspiration", I decided to examine the Navigation menu. As the Workbench user interface includes a tab for creation of content, I had excluded the "Add content" and subsidiary content creation entries from the Navigation menu. The new content type I created had the entry in the sub-menu enabled. Since the parent "Add content" was not in the menu, the child entries were not visible.

I enabled the existing content types in the Navigation menu and the content could indeed be created by the correct users.

Finally - after going around in circles for over a day! In retrospect, that wasn't too bad.

Friday, June 22, 2012

OpenLdap, Fedora 17 and Modifying Schema

Continuing my experiments with OpenLDAP, I needed to add mail attribute, which requires inetorgperson.schema. As I had not included it in the beginning, I wanted to modify  the schema. It should not be hard but I couldn't find a simple answer.

The discussion  "how-to-add-a-new-schema-to-openldap-2-4-11" gave a hint. Ldif files were needed and Fedora distribution includes them. So, I tried the the command
$ sudo ldapadd  -Y EXTERNAL -H ldapi:///  -f /etc/openldap/schema/inetorgperson.ldif

And it worked. However, since migration tools use the objectClass account which is inconsistent with inetOrgPerson, it turned out to be easier to recreate the ldap database.

Wednesday, June 6, 2012

OpenLDAP, Slapd, Fedora 17 and Authentication

Once the LDAP database is ready following the steps in the previous post, we can use authconfig-gtk to configure authentication via ldap. On Fedora, for using LDAP passwords either TLS/SSL or LDAPS is required.

The changes in Fedora 17 make getting started much easier. OpenLDAP creates a directory /etc/openldap/certs and creates an empty database of certificates (using /usr/libexec/openldap/create-certdb.sh)

During the installation, openldap-servers  runs /usr/libexec/openldap/generate-server-cert.sh which creates a dummy certificate for the local host and adds it to the certificates database in /etc/openldap/certs.

There is a small inconsistency, which should be resolved soon or it could have been caused by a file from earlier versions which is not replaced by the upgrade.

The files /etc/openldap/ldap.conf and /etc/sssd/sssd.conf use /etc/openldap/cacerts as the directory for the certificates. I needed to manually change that to /etc/openldap/certs.

When I was having problems with certificates, including ldaps in SLAPD_URLS in /etc/sysconfig/slapd and using the following command was helpful:
ldapsearch -ZZ -d 1 -x -LLL  -W -D cn=Manager,dc=example,dc=com -H ldaps:///
Update and caution: I find that slapd fails to start on reboot. It seems to timeout on some operation. However, it works fine upon:
$ sudo systemctl start slapd.service
Update: this was an issue of too small a timeout for my system in /usr/lib/systemd/system/slapd.service. Commenting the timeout solved the issue.
#TimeoutSec=3

Next: Modifying the schema.

OpenLDAP on Fedora 17 - Understanding Installation

As per the motivation in my previous post, I cleaned up slapd.d and various other files to start with a blank state on Fedora 17. Slapd would not start. It now needs slapd.d to exist.

Examining the installation script:
rpm -q --scripts openldap-servers
we notice that it creates fresh slapd.d at start as follows:
 /usr/libexec/openldap/convert-config.sh
                           -f /usr/share/openldap-servers/slapd.ldif
Obviously, the script is smart enough to upgrade the existing files and database in case slapd is already running.

We can customize slapd.conf as follows for our needs:
  1. Modify realm in olcAccess, olcSuffix and olcRootDN entries. 
  2. Add an entry for olcRootPW -  olcRootPW:"slappasswd output"
  3. Add needed schemas, e.g. cosine and nis as only core schema is included by default.
Create the starting slapd database and start the daemon:
$ sudo /usr/libexec/openldap/convert-config.sh -f slapd.ldif
$ sudo systemctl start slapd.service
 I created base.ldif, users.ldif and groups.ldif using the migrationtools and added them to the ldap database:
$ ldapadd -x -W  -D cn=Manager,dc=example,dc=com  -f base.ldif 
It should now be possible to use this server for authentication.

More in next post.