December 18, 2006

Setting Default Text File Encoding in Eclipse

I was recently working with a set of SQL migration scripts in eclipse and started noticing that the localized characters weren't showing correctly. I've seen all kinds of chaos in my project with different file formats creeping into the sources and database. So I did a looking and found that Eclipse was defaulting to Cp1252 for the encoding. This is a pain and the cause of my files not displaying. So went into Window->Preferences... and Opened General->Workspace and changed the Text file encoding setting to UTF-8. Now all is good again.

December 14, 2006

How to query Oracle Schema

I have been trying to query the difference between Oracle Schemas for a project I'm working on.

  • get SQL Developer (free) from Oracle

  • I needed was a list of the system tables in Oracle which I found here.

  • Next log in as the user who's schema you want to print.

  • The basic query you want is:

    SELECT
    t.table_name
    , column_name
    , data_type
    , data_length
    FROM USER_TABLES t, USER_TAB_COLUMNS c
    where t.TABLE_NAME = c.table_name;

  • run the script using F5 and select the Script Output tab

  • Save the output


You can repeat this process for other schemas and use a diff tool like beyond compare to find the differences.

December 01, 2006

Good RSS Reader in Java

I heard about BlogBridge this week from the Java Posse. it is a good RSS Reader written in Java. This means that I can use the same reader in Windows and Linux. Even better if you sign up with their free service you can store your settings and feeds online so you don't have to reconfigure your reader on each system. Very cool! It has an interesting Guide, Feed Article view that allows you to group sets of feeds under a category.

November 22, 2006

Javascript Object Literals

For a while now I've been experimenting with the dojo toolkit. I have been puzzling over what the following meant.

var something =
{ somename: "some value",
anothername: "another value",
more: function () { alert("called"); }
};


It is hard to come up with a search query for this. At first I thought it might be some sort of dictionary or hash table shorthand. However, I finally found that it was an object declaration shorthand and is equivilent to

var something = new Object();
something.somename = "some value";
something.anothername = "another value";
something.more = function () { alert("called"); };

November 18, 2006

Power Shell for windows

I saw this release of Power Shell. It looks like it will do some Unix commands that I always get tripped up on when I'm running windows. It will work on WinXP and Server 2003. I'm installing and we'll see how it works.

October 17, 2006

Ubuntu System Clock setting for UTC

Ubuntu live CD installs assuming the system clock is UTC. If you dual boot to windows (which assumes local timezone) you will get a shifted time in windows. To change this after Ubuntu installs go to /etc/default/rcS and modify the line that says: UTC=yes setting it to no. Now when you reboot it will treat the bios clock as local time and all can live in happy time.

Gnome Menu Files

while trying to setup a new system I wanted to copy some menu settings I had. Alacarte is a great tool, but as with most gui tools get tedious when you have multiple similar actions. So after digging around I found the two directories of interest: ~/.config/menus and ~/.local/share/applications.

The menus directory has an XML file called applications.menu which contains the structure and points to *.desktop launchers in the ~/.local/share/applications directory.

copying the desired files from these directories should re-create your menus on the new system.

October 12, 2006

Read your EXT2/3 partitions from Windows

I Found this driver for the linux ext2 filesystem. It makes transfering files to and from your dual boot machine very easy.

September 18, 2006

Ubuntu Environment variables

On Ubuntu, to set a global environment variable, edit /etc/environment and follow the form:

<Name>=<Value>
For the setting to be local to your login you can edit ~/.profile but you will need to use export <Name>=<Value>


I've used this for the JAVA_HOME, TOMCAT_HOME and ORACLE_HOME environment variables.

September 14, 2006

IP Renewal when moving between networks

On Ubuntu when I move my laptop from one subnet to another (desk to conference room for example) the dhcp ip doesn't reload. Previously I would disable the adapter then re-enable it but that took a bit of time. I found that you can use dhclient to do the trick from a shell:

sudo dhclient -r to release ip.

sudo dhclient -1 to renew ip. (that is a -one not the letter 'l').

September 13, 2006

Firefox Plugins

There are two Firefox plugins that I use (and keep installing after loading a new distro):

Google bookmarks plugin.This plugin allows me to share bookmarks to help articles and good links between builds and machines. There is also a google browser sync plugin but I am a little skeptical of how intrusive it is and more than just a little uncomfortable with my saved passwords being synchronized through google so I stick with the bookmarks.

Chris Pederick's web developer toolbar is awesome not only for figuring out how a page is put together, but also for controlling pesky pages with features like disabling meta refreshes and javascript.

Installing Oracle XE on Ubuntu

The easy way of adding Oracle XE on Ubuntu. There is now an apt-get repository up on oss.oracle.com for XE.

Just add:

deb http://oss.oracle.com/debian unstable main non-free

to /etc/apt/sources.list.
Get the certificate with:

wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -

Then open the Synaptic package manager by clicking the menu System > Administration > Synaptic Package Manager. (hint: in Ubuntu to do priviledged things you can use the command sudo from the commandline and enter you normal password when asked to. You can do this on window popups too. Ubuntu is configured so that you never know the root password you just sudo everything and your current password will work. If you want to be root at the command line just type sudo su).

Now in the package manager click the reload button (if you are behind a proxy be sure to set it in Settings > Preferences). Once it is done click search and look for oracle-xe-universal. click the box next to it and select Mark for Installation. When it is done you'll have a nice menu entry under Applications > Oracle Database 10g Express Edition.

I found this info in this post.

Once you have Oracle installed, you need to add your user to the dba group using System > Administration > Users and Groups

It looks like you are done from the installer, but there seems to be one other thing you need to do: sudo /etc/init.d/oracle-xe configure

