Saturday, October 8, 2016

Installing Lotus Notes 9.0 on Ubuntu 16.04


Some information about this already available here. Here is the account of how I got it working on Ubuntu 16.04 64bit LTS system:

Step 1:

Please download the following two Lotus Notes packages from the following links

1. ibm-notes-9.0.i586.deb
2. ibm-sametime-9.0.i586.deb

Step 2:

You might need to add some repository to install 32-bit libraries.  So add the following repository into your "software sources"

deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse

Now do the following: 

$ sudo dpkg --add-architecture i386
$ sudo apt-get update


Step 3:

Now install the following packages:

$ sudo apt-get install libart-2.0-2:i386 libasound2:i386 libatk1.0-0:i386 libavahi-client3:i386 libavahi-common3:i386 libavahi-glib1:i386 libbonobo2-0:i386 libbonoboui2-0:i386 libc6:i386 libcairo2:i386 libcanberra0:i386 libcomerr2:i386 libcups2:i386 libdbus-1-3:i386 libdbus-glib-1-2:i386 libexpat1:i386 libffi6:i386 libfontconfig1:i386 libfreetype6:i386 libgail18:i386 libgcc1:i386 libgconf-2-4:i386 libgdk-pixbuf2.0-0:i386 libglib2.0-0:i386 libgnome2-0:i386 libgnomecanvas2-0:i386 libgnome-keyring0:i386 libgnomeui-0:i386 libgnomevfs2-0:i386 libgpg-error0:i386 libgssapi-krb5-2:i386 libgtk2.0-0:i386 libhunspell-1.3-0:i386 libice6:i386 libjpeg62:i386 libk5crypto3:i386 libkeyutils1:i386 libkrb5-3:i386 libkrb5support0:i386 libltdl7:i386 libnspr4:i386 libnspr4-0d:i386 libnss3:i386 libnss3-1d:i386 libogg0:i386 liborbit2:i386 libp11-kit0:i386 libpam0g:i386 libpango1.0-0:i386 libpcre3:i386 libpixman-1-0:i386 libpng12-0:i386 libpopt0:i386 libselinux1:i386 libsm6:i386 libstdc++6:i386 libtasn1-6:i386 libtdb1:i386 libuuid1:i386 libvorbis0a:i386 libvorbisfile3:i386 libx11-6:i386 libxau6:i386 libxcb1:i386 libxcb-render0:i386 libxcb-shm0:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxft2:i386 libxi6:i386 libxinerama1:i386 libxml2:i386 libxrandr2:i386 libxrender1:i386 libxss1:i386 libxt6:i386 libxtst6:i386 zlib1g:i386 unity-gtk2-module:i386 libcanberra-gtk-module:i386 libxss1:i386 gtk2-engines-murrine:i386 p11-kit-modules:i386 libp11-kit-gnome-keyring:i386 ttf-xfree86-nonfree gdb iproute2 libgconf2-4:i386 libxkbfile1:i386 lib32ncurses5 lib32z1 libidl-2-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libasound2-plugins:i386 libgail-common:i386 overlay-scrollbar-gtk2 libgnome-desktop-3-12:i386 libatk-adaptor:i386 libgcrypt20:i386 libgnutls30:i386


You also need to install following packages: 

$ sudo apt-get update; sudo apt-get install libgnomeprint2.2-0:i386 libgnomeprintui2.2-0:i386 libbonobo2-0:i386 libbonoboui2-0:i386 libgconf2-4:i386 libgnome-desktop-2-17:i386 libgnomevfs2-bin:i386 libgnomeui-0:i386 libjpeg62:i386 libpam0g:i386 libxkbfile1:i386 ttf-xfree86-nonfree t1-xfree86-nonfree -y 


Step 4:  Install the notes packages

$ sudo dpkg -i ibm-notes-9.0.i586.deb
$ sudo dpkg -i ibm-sametime-9.0.i586.deb


That's all.  It worked for me. 


Edit: Thanks to Sunil for his comments.


Saturday, July 9, 2016

Fingerprint Sensor on Lenovo X240 Thinkpad on Ubuntu 14.04

OS: Ubuntu 14.04 64 bit LTS

The machine has a fingerprint reader from validity sensor:

$ lsusb
Bus 001 Device 011: ID 138a:0017 Validity Sensors, Inc. Fingerprint Reader


Option 1:

sudo add-apt-repository ppa:fingerprint/fingerprint-gui
sudo apt-get update
fingerprint-gui is little unstable and matching does not work all the time. 


Option 2: 

sudo add-apt-repository -y ppa:fingerprint/fprint
sudo apt-get update
sudo apt-get install libfprint0 fprint-demo libpam-fprintd gksu-polkit

You can test the sensor using fprint_demo and enroll your fingerprint using fprintd-enroll. 

Now you lock your screen using CTRL+ALT+L and try swiping your finger on the sensor when it glows green. 

Still you need to make couple of attempts to get a right scan and logging in one attempt. It takes several attempts to log in. 

You can also store multiple templates for the same finger using the labels for other fingers.

$ fprintd-enroll -f right-thumb
$ fprintd-enroll -f right-index-finger
$ fprintd-enroll -f right-middle-finger
$ fprintd-enroll -f right-ring-finger
$ fprintd-enroll -f right-little-finger

