Tuesday, 3 September 2013

making a curl call from linux command line


Before using curl you may have to install it

sudo apt-get install curl

curl --form "fileupload=@testfile.txt" http://demosite.com/resource.php
curl --data "param1=value1&param2=value2" http://demosite/resource.php
curl -X POST -d @testfilehttp://demosite.com/path/to/resource --header "Content-Type:text/xml" (HTTP POST containing XML)
curl -X POST -d @testfile.txthttp://demosite.com/path/to/resource --header "Content-Type:application/json" (HTTP POST JSON)

Monday, 2 September 2013

Eclipse fails to start in Ubuntu12.04 after installing Oracle Java

Problem: Eclipse fails to start, with message -

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
    no swt-gtk-3740 in java.library.path
    no swt-gtk in java.library.path


Reason: Tries to find these libraries in the corresponding location for OpenJDK.
Fix:
open terminal window and type
sudo gedit/etc/eclipse.ini
Append line in last:
"-Djava.library.path=/usr/lib/jni"
Save the file.
Now launch eclipse again eclipse should run successfully

ubuntu 12.10 virtual box not running after kernel upgrade.

sudo apt-get install linux-headers-`uname -r`
sudo dpkg-reconfigure virtualbox-dkms  
sudo modprobe vboxdrv
So now VirtualBox works again without any reboot.