Monday, December 7, 2009

ubuntu freenx arrow key

using arrow key via qtnx client while connected to an ubuntu freenx server results in a screen capture. to fix this problem follow the link below to change keyboard to "Evdev-managed keyboard"

http://ubuntuforums.org/showthread.php?t=959411

Tuesday, November 10, 2009

freenx arrow keys don't work

After reading tons, having no clue, flailing around, on both client and server I did System, Preferences, Keyboard, Layouts, "Evdev-managed keyboard" or similar, and then in the nx session, on the server, I did System, Preference, Keyboard shortcuts, Desktop, Take a screenshot. It was "Print", I pressed "Ctrl+PrtSc", it changed to "Ctrl+Print", and now ALL the nav keys work fine.

http://ubuntuforums.org/showthread.php?t=959411

Tuesday, October 27, 2009

decrease memory footprint of grails application

create war using grails war --nojar

copy shared jars into tomcat lib dir

Saturday, October 17, 2009

JavaFX on ubuntu linux

JavaFX gets a lot of bad rap, but this is mainly due to the difficulty of getting Java plugin working properly on firefox. Once the java firefox plugin is installed properly JavaFX works well. The load time is quick as well. It can be a Flash competitor if only the java browser plugin installation was easier.

I prefer downloading the JDK directly from SUN instead of using apt-get. Once the JDK is installed, all thats needed is to create a symlink.

I install my jdk in /usr/local/jdk

ln -s /usr/local/jdk/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/firefox/plugins

Restart firefox and

Thursday, June 25, 2009

Sunday, June 7, 2009

redirect http to https with grails