Another 5 templates can be stored for left hand labels.  Then try fprintd-verify

$ fprintd-verify
Using device /net/reactivated/Fprint/Device/0
Listing enrolled fingers:
 - #0: left-middle-finger
 - #1: right-ring-finger
 - #2: left-thumb
 - #3: right-little-finger
 - #4: right-thumb
 - #5: left-index-finger
 - #6: right-index-finger
 - #7: right-middle-finger
 - #8: left-little-finger
 - #9: left-ring-finger
Verify result: verify-match (done)

If you store the templates for index finger under all these labels, then the chances of match increases when you swipe your finger.

Update: 

In order to make it work with login manager, you need to configure the PAM as well.  Hence, you need to install libpam-fprintd package. This is as per the instructions available on this page.

$ sudo apt-get install libpam-fprintd


Now check the common-auth file. It should show something similar as shown below:

$ grep fprint /etc/pam.d/common-auth
auth [success=3 default=ignore] pam_fprintd.so timeout=10 # debug max_tries=5


Now run

$ fprintd-enroll

once you register your finger print. Just check this works for you

$ sudo apt-get update
Swipe your finger across the fingerprint reader

Or else, when you lock your screen with CTRL+ALT+L, it should ask you to swipe your finger. It works instantly with one swipe itself. 

Tuesday, December 30, 2014

Lenovo Thinkpad X240 Wifi Support for RealTek RTL8192EE on Ubuntu / Mint 17



Lenovo Thinkpad X240 comes with RealTek RTL8192EE chipset. Surprisingly the driver does not come built into Ubuntu 14.04 and earlier versions.  However this device is supported on Ubuntu 14.10 (Utopic Unicorn)

If you are using earlier version of Ubuntu or Linux Mint 17, the following instructions may help you


The bug is reported on Launchpad and some workarounds have been suggested:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1239578


