"; */ ?>


03
Jun 08

Install Floola on Ubuntu

iPod on UbuntuFloola is a freeware application to efficiently manage your iPod or your Motorola mobile phone (any model supporting iTunes). It’s a standalone application that can be run directly from your iPod and needs no installation under Linux, Mac OS X and Windows (Windows Vista is supported).

Step 1. Get it from:

http://www.floola.com/modules/wiwimod/index.php?page=download_linux

Step 2. Before running make sure to install c++ standard library:

sudo apt-get install libstdc++5

Step 3. DONE!


03
Jun 08

Install Avant Window Navigator on Ubuntu Hardy Heron

add these two in /etc/apt/sources.list

deb http://ppa.launchpad.net/awn-core/ubuntu/ hardy main
deb-src http://ppa.launchpad.net/awn-core/ubuntu/ hardy main

sudo apt-get update

sudo apt-get install awn-manager-trunk awn-extras-applets-trunk


03
Jun 08

Install Opera in Ubuntu Hardy Heron

1. Add “deb http://archive.canonical.com/ubuntu feisty-commercial main” to /etc/apt/source.list

2. sudo apt-get update

3. sudo apt-get install opera


03
Jun 08

Connect to Wireless Network on Startup

Make sure to have only one “auto” interface, as it will be the main one
If you have “auto eth0” as well, then once “eth0” is unplugged “eth1” will be also unreachable

edit network interfaces configuration:

vi /etc/network/interfaces

here is what to put in:

auto eth1
iface eth1 inet dhcp
wireless-essid YourESSIDName
wireless-channel 10
wireless-key ##########################

to make it get a static IP, do this instead of the above:

 
# The primary network interface
# connect to wirless network on startup
auto eth1
 
# eth1 Interface
iface eth1 inet static
address  10.7.1.99
netmask  255.255.255.0
network  10.7.1.0
broadcast 10.7.1.255
gateway  10.7.1.1
wireless-essid YourESSIDName
wireless-channel 10
wireless-key ##########################

28
May 08

Generate XSD from XML

There are several tools out there to create (or to infer) an XSD schema from XML document. I liked trang command line tool the most. Found it first when reading about Spring web services in Spring in Action book (very good book btw).

Here are four simple steps how to create XSD from XML* using trang:

Step 1. Get trang

Download trang.zip from here (at the moment of writing “trang-20030619.zip”)

Step 2. Extract it

Use “unzip trang-version.zip”, or just winzip/winrar/7z etc.. if on windows

Step 3. Make an alias

This step is optional, but makes it extremely easy to run the tool with a single command. Make an alias to the “trang.jar” by (in my case Ubuntu/Linux) editing “~/.bashrc” and adding the following:

# execute trang.jar (create XSD from XMLs)
alias xml2xsd='java -jar ~/soft/utils/trang/trang-20030619/trang.jar'

above “~/soft/utils/trang” is the directory where “trang” was unzipped to.

Step 4. Create XSD from XML

Let’s look at the XML file we need an XSD for:

$ ls -l
total 4
-rw-r--r-- 1 user group 357 2008-05-28 15:38 holiday-request.xml
 
$ cat holiday-request.xml
<?xml version="1.0" encoding="UTF-8"?>
<holidayRequest xmlns="http://mycompany.com/hr/schemas">
    <holiday>
        <startDate>2006-07-03</startDate>
        <endDate>2006-07-07</endDate>
    </holiday>
    <employee>
        <number>42</number>
        <firstName>Ultimate</firstName>
        <lastName>Answer</lastName>
    </employee>
</holidayRequest>

now run the tool against it:

$ xml2xsd holiday-request.xml hr.xsd
$ cat hr.xsd
<?xml version=”1.0″ encoding=”UTF-8″?>
<xs:schema xmlns:xs=”http://www.w3.org/2001/XMLSchema” elementFormDefault=”qualified” targetNamespace=”http://mycompany.com/hr/schemas” xmlns:schemas=”http://mycompany.com/hr/schemas”>
  <xs:element name=”HolidayRequest”>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref=”schemas:Holiday”/>
        <xs:element ref=”schemas:Employee”/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name=”Holiday”>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref=”schemas:StartDate”/>
        <xs:element ref=”schemas:EndDate”/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name=”StartDate” type=”xs:NMTOKEN”/>
  <xs:element name=”EndDate” type=”xs:NMTOKEN”/>
  <xs:element name=”Employee”>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref=”schemas:Number”/>
        <xs:element ref=”schemas:FirstName”/>
        <xs:element ref=”schemas:LastName”/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name=”Number” type=”xs:integer”/>
  <xs:element name=”FirstName” type=”xs:NCName”/>
  <xs:element name=”LastName” type=”xs:NCName”/>
</xs:schema>

done!

$

* – NOTE: “trang” can create an XSD from multiple XML documents, not just one.

List of other tools to use as an alternative to trang:

XSD away, Good Luck!