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