Mostrando entradas con la etiqueta ubuntu. Mostrar todas las entradas
Mostrando entradas con la etiqueta ubuntu. Mostrar todas las entradas

27 dic 2013

Make Java applets work with chromium-browser on Ubuntu

The problem

On some Ubuntu versions, notably Ubuntu 12.04 LTS and some newer ones, Chromium >= 30 may not execute Java applets. In some browser versions, it will crash the browser process.

Run your own test:


The result should be something like this:



The problem is a name clash with a Java library: libnet.so.

This does not happen with all Chromium versions. In recent versions, all the provided libraries can't be linked statically into one single executable as before. (The resulting binary would be too big.) Hence the libs directory.

The solution

Of course, you can use Mozilla Firefox or some other browser which allows the use of Java applets. For me, the Google Chrome browser also works correctly.

So if you still want to use Chromium, go on.

Let's change all libnet occurrences with some other unused library name.

Here we go:

sudo su
apt-get install bbe
cp -a /usr/lib/chromium-browser /usr/lib/chromium-browser.bak
cd /usr/lib/chromium-browser
for f in `rgrep -l libnet .`
do
  bbe -e 's/libnet/libxet/' $f > $f.new
  mv -f $f.new $f
done
mv libs/libnet.so libs/libxet.so
mv libs/libnet_with_v8.so libs/libxet_with_v8.so
chmod +x chromium-browser

Before running the test again make sure all chromium-browser processes have stopped and kill them if necessary:
ps aux | grep chromium-browser
killall chromium-browser

Now run the applet test again and see if it works.

Take into account that the next package update may overwrite these changes.

Conclusion

Although a bit hackish, if you have to use Java applets in daily work like me and you really want to use Chromium, here you have a solution.

30 nov 2012

Compile Nginx with custom OpenSSL in Ubuntu 10.04

The problem

We need Server Name Indication (SNI) for nginx, but the OpenSSL version included in Ubuntu 10.04 does not support it.

Edit: I just noticed that I was wrong. SNI  *IS* supported by the version of openssl provided with Ubuntu 10.04:  libssl0.9.8-7ubuntu8.13 

The solution

  • Download, build and install a recent version of OpenSSL
  • Compile nginx against this version of OpenSSL
  • Do not replace the system openssl
Here are the steps I took:

# install dependencies
sudo apt-get install build-essential libpcre3-dev libxml2-dev libxslt1-dev
cd
mkdir -p src; cd src
wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar xzf openssl*
cd openssl*
./config shared zlib-dynamic
make
# This installs everything in /usr/local/ssl
sudo make install
wget http://nginx.org/download/nginx-1.2.5.tar.gz
tar xzf nginx*
cd nginx*
# edit auto/lib/openssl/conf manually or use sed
sed -i -e 's|\.openssl/||' auto/lib/openssl/conf
./configure --with-openssl=/usr/local/ssl --with-http_ssl_module
make
# test if SNI is displayed
./objs/nginx -V
# if everithing is ok, install
sudo make install

References




20 nov 2007

Problems launching VirtualBox in headless mode with ssh

I recently installed a VirtualBox image to run remotely using ssh. My command was:

VBoxVRDP -startvm "GuestOS" >~/VBoxVRDP.log 2>&1 &

inside the ssh session.

Whenever closed the ssh session, the virtual machine was killed. I thought it was a problem of the terminal, so I tried out screen and dtach. But the problem was remaining. Googling around, I finally found:
http://www.virtualbox.de/ticket/722
In effect, I had shared clipboard enabled. After I disabled it, I could finally start VirtualBox using:
ssh -x zope@192.168.11.201 'VBoxVRDP -startvm "GuestOS" >~/VBoxVRDP.log 2>&1 &'

Now, I'm a bit happier.
Cheers.

4 nov 2007

Hibernate with Ubuntu Feisty

Hibernate never worked for me using Ubuntu. Now, I'm using Dell Inspiron 8600 and upgraded recently to Ubuntu Feisty. What I did for hibernate to work:


  1. Make sure swap device works correctly. Now there isn't /dev/hd[x] anymore. This has been renamed to /dev/sd[x]. I recreated my swap partition:

    $ sudo swapoff -a # disable swap devices
    $ sudo mkswap /dev/sda3 # recreate my swap partition

    # edit /etc/fstab, make sure to use /dev/sd... My line is:
    /dev/sda3 none swap sw 0 0

    $ sudo swapon -a # enable swap again
    $ sudo swapon -s # see swap devices used
    Filename Type Size Used Priority
    /dev/sda3 partition 1044216 0 -1


  2. Install uswsusp. Kernel driver included in standard Linux 2.6.
    $ sudo apt-get install uswsusp


    You should see a configuration screen, but if it was already installed or no configuration appears, do a:
    $ sudo dpkg-reconfigure uswsusp


    1. The device node through which uswsusp can talk to the kernel: leave blank
    2. Perform checksum on image? No
    3. Compress Image? Yes
    4. Perform early write out? Yes
    5. Preferred maximum image size: proposed value (mine is 600 MB, depends on your RAM)
    6. Log level: Leave blank
    7. Maximal log level: Leave blank
    8. Encrypt image? No

    The config file /etc/uswsusp.conf is written and the initrd images are updated.
    Check this configuration file a see if resume device is accurate. If not, change it and do a:
    $ sudo update-initramfs -u -k all

    Now, s2disk should work correctly. This is the suspend 2 disk command. Try it! But, "hibernate" command and gnome "Log out" screen hibernate option may not work.

  3. Configure hibernate to use uswsusp. Edit the /etc/hibernate/hibernate.conf. Just comment out all lines except:
    TryMethod disk.conf

    Now hibernate may work. (You need sudo.) But gnome desktop utilities may not. Gnome signals through hal that it should hibernate the computer, but the default file /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux uses pmi (power management interface). As some links tell, you can replace it with a version that tries to use s2disk before any other option. Google for: "feisty hibernate hal" and you'll find alternate scripts.

    Now the gnome-power-manager and logoff screen "hibernate" option should work.

  4. If the power button does not work, do:
    $ sudo apt-get install --reinstall acpi-support



For me, at this point hibernate support is perfect.
Cheers.