Monthly Archives: April 2012

Using clipboard via SSH in Linux


To use clipboard on SSH you can install package Parcellite

pacman -S parcellite

Check out sync property!

Xorg fonts installation in Arch Linux

To install fonts in xorg you need:

# pacman -S opendesktop-fonts ttf-dejavu ttf-freefont ttf-junicode ttf-linux-libertine ttf-droid ttf-gentium ttf-inconsolata ttf-ubuntu-font-family freetype2 gsfonts xorg-fonts-type1 font-mathematica profont terminus-font

Find other fonts like:

# pacman -Ss font

After installing, refresh font cache:

# fc-cache -vfs

Also, read https://wiki.archlinux.org/index.php/Fonts

Java SE6 JDK installation in Linux

To install Java SE6 JDK you should:
1. Download self-extracting package jdk-6u31-linux-i586.bin from
http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Copy it to:

  cp jdk-6u31-linux-i586.bin /usr/lib

3. Edit “nano /etc/profile” – to change PATH variable:

export J2SDKDIR=/usr/lib/jdk1.6.0_31
export J2REDIR=$J2SDKDIR/jre
export JAVA_HOME=$J2SDKDIR
export CLASSPATH="$JAVA_HOME/bin:$JAVA_HOME/jre/bin"

# Set our default path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
export PATH=$PATH:$CLASSPATH

4. Remove self-extracting package:

  rm jdk-6u31-linux-i586.bin

5. Logout and login again.

After that your java is worked.

Also:
http://askubuntu.com/questions/67909/how-do-i-install-oracle-jdk-6
http://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7

WebService build by WSDL with Ant and wsimport

Just create a progect and ant build file with:

<?xml version="1.0" encoding="utf-8" ?>
<project name="wsNameClent" basedir=".">

<property name="wsdl" value="http://localhost:8080/wsSome?wsdl"/>
<target name="wsimport">
 	<exec executable="wsimport" >
 		<arg value="-verbose"/>
 		<arg value="-keep"/>
 		<arg value="-d"/>
 		<arg value="bin"/>
 		<arg value="-s"/> 
 		<arg value="src"/>
 		<arg value="${wsdl}"/>
 	</exec>
</target>

</project>

If you’ve to provide authorized access add to args:

	<arg value="-Xauthfile"/>
	<arg value="src/resources/auth"/>

Where src/resources/auth is like:


http://userName:userPass@key-provider.com/keyws?wsdl

No one code typing!

To test your svc use like this:

TwitService svc = new TwitService();
GetAllTwitsResponse resp = svc.getTwitSoap11().getAllTwits(new GetAllTwitsRequest());
for (Twit_Type tw : resp.getTwit())
{
	System.out.println(tw.getNick() + " - " + tw.getMessage());
}

Also, good java webservices tutorial http://www.mkyong.com/tutorials/jax-ws-tutorials/

Xen error – could not open /dev/net/tun: no virtual network emulation

After brctl show doesn’t outputs xenbr0 and such error occures when xm create domu.cfg:

  warning: could not open /dev/net/tun: no virtual network emulation
  Could not initialize device 'tap' 

Enable module in kernel:

-> Device Drivers
  -> Network device support
    -> Universal TUN/TAP device driver support

And your network will well worked.

Guest Additions for Virtualbox in Linux

If your guest additions don’t mounted automaticly, use:

  mkdir /mnt/cdrom
  mount -t iso9660 /dev/cdrom0 /mnt/cdrom
  cd /mnt/cdrom
  sh ./VBoxLinuxAdditions.run

Connect to DB2 via JDBC in Database Manager

To connect you’d point a URL to databse, a driver and its location.

URL:

  jdbc:db2://somhost.org:50001/SOMEDBNAME

Driver:

  com.ibm.db2.jcc.DB2Driver

Driver location (for Windows OS):

  C:\Program Files\Aqua Data Studio 8.0 - 32bit\lib\drivers\db2jcc.jar

Also, read http://docs.aquafold.com/ads/4.7/docs-jdbcdrivers-db2.html