Microsoft Intellimouse Explorer for Bluetooth on Ubuntu Dapper

Ok, I'm starting to tip back to Ubuntu from SuSE 10.1, though I might try 10 again soon. As the title suggests I have a Microsoft Intellimouse for Bluetooth. There is a little setup that one needs to do to get it to work, but really it is straight forward. Out of the box you can get it to connect and use the scroll wheel and normal buttons, but the forward and back nav buttons don't work. I don't think you can get the wheel tilt buttons to work. So here is my setup:

  • When the mouse goes to sleep after no activity it won't reconnect unless you do the following. Configure bluetooth by editing bluez-utils:

    • sudo vi /etc/default/bluez-utils
    • Change HIDD_ENABLED=0 to HIDD_ENABLED=1
    • Make sure HIDD_OPTIONS="--master --server"


  • Restart bluetooth with sudo /etc/init.d/bluetooth restart

  • Connect the mouse:

    • Push the connect button on the bottom of the mouse for 5 sec.

    • type sudo hidd --search



  • The mouse is now connected and should reconnect after a reboot automatically (give it a few seconds after moving it). Now to get the forward backward buttons working.

  • Edit the xorg.conf file:

    • sudo vi /etc/X11/xorg.conf

    • find the InputDevice section with Driver "mouse" and Option "CorePointer"

    • make sure Option "Protocol" "ExplorerPS/2" exists

    • make sure Option "ZAxisMapping" "4 5" exists

    • make sure Option "Buttons" "7" exists

    • make sure Option "Emulate3Buttons" "false" exists

    • save file with ESC : wq



  • Setup the buttons by creating the xmodemap file: sudo gedit /etc/X11/Xsession.d/57xmodmap

  • Enter xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7 10 11" then save and exit

  • restart (easiest way to really restart X)

  • on restart your bluetooth mouse should reconnect. Open firefox, then go to a new web page and test the forward and back buttons and the scroll wheel.



I got most of my info by plowing through this thread.

My Podcast URLs

In all my switching between Linux distros I find myself keep trying to reload podcast urls, So here is my list:

I haven't listened to many of the Linux News Log, Linux - powered by PodTech and Linux Questions yet but the rest are solid recomendations.

From PuTTY to OpenSSH

As part of my move to linux I need to be able to ssh through a proxy. On WinXP I used PuTTY. While PuTTY can be built on Linux, choose to start with ssh (I believe this is from openssh), but the proxy part wasn't clear. So I used corkscrew to use the proxy. I created a ~/.ssh/config file and added:

Host <destination>
ProxyCommand corkscrew <proxyname> <proxyport> %h %p

The one other thing I had to do is convert my Key from PuTTY's ppk format to openSSH format using PuTTY's Key Generator. I then used ssh-agent to handle the authentication, so my connect command looks like this:

>ssh-agent xterm

in the new terminal do:

>ssh-add openSSH_Key
>ssh user@hostname

That was it. Now to tackle multiple tunnels.

Dropped YAST going SMART

I've been trying to setup SuSE 10.1 on my laptop and finally got tired of trying to get YAST Software Update to work. I finally gave in and switched to SMART. Here are a few things I do to set it up:
  • Follow these directions to setup SMART
  • Note when installing SMART answer Y to all repositories (channels). The risky ones are marked inactive. If you don't say yes to them it is tough finding the repositories to add later.
  • Next before you do a major update (like update all) make sure you configure mirrors for ftp.suse.com, ftp.gwdg.de (Guru) and packman.inode.at (Packman)

Going with Linux

Finally I have the opportunity to run something other than Windows at work!
I would love to give OS X a try, but that would require new hardware (not likely). Instead I'm exploring several Linux distributions:
The system I am using is a IBM T42. This system has wireless, bluetooth and the normal laptop power features. I am using a Microsoft Intelimouse Explorer for Bluetooth mouse.

So far here are my opinions:
  • Ubuntu 6.06 LTS
    • Awsome distro! everything worked out of the box including wireless and bluetooth (though connecting the mouse does not have a graphical interface).
    • The LiveCD installer mames any existing installs so install it first or use the Alternative CD.
    • Doesn't have as much "corporate" support (at least my corporation).
    • My Bluetooth mouse works with a little setup (including scroll wheel and nav buttons).
    • I miss some of the KDE apps like Amorak.
  • SUSE 10.1 KDE
    • I like the colors and features of KDE
    • The start bar is to big, this is a laptop and screen realistate is limited.
    • Wireless doesn't work unless you remember to check the box that says "Use additional Software" at the beginning of the install and use the Add-ons CD.
    • My Bluetooth mouse goes into sleep after 12 min inactivity. When it gets woken back up, It isn't recognized (though I found a fix for SUSE Gnome that I haven't tried in KDE yet.)
    • Has a Windows domain option in YaST (though I haven't gotten it working yet.)
    • Problematic YaST package manager (there are fixes, but they are tricky to recover from if you mess-up). Many folks are using the SMART package manager instead. The one catch I found with SMART is that it fails to connect to the pgp key server through the system proxy and you can't tell SMART to tell GPM to use a proxy (at least that I have found).
  • SUSE 10.1 Gnome
    • Nice tidy startbar
    • Most of the other comments from KDE version apply here.
    • I finally got my Bluetooth mouse to recover from a sleep and reconnect after reboot (haven't tested the fix on KDE yet.)
    • Miss some of the KDE apps.
    • Most forum help is on KDE.
    • Scroll wheel on my mouse doesn't send any info back (using hcidump and cat /dev/input/mice).
I'm currently giving SUSE KDE another go now that I got my mouse to stay connected in Gnome. I haven't gotten Windows Domain integration working yet.

This is a good post on using the Yast package manager and some repositories to add to it.