use a grails filter:
class SecurityFilters {
def filters = {
https(controller: '*', action: '*') {
before = {
if (!request.secure) {
String url = request.requestURL.toString()
String prefix = "http://"
String suffix = ".dispatch"

int startIndex = prefix.size()
def endIndex = url.indexOf(suffix) - 1
def grails = url.indexOf("/grails/")

String body = url[startIndex..grails - 1] + url[grails + 7..endIndex]
String secureHttp = "https://$body"
redirect(url: secureHttp)
return false
}
}
}

Tuesday, June 2, 2009

empty subject (no subject) in email with grails mail plugin

When sending email using the grails mail plugin, the email subject always ends up empty with (no subject)

this is a known problem. see the link
http://www.nabble.com/Grails-mail-plugin-0.5-:-subject-and-body-always-empty-td20008519.html

The problem happens if you have groovyws-all-0.4.jar in your lib directory. groovyws-all.jar also has javax.mail.* classes packed in there. The fix is as simple unjaring, remove the javax.mail package and rejar it.

hope someone finds this helpful... spent a good half day researching this

Thursday, May 21, 2009

skype on 64bit linux

skype doesn't provide a 64bit version for linux, but the 32bit version works fine on a 64bit linux machine. On ubuntu, force the install:

sudo dpkg --force-architecture -i skype-debian_2.0.0.72-1_i386.deb

tmobile hotspot wifi at borders/star bucks ubuntu linux on dell studio xps

Got a dell studio xps 13 (SX13-163B) and have ubuntu 9.04 running on it. Everything works great bluetooth keyboard/mouse, webcam (tested using skype). Wifi at home works without a problem. However when connecting to a tmobile hotspot at borders/star bucks, the wifi would randomly drop connection every few minutes or so which is very annoying and disruptive to my work. I did some experimentation. I disable the network manager then manually started the dhcp client by running:

% sudo dhclient wlan0

After that I was able to connect without interruption for 3hours now. Hope this info is useful for somebody

Tuesday, April 21, 2009

difficulty installing android plugin for eclipse ganymede

following directions at http://developer.android.com/sdk/1.1_r1/installing.html on installing the android plugin did not work.

apparently, the URL to the update site are wrong. The correct URL is
http://dl-ssl.google.com/android/eclipse/site.xml

https://dl-ssl.google.com/android/eclipse/site.xml does NOT work so use the http URL

Thursday, March 5, 2009

Calling Webservices with Groovy

import groovyx.net.ws.WSClient

def proxy = new WSClient("http://host/aService",this.class.classLoader)
def service = proxy.create("package.aService")
service.aMethod()

Wednesday, March 4, 2009

add/removing rows from dojox.grid.DataGrid

There is a bug with dojox.grid.DataGrid when deleting a row and adding it back. When adding back the row, it must have a different id otherwise it would not work.

Sunday, March 1, 2009

mounting sd card on ubuntu linux

first do ls /dev/mmcblk*
you should see something like:

/dev/mmcblk0 /dev/mmcblk0p1

now mount the device /dev/mmcblk0p1:
sudo mount -t vfat /dev/mmcblk0 /mnt

your sd should now be available at the mount point /mnt

Wednesday, February 25, 2009

accessing a VPN on ubuntu Linux via ssh port forwarding

If you need to access a VPN on Linux but the VPN software is only available for Windows, use ssh port forwarding to a Windows VM hosted on Virtual Box.

Here's how to do it:

1. Follow my previous post on
how to configure host interface networking for virtualbox

2. Install OpenSSH for windows either using cygwin. If you don't want to install the complete cygwin environment, but just openssh server I recommend installing openssh for windows

3. Make sure you can connect to the VPN on your virtualbox windows VM.

4. Setup port forwarding to the windows VM connected to the VPN. On your linux box:
% ssh -C -L localPort:vpnHost:remotePort windowsVM
localPort is the port on your linux machine
vpnHost:remotePort is the host and port on the VPN you want to forward traffic to

Let's look at step 4 more closely because it can be somewhat confusing at first. The -C switch tells ssh to compress data as it sends it. The -L switch tells ssh to setup port forwarding. SSH will connect the windowsVM, compress and forward all local traffic on your linux machine destined for localPort to the vpnHost:remotePort. Note that vpnHost can be any host accessible to windowsVM

To give a more concrete example suppose you want to access a webserver (port 80) on a VPN IP/host (10.10.74.164). On your linux box, you cannot open http://10.10.74.164:80, but your virtualbox windowsVM (192.168.1.10) can because it is running the VPN software. If you want to access http://10.10.74.164:80 from your Linux box, you setup ssh port forwarding as follows:

% ssh -C -L 8080:10.10.74.164:80 192.168.1.10

The above command will port all traffic to my local port 8080 to VPN host 10.10.74.164 port 80 via my windowsVM. On your linux box, you can access http://10.10.74.164:80
by http://localhost:8080. NOTE: if you want to forward local port 80 to remote port, you must be ssh as root because on Linux/Unix, only root can access ports less than 1024

configuring host interface networking for virtualbox on ubuntu

Host interface networking is a network option in virtualbox that allows your VM to share the host network card. With this option the VM can have its own routeable IP address on your network. It is unfortunate that this setup is not as simple as choosing this option and clicking OK.

To use host interface networking for your virtualbox VM, you must first create a bridge to your physical network interface.

Follow these steps to create a bridge:

1. install bridge-utils, uml-utilities package
% sudo apt-get install bridge-utils uml-utilities

2. put your NIC (e.g. eth0) in promiscuous mode
% sudo ifconfig eth0 0.0.0.0 promisc

3. create the bridge br0
% sudo brctl addbr br0

4. attach bridge (e.g. br0) to NIC (e.g. eth0)
% sudo brctl addif br0 eth0

5. configure IP address for your bridge (e.g. br0)
% sudo ifconfig br0 192.168.1.2
or if you're using dhcp
% sudo dhclient br0

6. skip this step if you're using dhcp. configure the default gateway (e.g. 192.168.1.1) for your bridge (e.g. br0)
% sudo route add default gw 192.168.1.1 br0

7. create virtual NIC (e.g. veth0)
% sudo tunctl -t veth0 -u root

8. attach the bridge (e.g. br0) to your virtual NIC (veth0)
% sudo brctl addif br0 veth0

That's it! Now your VM can use veth0 as its network interface. In the settings|network settings of your VM, choose "Host Interface" in the Attached to drop down box. Then use veth0 as the host interface name. If your network has a DHCP server, it should be broadcasting DHCP request to veth0 otherwise you will have to configure the network manually on your VM.