One solution (see #38) is to download the OEM driver from the following link:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1239578/+attachment/4057550/+files/rtl_92ce_92se_92de_8723ae_88ee_8723be_92ee_linux_mac80211_0017.1016v2.2013.tar.gz

You can also download it from here:

http://netbook-remix.archive.canonical.com/updates/pool/public/o/oem-wireless-rtl-92ce-92se-92de-8723ae-88ee-8723be-92ee-dkms/

or from here (local link)

https://drive.google.com/file/d/0B1WmoEhM2mFOeEo5X2RCdm9RZVU/view?usp=sharing

unzip it .... compile it ... and insert it ... "make" should work  ...

Insert the module by using the following command:

$ sudo modprobe rtl8192ee
$ lsmod | grep rtl8192

Probably you need to reboot. Just try some of the following commands to configure your wifi:

$ sudo iwconfig
$ sudo lshw -C Network
$ sudo iwlist wlan0 scan
$ nm-tool

One problem that people have reported about this driver is that it drops connection every now and then. You need to reboot just to get it working again. This is really annoying. A workaround that works for me is to run the following command:

$ sudo killall NetworkManager

this kills and then restarts the network manager and it connects to the wifi again.



Monday, October 27, 2014

Installing ROS Indigo on Mint 17

Mint 17 is based on Ubuntu trusty and hence you can follow the instruction given below to install ROS-Indigo:

http://answers.ros.org/question/190177/how-to-install-ros-indigo-in-ubuntu-1404-trusty-64-bit/

However, you need to make slight change in the name of repository to be added to your sources.list. The summary of instruction is as follows:


$ sudo sh -c '. /etc/lsb-release && echo "deb http://mirror.umd.edu/packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list' 

$ wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add - 

$ sudo apt-get update 
$ sudo apt-get install ros-indigo-desktop-full

Basically replace $DISTRIB_CODENAME by 'trusty'. It is because the $DISTRIB_CODENAME for mint 17 is 'qiana' for which its 404 error. 




Sunday, October 26, 2014

APT-GET behind Proxy Server, BADSIG GPG Error or Mergelist problem


All these problems are related with your proxy settings.  I could not solve them either.  In this post, I am trying to collect all the solutions that have been suggested by others:

Common Error:

W: GPG error: http://archive.ubuntu.com trusty Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key

The usual solution that works for me sometimes is as follows:

$ sudo rm -rf /var/lib/apt/lists/*
$ sudo apt-get update or
$ sudo apt-get update -o Acquire::BrokenProxy=True

You can ignore warnings and gpg errors. However, attempting to obtain the key does not work for me.


$ sudo apt-key adv --keyserver-options http-proxy=http://login:password@proxy.server.com:8080/ --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.eXfoRdf3Dx --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver-options http-proxy=http://xxxxx:yyyyy@proxy.server.com:8080/ --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
gpg: requesting key 437D05B5 from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

Many have suggested to use the following command. This does not help either.

$ sudo apt-get update -o Acquire::BrokenProxy=True -o Acquire::http::No-Cache=True


Note that these problems do not arise if you are directly connected to the internet.

Tuesday, April 22, 2014

Installing Lotus Notes 9 on Ubuntu 14.04 64-bit LTS




The basics steps of installation are provided here. Basically, it is necessary to have i386 compatible libraries in order to install Lotus notes 9 on a 64-bit machine.

On Ubuntu 14.04 64-bit LTS, ia32-libs is not available. The support has been removed since 13.10. I used the instructions provided here to install ia32-libs. The steps are re-produced here for the sake of the convenience:

  1. Install Synaptic from terminal window
  2. sudo apt-get install synaptic
  3. Launch synaptic and goto “settings > Repositories”
  4. click “other software > add”
  5. insert this line in the box "deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse"
  6. click ok and close synaptic
  7. in terminal “sudo apt-get update”
  8. in terminal “sudo apt-get install ia32-libs”

After that install the remaining i386 libraries

$ sudo apt-get update; sudo apt-get install ia32-libs libgnomeprint2.2-0:i386 libgnomeprintui2.2-0:i386 libbonobo2-0:i386 libbonoboui2-0:i386 libgconf2-4:i386 libgnome-desktop-2-17:i386 libgnomevfs2-bin:i386 libgnomeui-0:i386 libjpeg62:i386 libpam0g:i386 libxkbfile1:i386 ttf-xfree86-nonfree t1-xfree86-nonfree -y


While re-building the ibm-notes-9.0.i586 package, remove "libcupsys2" from its dependency list in the control file apart from those mentioned  previously on the above link. In other words, remove the following packages from the "Pre-Depends" line:

gdb, coreutils, unzip, bash, procps, grep, sed, libcupsys2

and rebuild the ibm-notes-9.0-i586.deb package.

$ sudo dpkg-deb -b ibm-notes-9.0.i586/


Now install the debian packages as shown below:

sudo dpkg -i ibm-notes-9.0.i586.deb
sudo dpkg -i ibm-cae-9.0.i586.deb
sudo dpkg -i ibm-feedreader-9.0.i586.deb
 
sudo dpkg -i ibm-activities-9.0.i586.deb
sudo dpkg -i ibm-sametime-9.0.i586.deb
sudo dpkg -i ibm-opensocial-9.0.i586.deb


I get dependency error while installing  'sametime' package. It is related to "iproute".

So I remove it from the control file within ibm-sametime-9.0.i586/DEBIAN and rebuild the package.

Now Lotus notes works perfectly without any problem.

Monday, March 17, 2014

Strikethrough in LibreOffice


Tools > Customize > Toolbars ==> Formatting; and then – Add (button) – Add Commands – Category: Format – Command: Strikethrough

Tuesday, January 21, 2014

Java JRE Webex Firefox Ubuntu 64 bit



I will talk about how to get your Java plugin working on Firefox on Ubuntu. It is also about getting your webex working on Firefox.

First you install oracle-java7-installer using apt-get. You can search on Google for this. Anyway, I am putting it here for your convenience.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
 
You can check Java version using the following command:
 
$ java -version 
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode) 
 

You can also check if the Java version is working or not from this site. This is the latest Java version available at this point of time for java which I installed recently. From time to time, the new versions come up and your Java applications stop working for one reason to another. In the paragraph below, I will now discuss about installing a new version Java plugin for Firefox

Download the latest version of JRE from this site. Download the Linux64 version of the package. The downloaded package has a name like "jre-7u51-linux-x64.tar.gz". Now create a folder /usr/java/ and copy this file into it. Extract the tarball inside this folder. You will have something like this:

$ cd /usr/java/
$ sudo tar -xzvf  jre-7u51-linux-x64.tar.gz
$ ls 
jre1.7.0_51

You can remove the tar-ball if you want. Now we need to create a link to a specific library "libnpjp2.so" present in this folder to a place where Firefox can find it.

$ cd /usr/lib/mozilla/plugins
$ ln -s /usr/java/jre1.7.0_51/lib/amd64/libnpjp2.so libnpjp2.so

You can rename the already existing link so that you can restore it in case the new version creates problem for you.  Now you can restart your firefox and test if your java application is working.


This new version of Java (version 1.7.0_51) leads to security permission error for many sites. So, you need to add exceptions to these sites. It can be done by accessing the Java Control Panel. Press ALT+F2 and type "ControlPanel" to access Oracle java 7 Plugin Control Panel. Go to the Security tab and Click on " Edit Site List" under "Exception Site List" section. Here you add the site which is giving error regarding security permissions.  Add the sites and click OK and close the panel.

Now try opening the website having the application (for instance Webex). It should work without any problem this time. 


For running java plugin on Firefox, you do not need to install Oracle-Java-installer or JDK installer. You only need the java run-time (jre) package that you can download from the official Java homepage.  You can run the ControlPanel directly from command line: 

$ /usr/java/jre1.7.0_51/bin/ControlPanel



Sometimes it is necessary to set the default java version to the downloaded JRE package in case you have multiple Java versions installed on your system. For instance,   I get following output for java version: 

$ java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu1)

OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)


Then I download jre-8u25-linux-x64.tar.gz package from Oracle website and extract it inside a folder "/usr/java/".


$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/java/jre1.8.0_25/bin/java" 1

$ sudo update-alternatives --set java /usr/java/jre1.8.0_25/bin/java

$ sudo update-alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      auto mode
* 1            /usr/java/jre1.8.0_25/bin/java                   1         manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode

Press enter to keep the current choice[*], or type selection number: 

Now check the default java version using the following:

$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

As you can, the default java version is set to the JRE package installed separately as explained above.

Tuesday, May 28, 2013

Export Display over TELNET on Ubuntu 12.04 64 bit LTS


The solution is derived from this link

Edit the file /etc/lightgdm/lightgdm.conf and add the following line towards the end of file:

xserver-allow-tcp=true

and restart your system.

Open a terminal and run the following commands:

$ xhost +

allow any user to connect to the xserver


$ telnet  

Once you login, type in the following commands:

$ export DISPLAY=:0.0

$ xterm &

You should be able to see the terminal.

On your own computer (not the remote server), you can run the following command to verify if there is any "-nolisten" variable with tcp.

$ ps -ef | grep listen
nobody    1182   839  0 19:33 ?        00:00:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.0.1 --conf-file=/var/run/nm-dns-dnsmasq.conf --cache-size=0 --proxy-dnssec
mayank    5323  5064  0 20:17 pts/0    00:00:00 grep --color=auto listen


As you can see, it is not there and hence things should work properly now.

Disable Graphical login manager on Boot or Changing Default Runlevel on Ubuntu 12.04 64bit LTS

One of the following three methods should work for you:

1. If you just want to disable x-server after log-in. Then press CLT+ALT+F1. You can recover the x server by  running the following command:

$ startx


2. Ubuntu uses lightgdm instead of GDM as the default desktop manager.  So disable lightgdm on  boot by using the following command:

$ update-rc.d -f lightgdm remove

Then reboot the system.

You can start it by using either of the following two commands:

$ sudo service lightgdm restart
or
$ update-rc.d -f lightgdm defaults



3.  Edit the file /etc/default/grub and find the line containing the text:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

replace it by

GRUB_CMDLINE_LINUX_DEFAULT="text"

save the file and update the grub using the following command:

$ sudo update-grub

Now restart the system.

Monday, May 27, 2013

Making Webex work on Ubuntu 12.04 64 bit LTS with Firefox

I could finally get webex work on my ubuntu 12.04 64 bit LTS, thanks to Shariq's blog on the same topic. I will just enumerate few things in addition to what Shariq has already explained.


1. Install ia32-libs using apt-get:

$ sudo apt-get install ia32-libs


I did not downgrade the distribution as Shariq explained in his blog (see this link). I simply installed them using apt-get.

2. Create the folder ~/webex in your home folder as explained by Shariq. 

3. Download the firefox tar ball from the official firefox website. Just click on the download button to get the tar ball. I got the firefox-21.0.tar.bz2. I am not sure if it is a 32-bit or a 64-bit version. At least it did not matter to me.

4. Download the 32-bit JDK version from Oracle's official website. I got the package "jdk-7u21-linux-i586.tar.gz".

5. Extract these packages with in the ~/webex folder as shown below:

$ cd ~/webex
$ tar -xjvf firefox-21.0.tar.bz2
$ tar -xzvf dk-7u21-linux-i586.tar.gz

It creates two folders: 'firefox' and 'jdk1.7.0_21' within the webex folder.

6. Now link the java plugin within the firefox folder:

$ cd firefox
$ mkdir plugins
$ cd plugins
$ ln -s ~/webex/jdk1.7.0_21/jre/lib/i386/libnpjp2.so

Now you should be ready to go.  'Run the firefox executable within the firefox folder.

$ cd ~/webex/firefox
$ ./firefox &

Now open the webex link. You should be able to see the following screenshots. Note the blue 'share desktop' symbol. It indicates that webex is properly. The second screen shows the presentation shared on the webex.






Friday, May 24, 2013

Grub Rescue on Ubuntu 12.04

OS: Ubuntu 12.04

I have two versions of Ubuntu installed on a low-end PC. I resized partitions and it finally messed up the grub settings and I finally ended up getting a grub rescue > prompt on reboot:


I could finally resolve it but still I am not sure if it is the right method. If you know a better method, please let me know.  I basically followed the instructions given here.


Step 1.  It is necessary to identify and locate the partitions where the boot images of your distribution is available.

grub rescue> ls
(hd0)  (hd0,msdos3) (hd0,msdos7)  (hd0, msdos2) (hd0,msdos1)

grub rescue> ls (hd0,msdos1)/boot
... grub .. initrd.img-3.2.0-43-generic-pae ... vmlinuz-3.2.0-43-generic-pae ...

This is the right partition where we would like the grub to boot into

Step 2. It is necessary to find "linux.mod" file which usually lies inside /boot/grub folder.  Do the following:

grub rescue> set prefix=(hd0,msdos1)/boot/grub
grub rescue> insmod (hd0,msdos1)/boot/grub/linux.mod
grub rescue> insmod part_msdos
grub rescue> insmod ext2
grub rescue> insmod gzio

Last two may or may not be necessary. At least I don't get any errors so far.

Step 3. Now its time to tell grub to find the boot images.

grub rescue> set root=(hd0,msdos1)
grub rescue> linux /boot/vmlinuz-3.2.0-43-generic-pae root=/dev/sda1 ro 
grub rescue> initrd /boot/initrd.img-3.2.0-43-generic-pae
no partition found 
grub rescue> boot

The initrd command does not work for me. However, the system boots properly and I get back the login page of my distribution.

Once I log into the system, I open a terminal and install the 'boot-repair' package as follows:

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
 
I go for the 'recommended step' and everything gets into its place. When I reboot, I get 
the usual grub menu. If you have a live CD or Live USB, then you can boot into the system 
and install & run boot-repair as explained above to restore your grub. 
 


Monday, March 25, 2013

Removing Non-embedded fonts in PDF



IF you are creating a PDF file using latex ( latex -> dvi -> ps -> pdf), then you can embed your fonts into your postscript file using the following command:

$ latex file.tex 
$ dvips -Ppdf  -G0 -j0 -t letter file.dvi 

$ ps2pdf14 -dPDFSETTINGS=/prepress file.ps
$ pdffonts file.pdf


name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
ZKCWKK+Times-Italic                  Type 1C           yes yes no      20  0
SVPEPR+rtxb                          Type 1C           yes yes no      10  0
CFBFDF+rtxr                          Type 1C           yes yes no      18  0
AGNTKT+Times-Bold                    Type 1C           yes yes no       8  0
EFIXFI+txtt                          Type 1C           yes yes no      22  0
KFDWSB+Times-BoldItalic              Type 1C           yes yes no      16  0
HECNON+txsy                          Type 1C           yes yes yes     14  0
YDYILI+Times-Roman                   Type 1C           yes yes no      12  0
SLYWED+rtxmi                         Type 1C           yes yes no      29  0
UWMAWR+txex                          Type 1C           yes yes no      38  0
CQYSUU+rsfs10                        Type 1C           yes yes no      36  0
CQYSUU+rsfs5                         Type 1C           yes yes no      54  0
[none]                               Type 3            yes no  no      50  0
[none]                               Type 3            yes no  no      48  0
[none]                               Type 3            yes no  no      46  0
[none]                               Type 3            yes no  no      52  0
ZPCTTR+rtxsc                         Type 1C           yes yes no      70  0
GPRMLS+txsyc                         Type 1C           yes yes no      68  0
KLAHGF+rtxi                          Type 1C           yes yes no      85  0

For original post on this topic, click here

If you are having the latex source for the file. Install cm-super as shown below and insert the line \usepackage{lmodern} in your latex preamble and compile it. 

$ sudo apt-get install cm-super




Friday, February 22, 2013

C++: 3 Dimensional STL Vector with dynamic Re-sizing

Problem:

I want to create a 3 Dimensional Array whose dimensions are not known a priori. Let us that our 3 dimensional array is A[NP][NR][NC].  In my case, I know NP and NC a priori (before the execution of the program), but NR will be known only during run time.

Well I could make this array using pointers and using dynamic allocation functions like new/delete to get the desired effect. That is something I do regularly.

STL Vectors provide much better interface with several useful functions that can make your life lot easier. For instance, it is possible to resize these vectors during runtime. You can check for index bounds while accessing the elements etc.

So, I want to use STL vector to solve this problem.

Solution:

The following code demonstrates two ways by which you can accomplish the above objective.


  size_t np = 5; // no of pages
  size_t nc = 2; // no. of columns
  

  Method 1: Keep pushing the matrices into the page


  std::vector > matrix;
  std::vector > >page;

  for(size_t i = 0; i < np; ++i)
  {
    matrix.resize(i+1, std::vector(nc));
    for(size_t j = 0; j < matrix.size(); ++j)
    {
      for(size_t k = 0; k < matrix[j].size(); ++k)
        matrix.at(j).at(k) = rand()/(double)RAND_MAX;
    }
    page.push_back(matrix);
  }   


Method 2: Dynamically re-sizing 3D Array

  std::vector < std::vector > > page;

  page.resize(np); //np is known

  for(size_t i = 0; i < np; ++i)
  {
    page[i].resize(i+1, std::vector(nc));
    for(size_t j = 0; j < page[i].size(); ++j)
      for(size_t k = 0; k < page[i][j].size(); ++k)
        page[i][j][k] = rand()/(double)RAND_MAX;
  }        

           

                                


Tuesday, February 12, 2013

Installing Lotus Notes 8.5.3 on Ubuntu 12.04 64bit LTS


My office mail supports only Lotus Notes and hence I want to configure it on my ubuntu 12.04 64 bit LTS system. A very good tutorial on this is available here. I will not repeat the steps that are already mentioned at this site. Rather, I will only elaborate on errors that I encountered during my installation and tell you how I got around them.

It is easy to follow the steps from 1 to 5 of this tutorial.

Update:   In step 5, you need to download the getlibs from this link. The original link is not working any more.



 On step 6, when I execute the installation process:

$ sudo getlibs -p libgnomeprintui2.2-0 libgnomeprint2.2-0 libgnomevfs2-0 libgnomeui-0 libxkbfile1 libstartup-notification0 libsepol1 libselinux1 libgsf-1-114 libgsf-1-dev librsvg2-2 librsvg2-common libavahi-client3 libavahi-common3 libavahi-glib1 libbonoboui2-0 libcroco3 libdbus-1-3 libdbus-glib-1-2  libgnome2-0 libgnomecanvas2-0 libgnome-keyring0 libgnome-menu2 libesd0 gtk2-engines libgnome-desktop-2-17 libmotif4 libmotif3 libgnome-desktop-3-0 libavahi-glib1 gtk2-engines-oxygen gtk2-engines-aurora gtk2-engines-qtcurve  gtk2-engines-murrine gtk2-engines-equinox  alsa-base alsa-utils iproute libgnome-desktop-3-2 liborbit2 libbonobo2-0 libgconf2-4 libx11-6 libxt6 libxext6  libc6  libgcc1  libgtk2.0-0  libxkbfile1 libglib2.0-0  libstdc++6 bash libart-2.0-2 libpopt0 libgnomeui-0


libmotif3 was not found in your repositories
Make sure you have all repositories enabled and updated
E: No packages found
libgnome-desktop-3-0 was not found in your repositories
Make sure you have all repositories enabled and updated
Downloading ...
Installing libraries ...

But I think this is not serious enough and I decided to proceed further.



 In step 7, I get the following error when I try to install sametime:

$ sudo dpkg -i ibm-lotus-sametime-8.5.3.i586.deb

dpkg: regarding ibm-lotus-sametime-8.5.3.i586.deb containing ibm-lotus-sametime:i386, pre-dependency problem:
 ibm-lotus-sametime:i386 pre-depends on alsa-base
  alsa-base is not installed.
dpkg: error processing ibm-lotus-sametime-8.5.3.i586.deb (--install):
 pre-dependency problem - not installing ibm-lotus-sametime:i386
Errors were encountered while processing:
 ibm-lotus-sametime-8.5.3.i586.deb

I decide to ignore this as I am not worried about using same time at this time.


Update:  On a fresh install of Ubuntu 12.04 64 bit LTS, I could install the above package for 'sametime' without any error.  

Step 8 also works well.


Now in Step 9, I get the following error when I attempt to run the 'make' command:

$ make
gcc -Wall -Wextra -m32 `pkg-config –cflags gtk+-2.0`–shared libnotesgtkfix.c -o libnotesgtkfix.so -ldl 
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s

When I search for this library, I find that it is available at two locations: 

$ locate libgcc_s.so
/lib/i386-linux-gnu/libgcc_s.so.1
/lib/x86_64-linux-gnu/libgcc_s.so.1
/lib32/i386-linux-gnu/libgcc_s.so.1
/usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/4.6/32/libgcc_s.so

Somehow the linker was not able to link the 32-bit version of this library. So I decided to create a hard link inside the folder '/usr/lib/gcc/x86_64-linux-gnu/4.6'. 

$ sudo rm libgcc_s.so
$ sudo ln /lib32/i386-linux-gnu/libgcc_s.so.1 ./libgcc_s.so

It seemed to solve the problem and 'libnotesgtkfix.so' library is created.  


Update: Compiling notes-wrapper works fine. It does not give any error.  So, the make command works properly without any error generating 'libnotesgtkfix.so' library.  Just make sure your 'Makefile' looks something like this:

----------

all:
    gcc -Wall -Wextra -shared -m32 -L/lib32/i386-linux-gnu -lgcc_s `pkg-config --cflags gtk+-2.0`-shared libnotesgtkfix.c -o libnotesgtkfix.so -ldl

clean:
    rm -f libnotesgtkfix.so  

------------------


Also, while applying 'sed' to notes-wrapper, you still need to do the following:


While applying sed to the 'notes-wrapper' file, replace the command 

sudo sed -i ‘s/../notes %F/../notes-wrapper %F/g’ /usr/share/applications/LotusNotes8.5.desktop

with

sudo sed -i ‘s/\.\.\/notes\ \%F/\.\.\/notes\-wrapper\ \%F/g’ /usr/share/applications/LotusNotes8.5.desktop


Step 10 is OK. Only change the LD_LIBRARY_PATH from

LD_LIBRARY_PATH=$NOTESBIN:/usr/lib/i386-linux-gnu:$NOTESBIN/jvm/bin/classic:$NOTESBIN/jvm/bin:$LD_LIBRARY_PATH

to 

LD_LIBRARY_PATH=$NOTESBIN:/usr/lib32/:/usr/lib32/i386-linux-gnu:$NOTESBIN/jvm/bin/classic:$NOTESBIN/jvm/bin:$LD_LIBRARY_PATH 


In step 11, You need to include some more symlinks as given below:

$ sudo ln -s /usr/lib/i386-linux-gnu/i386-linux-gnu/libgnomevfs-2.so.0.2400.4 /usr/lib32/libgnomevfs-2.so.0
$ sudo ln -s /usr/lib/i386-linux-gnu/i386-linux-gnu/libgnome-2.so.0.3200.1 /usr/lib32/libgnome-2.so.0
$ sudo ln -s /usr/lib/i386-linux-gnu/i386-linux-gnu/libart_lgpl_2.so.2.3.21 /usr/lib32/libart_lgpl_2.so.2
$ sudo ln -s /usr/lib/i386-linux-gnu/i386-linux-gnu/libbonobo-2.so.0.0.0 /usr/lib32/libbonobo-2.so.0
$ sudo ln -s /usr/lib/i386-linux-gnu/i386-linux-gnu/libbonobo-activation.so.4.0.0 /usr/lib32/libbonobo-activation.so.4
$ sudo ln -s /usr/lib/i386-linux-gnu/i386-linux-gnu/libbonoboui-2.so.0.0.0 /usr/lib32/libbonoboui-2.so.0

If you get any error related to a library not found, just find its location and create a symbolic link within /usr/lib32 folder.

First time, run from the command line as a normal user as shown below: 

$ /opt/ibm/lotus/notes/notes-wrapper


setting locale …

setting notes environment …

starting notes …

`menu_proxy_module_load': /opt/ibm/lotus/notes/notes: undefined symbol: menu_proxy_module_load



(notes:3116): Gtk-WARNING **: Failed to load type module: (null)


`menu_proxy_module_load': /opt/ibm/lotus/notes/notes: undefined symbol: menu_proxy_module_load

(notes:3116): Gtk-WARNING **: Failed to load type module: (null)

ERROR: ld.so: object '/opt/ibm/lotus/notes/libnotesgtkfix.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/opt/ibm/lotus/notes/libnotesgtkfix.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/opt/ibm/lotus/notes/libnotesgtkfix.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/opt/ibm/lotus/notes/libnotesgtkfix.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/opt/ibm/lotus/notes/libnotesgtkfix.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/opt/ibm/lotus/notes/libnotesgtkfix.so' from LD_PRELOAD cannot be preloaded: ignored.
[03116:00002-4078790848] Error writing to process file pid.nbf, (other applications may be inappropriately accessing this file)SUT: OSSmartUpgradeInit: OSFileCreateDirectory: error: Cannot write or create file (file or disk is read-only)
ERROR: ld.so: object '/opt/ibm/lotus/notes/libnotesgtkfix.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/opt/ibm/lotus/notes/libnotesgtkfix.so' from LD_PRELOAD cannot be preloaded: ignored.
[03116:00002-4078790848] 02/12/2013 03:17:01.49 PM NEMInit> The declaration for notation '{0}' is invalid! Errorcode=39054.


[03116:00002-4078790848]  Thread=[03116:00002-4078790848]
Stack base=0xFFE2A25C, Stack size = 2268 bytes
PANIC: DESK create failed
Stack base = 0xffe2a25c, Stack size = 4092 bytes 
Fatal Error signal = 0x0000000b PID/TID = 3116/-216176448 
2/12/2013 15:17:02  Running NSD
2/12/2013 15:17:14  Termination is in progress
2/12/2013 15:17:14  Too many crashes, restart disabled
2/12/2013 15:17:14  Terminating tasks
2/12/2013 15:17:19  Freeing resources
2/12/2013 15:17:19  Termination completed


First time, it gives error and lotus note crashes. Ignore the error related to 'libnotesgtkfix.so' not getting preloaded. 

Not able to write the pid.nbf file is the real problem here. It is related to NSD. It does not let you start the notes. It gives a warning and terminates the program.  Little search on google lead to this link.

To solve this, add the following lines to the file /home/lotus/notes/data/notes.ini 

DISABLE_SAVENSDCONFIG=1

and Change the line

NotesProgram=/opt/ibm/lotus/notes/notes 

to 

NotesProgram=/opt/ibm/lotus/notes/notes-wrapper


You might need root permission to edit this file even though it is in your home directory.  Now when you give the above command, it finally starts without any error.  You need to have your ID file in order to configure the Lotus Client.  I also use the modification as suggested in this link as well: 

sudo mv /opt/ibm/lotus/notes/openwith /opt/ibm/lotus/notes/openwith.bak
sudo ln -s /usr/bin/gnome-open /opt/ibm/lotus/notes/openwith


The home screen opens after you give the password. But I get an error : CWPCA4003W: Failed to load application from url:nrpc:/ ....  (see the screenshot below). It has to do with some template design problem. I tried refreshing the template, but it did not help.


I am also able to create a local replica and synchronize it with the server. But I am not able to view my mailbox.  I am able to send a mail though. I think the problem lies with updating / upgrading templates.

Update: I don't get any error when I run the command '$ /opt/ibm/lotus/notes/notes-wrapper'. Everything works seamlessly.Put your lotus note ID file into "~/lotus/notes/data/"  folder located in your home directory. 

Monday, January 14, 2013

A Simple Cmake Tutorial

There are many Cmake tutorials available on internet. Still I had to struggle a bit to get exactly the things that I wanted. So I believe that the tutorial given below will be useful for a beginner who is looking for a quick and simple introduction into how cmake works. So, here we go !!

We are looking into the aspect of building static libraries in this example. I have the following directory structure for my package:

Utilities
  |------------ CMakeLists.txt
  |------------ /include
  |                    |------------ memalloc.h
  |------------ /lib
  |                    |------------ libmemalloc.a
  |------------ /src
                       |-------------- /memalloc
                                              |-------- CMakeLists.txt
                                              |--------- memalloc.cpp

The main folder 'Utilities' has three folders, namely, include, lib and src. The include contains all header files at one place. 'lib' should contain the static library 'libmemalloc.a' once it is built and the 'src' folder contains another folder named 'memalloc' that contains the file 'memalloc.cpp' that is needed for building the static library.

For this case, I need two 'CMakeLists.txt' one inside the main folder 'Utilities' and one inside the 'memalloc' folder within 'src' folder. Infact, all folders that would potentially produce an output such as a library or an executable should contain on 'CMakeLists.txt' file inside it.

The 'CMakeLists.txt' file within the main folder looks something as shown below:


#Specify the version being used
cmake_minimum_required(VERSION 2.8)

#Name your project here
project(UTIL)

# compiler
SET(CMAKE_CXX_COMPILER "g++")

# cpp flags
SET(CMAKE_CXX_FLAGS "-g -Wall")

# various project names
# go on adding multiple names for different projects
SET(PROJECT_NAMES "memalloc")

foreach(PROJECT_NAME ${PROJECT_NAMES})

  # add sub-directories
  add_subdirectory("${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}"
    "${CMAKE_CURRENT_BINARY_DIR}/out/${PROJECT_NAME}")

endforeach(PROJECT_NAME ${PROJECT_NAMES})

   -----------------------------------
For every project, there is a corresponding folder inside the 'src' folder. The content of the 'CMakeLists.txt' file inside the 'memalloc' folder is given below:


#include headers from this folder
include_directories(${UTIL_SOURCE_DIR}/include)

# source files
set(MEMALLOC_SOURCES "memalloc.cpp")

# Build Library
add_library(memalloc STATIC ${MEMALLOC_SOURCES})

# install directory
install(TARGETS memalloc 
  ARCHIVE DESTINATION "${UTIL_SOURCE_DIR}/lib" )

--------------------------------------------


Now execute the following commands inside the 'Utilities' folder:

$ mkdir build
$ cd build

$ cmake ../
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/swagat/TCS/Programs/utilities/build

$ make
Scanning dependencies of target memalloc
[100%] Building CXX object out/memalloc/CMakeFiles/memalloc.dir/memalloc.cpp.o
Linking CXX static library libmemalloc.a
[100%] Built target memalloc

$ make install
[100%] Built target memalloc
Install the project...
-- Install configuration: ""
-- Installing: /home/swg/utilities/lib/libmemalloc.a

------------------------------

If you want to build libraries within a given folder, then your CMakeLists.txt file should contain the following lines:



set(MVG_SOURCE "mvg.cpp")
# Build Library
add_library(mvg STATIC ${MVG_SOURCE})
set_target_properties(mvg PROPERTIES ARCHIVE_OUTPUT_DIRECTORY
  ${CMAKE_SOURCE_DIR}/lib)   

The library will be built within the lib folder under the root directory. Hence, you do not have use make install command as you did above. Make install command should be used for putting the files at a different location within your system. 

-----------------------------------

In order to build binary inside a specific directory instead of the default location, use the following statements:


add_executable(testmvg ${MVG_TEST_SRC})
target_link_libraries(testmvg ${GLIBS} ${MVG_LIB} ${MEM_LIB} )           
set_target_properties(testmvg PROPERTIES RUNTIME_OUTPUT_DIRECTORY
  ${CMAKE_SOURCE_DIR}/bin)  

--------------------------------              

Thursday, November 22, 2012

Converting jpeg to pdf with lower quality

Convert jpeg into PDF with 50% quality:

$ convert -quality 50 file1.jpg file.pdf


Combine multiple file into PDf

$ pdftk *.pdf cat output merged.pdf
or
$ pdftk file1.pdf file2.pdf cat output merged.pdf

You need to have imagemagick and pdftk installed on your system.

If you have multiple files to convert, use the following command on bash:


$ for i in *.jpg; do convert -quality 50 -resize 60% "$i" "${i%.jpg}.eps"; done


Changing resolutions in DPI

$ convert -units PixelsPerInch pic1.png -density 300 pic1.jpg
$ identify -verbose pic1.jpg | grep Resolution
Resolution: 300x300


Converting from PDF to eps 

$ pdftops -eps input.pdf output.eps

Wednesday, November 21, 2012

File Synchronization over Network using Unison

Unison is great tool for synchronizing files over network. Earlier I used rsync for file-synchronization. Unison at least provides one level of comfort over rsync which requires quite a bit of customization. If you want to use Unison to synchronize files between two systems over a network, then please refer to the following links:

http://www.howtoforge.com/setting-up-unison-file-synchronization-between-two-servers-on-ubuntu-11.10

This worked for me on Ubuntu 12.04 LTS 64-bit version and I managed to do everything mentioned on this page. One more thing, you don't need to use the root login for executing the steps.

If you need to delete the several profiles already created on Unison, you should go to ~/.unison folder and delete the corresponding .prf files. It is not possible to delete profiles using GUI.

Sunday, October 14, 2012

GNUPlots Loops


It is possible now to use 'loop's within the GNUPlot Command. See this link for more details.

The following commands plots 10 blocks with different colours. Remember each block is separated from the other block by a pair of double lines.

gnuplot> plot for [i=0:9] './clusterpos.txt' index i u 1:2 w p



Thursday, October 4, 2012

APT Behind Proxy Server Ubuntu 12.04


This worked for me on Ubuntu 12.04


Create a new file as shown below:

$ sudo gvim  /etc/apt/apt.conf.d/02http-proxy

and enter the following line:

Acquire::http::Proxy "http://username:password@proxy.tcs.com:8080";



Save the file and run

$ sudo apt-get update 

It should work for you.

One more thing, if your password contains '@' character, then you need to replace it with '%40' in your password.