Another Mac annoyance is jumping word to word in a terminal window. There are several forum posts about this, but I managed to get them wrong, so I'm adding another that works for me:
Open Terminal > Preferences > Settings > Keyboard.
Click the + and set values as below.
The trick is to get the textbox to take the correct value. To do this, get it in the clipboard and paste it so it looks like this.
For your ease, you can copy these values for left: \033b and right \033f.
November 19, 2010
Command-K to Search
I've been re-acclimating to working on a Mac. There are a few differences that annoy me, one of which is hitting Command-K to get to the search box in Safari. This is standard on Firefox and Chrome.
As usual on a Mac there is a solution, but it may take a bit to find the right incantation to get it working.
Open System preferences and select "Keyboard" then "Keyboard Shortcuts".
On the left select "Application Shortcuts" and click the +.
Select "Safari" for application and enter "Google Search..." for the menu title.
Enter Command-K in the shortcut box and you are all set.
As usual on a Mac there is a solution, but it may take a bit to find the right incantation to get it working.
Open System preferences and select "Keyboard" then "Keyboard Shortcuts".
On the left select "Application Shortcuts" and click the +.
Select "Safari" for application and enter "Google Search..." for the menu title.
Enter Command-K in the shortcut box and you are all set.
February 26, 2009
Ubuntu Java Locking errors in GWT
When doing GWT development on Ubuntu 8.10 I get the following errors:
I found a fix in this post
namely:
Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0x889037c7]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0x88903891]
#2 /usr/lib/libX11.so.6(_XReply+0x254) [0x86f02494]
#3 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so [0x88051dce]
#4 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so [0x8803bd77]
#5 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so [0x8803bef3]
#6 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x26) [0x8803c136]
#7 [0xb148b008]
#8 [0xb1484b6b]
#9 [0xb1484b6b]
#10 [0xb1482236]
#11 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb7717eec]
#12 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb78e7ae8]
#13 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb7717d1f]
#14 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so(JVM_DoPrivileged+0x32d) [0xb777582d]
#15 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb742130d]
#16 [0xb148a898]
#17 [0xb1484a94]
#18 [0xb1482236]
#19 /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/server/libjvm.so [0xb7717eec]
I found a fix in this post
namely:
sudo vi /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/xawt/libmawt.so
:%s/XINERAMA/FAKEEXTN/g
April 16, 2008
Setting up Ubuntu 8.04 for Java Development
At work, I've been getting frustrated with how poorly Windows XP performs for Java development.
At my last work I got on a pilot program to us a Mac, and the compile time for the entire project went from 20 minutes for a clean build to 2 minutes, yes that's correct, 10 times faster. Why? I think there are a handful of reasons, first I have noticed that compiling Java programs is fairly IO intensive. NTFS seems to be a rather inefficient file system (the native file system for XP). Also if you use XP you need to use virus protection to keep from getting infected by every 10th bit on the internet (OK, that is a bit of an exaggeration), and most paranoid IT departments want real time scanning. This sounds good at a theoretical level, but funneling all your OS's disk access through a single software process is a pretty solid recipe for poor performance (the above timing improvement was with virus scanning disabled). During build times, the processor was not at 100% or even 50% most the time, it was the hard disk that was over-taxed.
So at my new job, I wanted to get as close to the Mac as I could without having to convince them to spend money. The solution: Linux. There are lots of choices for a distribution, the top contenders in my list are Fedora (closest to what our production systems run), OpenSuse (pretty user friendly and supported mainstream) and Ubuntu. I prefer Ubuntu because it just works without a lot of fuss and the forums are pretty active with answers to most of what I want to accomplish.
Here is my setup:
At my last work I got on a pilot program to us a Mac, and the compile time for the entire project went from 20 minutes for a clean build to 2 minutes, yes that's correct, 10 times faster. Why? I think there are a handful of reasons, first I have noticed that compiling Java programs is fairly IO intensive. NTFS seems to be a rather inefficient file system (the native file system for XP). Also if you use XP you need to use virus protection to keep from getting infected by every 10th bit on the internet (OK, that is a bit of an exaggeration), and most paranoid IT departments want real time scanning. This sounds good at a theoretical level, but funneling all your OS's disk access through a single software process is a pretty solid recipe for poor performance (the above timing improvement was with virus scanning disabled). During build times, the processor was not at 100% or even 50% most the time, it was the hard disk that was over-taxed.
So at my new job, I wanted to get as close to the Mac as I could without having to convince them to spend money. The solution: Linux. There are lots of choices for a distribution, the top contenders in my list are Fedora (closest to what our production systems run), OpenSuse (pretty user friendly and supported mainstream) and Ubuntu. I prefer Ubuntu because it just works without a lot of fuss and the forums are pretty active with answers to most of what I want to accomplish.
Here is my setup:
- 64-bit OS so I can use full 4GB memory and video drivers work well (running ati 32bit drivers on 32bit OS on 64bit hardware doesn't work too well)
- Oracle 10gR2, this can be a pain to setup and I almost gave up but I found this blog and this forum that gets it working. (Note that you also need to get
sudo apt-get install gcc-multilib g++-multilib) - MySQL (yes I need two databases)
sudo apt-get install mysql-server - Cisco VPN client (network-manager-vpnc)
- ant, maven
- kdiff3 for code read comparisons
- svn-workbench, subversion for source control
- Oracle SQL Tools
- DBVisualizer (commercial)
- SqlDeveloper (free from Oracle)
- archiva to proxy maven repos for performance
- ArgoUML for design
- Java IDE: Eclipse, Netbeans or IntelliJ. I use IntelliJ
February 23, 2007
xorg.conf settings for NEC P1250+ Monitor
I seem to always be looking for these settings so I'm putting them here:
These settings were found here.
# NEC P1250 +
Section "Monitor"
DisplaySize 384 288 # mm
Identifier "Monitor0"
VendorName "NEC"
ModelName "P1250 +"
HorizSync 31-110 # DDC-probed
VertRefresh 55-160 # DDC-probed
Option "DPMS" "true"
Option "BackingStore" "On"
EndSection
These settings were found here.
February 20, 2007
Creating an Mylar Connector Plugin for Jotspot
Creating an Mylar Connector Plugin for Jotspot
Jotspot is a wiki system that allows you to create forms and code for your wiki pages. My current project uses it for project planning and story (agile) management. It was recently purchased by Google and during their migration to Google's infrastructure new accounts are on hold, but should eventually be opened up. This is how I created a connector for our project hosted there. The intent is to give an overview of what needs to be implemented and where. I won't go through all the detail for each step, for example when it is time to query the repository for tasks I'll show what needs to happen upto and including the method call, but I won't show the details of the connection to Jotspot. Hopefully this will enable you to create your own connectors to your repositories.
Plugin Structure
The Mylar documentation suggests creating two plugin projects to implement your repository connector, the *.ui project and the *.core project. They also recommend modeling your connector after the Trac connector. For this connector I created the following two plugin projects and included the Trac plugin projects for reference:Add Repository
The first step is to get the Mylar UI to recognize your repository when you select add repository. This shows up in the Task Repositories view:Click the add repository icon. This launches this dialog box:
You can see the Jot Repository Item added by this project. The com.eclipse.mylar.jot.ui plugin will contribute all the extensions and reference com.eclipse.mylar.jot.core as needed. First we need to do some initial setup. When you created the *.ui plugin it should have opened the plugin manifest editor. Fill in some appropriate values.
The next step is to add the dependencies, using the Trac UI plugin as a reference:
The org.eclipse.mylar.jot.core will only be available after you've created that project. This should cover the classes referenced from the UI. Now onto the functional part, adding the extension that will list Jot as a repository in the Add Repository wizard. click the Add button and select org.eclipse.mylar.tasks.ui.repositories.
Now add a new connectorCore to that repository connector:
Edit the Details as follows:
The JotRepositoryConnector is a new class in the *.core project. You can click on the class hyperlink to create this class and extend org.eclipse.mylar.tasks.core.AbstractRepositoryConnector. Implement the getLabel() and getRepositoryType() to return "Jot Repository" and "jot" respectively. We now have Jot showing up in the Add Repository wizard.
Unfortunately nothing happens when you click next. To get this to work a JotRepositoryUi class must be added. Right click on the *.repositories extension and click new -> connectorUi. Click the class hyperlink and create a new JotConnectorUi class that extends org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi. Setting the icons here will add the icon to the Add Repository wizard.
When the next button is clicked the JotRepositoryConnector.getRepositoryType() is called checked against the same call on JotConnectorUi. This associates the to classes, if they match the icons are used and when next is clicked in the wizard the JotConnectorUi.getSettingsPage() is called as the next step in the repository setup. To show the settings page getSettingsPage() must return something that extends org.eclipse.mylar.tasks.ui.wizards.AbstractRepositorySettingsPage. Create a new class called JotRepositorySettingsPage that extends AbstractRepositorySettingsPage. You'll need a constructor that takes AbstractRepositoryConnectorUi as a parameter. In this constructor pass along the AbstractRepositoryConnectorUi with a title and description string to super. The only method you need to implement to get things working is to implement the isValidUrl() method. Once this is done you can successfully add the repository:
List Tasks
For this repository to really be useful, it needs to be able to query for a list of tasks, create a new task and update an existing task. When New Repository Task is clicked, each repository (AbstractRepositoryConnector) has its canCreateNewTask() method called if it returns true it is listed in the available repositories. When Next is clicked JotRepositoryUi.getNewTaskWizard() is called. This method must return a valid wizard with at least one WizardPage added in the Wizard.addPages(). That WizardPage must add at least one control in its
(In Progress)
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.
You can repeat this process for other schemas and use a diff tool like beyond compare to find the differences.
- 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.
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 =
{ 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.
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.
<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').
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.
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
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:
I got most of my info by plowing through this thread.
- 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"
- sudo vi /etc/default/bluez-utils
- 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:
- Java Posse: http://feeds.feedburner.com/javaposse
- Entrepreneurial Thought Leaders: http://www.stanford.edu/group/edcorner/uploads/podcast/EducatorsCorner.xml
- Linux Reality: http://feeds.feedburner.com/linuxreality
- Linux News Log: http://linux.quicksurf.com/?feed=rss2&cat=78
- Linux - powered by PodTech:http://www.podtech.net/?cat=94&feed=rss2
- InfoTalk - powered by PodTech: http://www.podtech.net/?cat=46&feed=rss2
- LQ Podcast: http://radio.linuxquestions.org/syndicate/lq.php
- Nature Podcast: http://www.nature.com/nature/podcast/rss/nature.xml
- NPR Technology: http://www.npr.org/rss/podcast.php?id=1019
- PRI's The World: Technology: http://www.theworld.org/rss/tech.xml
- Slashdot Review: http://slashdotreview.com/wp-rss2.php
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.
Subscribe to:
Posts (Atom)

