October 12, 2009
DB2 install and config tutorial
Thanks to bits.of.info for this tutorial on db2 install and config. Way better than trying to follow IBM's docs.
October 08, 2009
In Ubuntu, sh is dash, not bash
I've been trying to install IBM Websphere Application Server 6.1 on Ubuntu 9.04 AMD64. The installer kept failing. I found this post that clued me in that in Ubuntu /bin/sh is a symbolic link to /bin/dash (a faster, smaller shell apparently). The association of sh can be changed from dash to bash as follows:
Should you desire, you can switch back to dash. Just run the above commands substituting 'dash' for 'bash' in the second one.
Here is more information on the sh-as-dash 'feature' of Ubuntu.
unlink /bin/sh
ln -s /bin/sh bashafter doing this the installer worked just fine.
Should you desire, you can switch back to dash. Just run the above commands substituting 'dash' for 'bash' in the second one.
Here is more information on the sh-as-dash 'feature' of Ubuntu.
September 24, 2009
Aptitude (Command-line package manager)
Here are some commands to use (usually with sudo):
aptitude update -- update the package repo
aptitude safe-upgrade
aptitude full-upgrade
aptitude search 'part of package name'
aptitude show package-name
aptitude install package-name
aptitude update -- update the package repo
aptitude safe-upgrade
aptitude full-upgrade
aptitude search 'part of package name'
aptitude show package-name
aptitude install package-name
Switching Linux Consoles
Turns out linux has several consoles going at once. From within my Gnome session I can press Ctrl-Alt-F1 and bring up console one. Gnome is running on console 7 so Ctrl-Alt-F7 brings me back into Gnome. Ctrl-Alt-F1 through Crtl-Alt-F7 work. Notice that Crtl-Alt-F1 takes you to TTY1 and Ctrl-Alt-F6 to TTY6. Having a full terminal to run from is handy when the session on TTY7 (Gnome) gets messed up some how.
Ctrl-Alt-F8 brings up some text, maybe system messages or something but it doesn't look like a command line I can do something with.
A little research suggest nothing runs on Terminals 8-12 initially.
Ctrl-Alt-F8 brings up some text, maybe system messages or something but it doesn't look like a command line I can do something with.
A little research suggest nothing runs on Terminals 8-12 initially.
Adding key to apt so ppa packages can be authenticated
I use a program called KeePass on Windows to manage passwords. There is a project called KeePassX for Linux that will use the same password database file I use on windows. To install it on Ubuntu 9.04 AMD-64, I did the following:
Add the source to Ubuntu (System > Administration > Software Sources)deb http://ppa.launchpad.net/keepassx/ppa/ubuntu jaunty mainAdd the project signing key to apt:
deb-src http://ppa.launchpad.net/keepassx/ppa/ubuntu jaunty main
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 095F1873
The signing key from launchpad was 1024R/095F1873 (note the part after the slash is used in the apt-key command.
The ppa page from which I got this information:
https://launchpad.net/~keepassx/+archive/ppa?field.series_filter=jaunty
Adding key to apt so ppa packages can be authenticated
When you add Third-Party Software Sources to Ubuntu, you will likely want to add those sources' shared keys to the apt so that when you update your packages a warning stating that some packages cannot be authenticated can be avoided. I get tired of it coming up. So, In my case I added
Then I added the corresponding key to apt with this command:
deb http://ppa.launchpad.net/keepassx/ppa/ubuntu jaunty mainas sources.
deb-src http://ppa.launchpad.net/keepassx/ppa/ubuntu jaunty main
Then I added the corresponding key to apt with this command:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 095F1873095F1873 is part of the PPA's PGP signing key (1024R/095F1873)
September 04, 2009
Trapped in Terminal Server Client Full Screen
The Terminal Server Client (tsClient) that I use with Ubuntu (9.04) works quite well. But if you don't know how to escape full screen mode, it can be frustrating.
The key sequence Ctrl-Alt-Enter toggles full screen.
The key sequence Ctrl-Alt-Enter toggles full screen.
September 02, 2009
Killing processes in linux
I have a laptop running Ubuntu 9.04. Recently Lotus Notes was installed on it. Notes seems to become unstable some times. The instability is so bad that I can't close the program in the normal way (mouse-click the 'x' button in the upper right corner. I would have to run
ps ax | grep notes
to get the process id and then run
sudo kill -9*procId*
to kill it.
Tyler, a coworker, pointed out to me that I could add 'Force Quit' to the panel at the top. When you press that you can just click on a misbehaving window to kill it.
ps ax | grep notes
to get the process id and then run
sudo kill -9
to kill it.
Tyler, a coworker, pointed out to me that I could add 'Force Quit' to the panel at the top. When you press that you can just click on a misbehaving window to kill it.
August 25, 2009
Java HashSet can "lose" objects
If the hash of an Object changes, the Object is 'lost' in a HashSet.
I have some code that invoked HashSet.remove(Object) and the object was NOT removed. Turned out that after the object was added to the set, a field that is involved in computing the HashSet was changed. Then, because the hash of the object changed, the remove method didn't remove the object. I tested in Sun Java 1.6.0_13 and in on IBM jdk 1.5. I found this blog post about the subject that contains a good explanation.
I don't think this limitation is sufficiently documented Java's HashSet.
Thanks to Boris Kirzner
http://boriskirzner.wordpress.com/2006/10/01/hashsetcontains-does-your-busket-contain-something/
I have some code that invoked HashSet.remove(Object) and the object was NOT removed. Turned out that after the object was added to the set, a field that is involved in computing the HashSet was changed. Then, because the hash of the object changed, the remove method didn't remove the object. I tested in Sun Java 1.6.0_13 and in on IBM jdk 1.5. I found this blog post about the subject that contains a good explanation.
I don't think this limitation is sufficiently documented Java's HashSet.
Thanks to Boris Kirzner
http://boriskirzner.wordpress.com/2006/10/01/hashsetcontains-does-your-busket-contain-something/
May 21, 2009
Internet Explorer Collection (Multiple Versions of Internet Explorer Installed on MS Windows)
I have just come across this package that can install many/all compatible Internet Explorer versions in your windows environment. Take a look.
April 24, 2009
Derby
Thanks to Bruce Phillips for this post on using the derby server that comes with MyEclipse.
Especially the part about adding an attrib to the connect string to create a new schema. (jdbc:derby://localhost:1527/phillipsDB;create=true)
http://www.brucephillips.name/blog/index.cfm/2009/2/28/Using-the-MyEclipse-Derby-Database-Server
Especially the part about adding an attrib to the connect string to create a new schema. (jdbc:derby://localhost:1527/phillipsDB;create=true)
http://www.brucephillips.name/blog/index.cfm/2009/2/28/Using-the-MyEclipse-Derby-Database-Server
April 10, 2009
MercurialEclipse
Installing MercurialEclipse plugin I've run into the problem that the plugin would say something like 'error when verifying mercurial install...'
Well. I installed the mercurial 1.2.1 windows binary package from here: , set HG environment variable to the path to the hg executable. the hg install directory was added to the PATH. Now the pluggin seems to work well.
Well. I installed the mercurial 1.2.1 windows binary package from here: , set HG environment variable to the path to the hg executable. the hg install directory was added to the PATH. Now the pluggin seems to work well.
March 12, 2009
Atheros Wireless in Ubuntu 8.10 Intrepid Ibex
Thanks for this blog entry
http://unsharptech.com/2008/10/31/atheros-wireless-in-ubuntu-810-intrepid-ibex/
With my Toshiba L355D-S7825 laptop I have to install a backports package
The package is linux-backports-modules-intrepid-generic
http://unsharptech.com/2008/10/31/atheros-wireless-in-ubuntu-810-intrepid-ibex/
With my Toshiba L355D-S7825 laptop I have to install a backports package
The package is linux-backports-modules-intrepid-generic
sudo apt-get install linux-backports-modules-intrepid-genericFebruary 26, 2009
Could not install cygwin on MS Windows Vista 32-bit
I just did a fresh install of windows on a fairly new laptop. The factory install was corrupt in some way. Windows explorer would crash all the time. It was annoying. So I wiped the harddrive and restored with Toshiba's handy-dandy windows-recovery-and-bloatware-restoration cd.
Any windows machine I use regularly has cygwin installed. I need my linux/unux-like tools. Cause I'd loose my geek card if I didn't unzip files using command line tools.
Something happened during the installation. It froze and never progressed. I've installed cygwin a bunch of times, so I'm confident this was not a case of impatience. I killed the install. Later I started another install. This would fail with a message to the effect that cygwin install failed to start because cygintl-3.dll couldn't be found. This caused bash.exe to hang. Tried a couple more times. Same result.
I decided that there might be something wrong in the cygwin-packages directory. When you run the installer it asks for a package dir and an install dir. So, I deleted the package dir.
The next run of the installer was completely successful.
Any windows machine I use regularly has cygwin installed. I need my linux/unux-like tools. Cause I'd loose my geek card if I didn't unzip files using command line tools.
Something happened during the installation. It froze and never progressed. I've installed cygwin a bunch of times, so I'm confident this was not a case of impatience. I killed the install. Later I started another install. This would fail with a message to the effect that cygwin install failed to start because cygintl-3.dll couldn't be found. This caused bash.exe to hang. Tried a couple more times. Same result.
I decided that there might be something wrong in the cygwin-packages directory. When you run the installer it asks for a package dir and an install dir. So, I deleted the package dir.
The next run of the installer was completely successful.
January 31, 2009
I messed up my install of Juice podcatcher
Long explanation (If you want the skinny, just look at the summary below)
Update, 2/1: the fix was not completely successful. See the update at the end.
This isn't really a software engineering topic. But, hey! It's my blog. Someone might really need this information!
So I wanted to try the Juice open source podcast receiver (some people call them podcatchers). As of my writing this article, the current version is 2.2. I installed it, started it, opened up the preferences and saved them with a wrong path to the directory where my podcasts should be saved. I think the problem is that by default the path was wrong for Vista. It was "C:\Users\\My Documents\My Received Podcasts"
But it should have been "C:\Users\\Documents\My Received Podcasts".
After I saved the preferences with the invalid path, Juice would crash every time I tried to start it. The following is from the log and shows the error that was crashing Juice.
I tried to reinstall the application. I uninstalled and reinstalled. No improvement. Juice still crashed on startup. I opened up the readme file in the Juice install directory. It has a section about updated from an older version of Juice (formerly iPodder). This is a quote from the Juice 2.2 readme file:
\AppData\Roaming\iPodder".
"I'll just remove the settings folder and Juice will start up normally, right?" I thought. So I deleted the iPodder directory under my user profile. I started up Juice and voila! There was no change. Juice still crashed with the same message! How infuriating! (I should stop the gratuitous use of exclamation points!)
Just when I was about to give up, I thought, "Maybe if I reinstall right now, the problem will go away." ... And that worked.
Summary
The problem:
Because I set an invalid path-to-save-my-podcasts-to in the Juice preferences, the application wouldn't start. Rather it would crash on startup.
The error log:
I removed the iPodder config directory under my user profile ("C:\Users\\AppData\Roaming\iPodder"). I then ran the Juice 2.2 installer again. I started the app and this time set the right directory for saving podcasts!
Update: The fix wasn't successful (2/1/2009)
After a restart, the problem in this post returned. For now I've carefully reproduced the issue, entered a bug with the project and included logs, config files and such. I've uninstalled Juice for now. I think I will look for another free podcatcher program.
Update, 2/1: the fix was not completely successful. See the update at the end.
This isn't really a software engineering topic. But, hey! It's my blog. Someone might really need this information!
So I wanted to try the Juice open source podcast receiver (some people call them podcatchers). As of my writing this article, the current version is 2.2. I installed it, started it, opened up the preferences and saved them with a wrong path to the directory where my podcasts should be saved. I think the problem is that by default the path was wrong for Vista. It was "C:\Users\
But it should have been "C:\Users\
After I saved the preferences with the invalid path, Juice would crash every time I tried to start it. The following is from the log and shows the error that was crashing Juice.
Traceback (most recent call last):I tried to find a solution by googling the error. It didn't yield anything. Several people had posted questions on many sites about similar problems. No solutions were published.
File "gui.py", line 4, in ?
File "iPodderGui.pyc", line 3573, in main
File "ipodder\configuration.pyc", line 468, in __init__
File "os.pyc", line 154, in makedirs
OSError: [Errno 17] File exists: 'C:\\Users\\Ari Zelanko\\My Documents\\My Received Podcasts'
I tried to reinstall the application. I uninstalled and reinstalled. No improvement. Juice still crashed on startup. I opened up the readme file in the Juice install directory. It has a section about updated from an older version of Juice (formerly iPodder). This is a quote from the Juice 2.2 readme file:
In iPodder 1.0 the settings were stored in the iPodder installation directory, probably C:\Program Files\iPodder. Starting with version 1.1 the configuration are placed outside the installation directory, in a user-specific directory, if possible. The default location is the NT-style Application directory, usually C:\Documents and Settings\yourname\Application Data\iPodder. If your settings were lost, try locating these three files in the previous installation directory and copying them to the new configuration directory: favorites.txt, history.txt, schedule.txt.So, I started to look around my user directory for the settings. I found them. On Vista the path to the configuration was "C:\Users\
"I'll just remove the settings folder and Juice will start up normally, right?" I thought. So I deleted the iPodder directory under my user profile. I started up Juice and voila! There was no change. Juice still crashed with the same message! How infuriating! (I should stop the gratuitous use of exclamation points!)
Just when I was about to give up, I thought, "Maybe if I reinstall right now, the problem will go away." ... And that worked.
Summary
The problem:
Because I set an invalid path-to-save-my-podcasts-to in the Juice preferences, the application wouldn't start. Rather it would crash on startup.
The error log:
Traceback (most recent call last):The Solution:
File "gui.py", line 4, in ?
File "iPodderGui.pyc", line 3573, in main
File "ipodder\configuration.pyc", line 468, in __init__
File "os.pyc", line 154, in makedirs
OSError: [Errno 17] File exists: 'C:\\Users\\Ari Zelanko\\My Documents\\My Received Podcasts'
I removed the iPodder config directory under my user profile ("C:\Users\
Update: The fix wasn't successful (2/1/2009)
After a restart, the problem in this post returned. For now I've carefully reproduced the issue, entered a bug with the project and included logs, config files and such. I've uninstalled Juice for now. I think I will look for another free podcatcher program.
January 27, 2009
Java Resources
Thanks to theServerSide for this great article by Ted Neward.
It contains a lot of resources for an up-and-coming java dev.
It contains a lot of resources for an up-and-coming java dev.
January 16, 2009
Install Ruby from binaries on Windows
Suppose you want to install ruby on Microsoft Windows and you don't want to use the One-click installer. Maybe it's because the installer is for ruby 1.8.6 and the newest stable binaries are for 1.8.7. You just have to get the most up-to-date binaries, because obviously 1.8.6 is just way too old.
I looked around for instuctions and found the answer posted by Lolindrath at stackoverflow.com.
I looked around for instuctions and found the answer posted by Lolindrath at stackoverflow.com.
- Download the windows binaries for Ruby 1.8.7 here: http://www.ruby-lang.org/en/downloads/ extract that to wherever you would like, I use c:\ruby. Then put c:\ruby\bin in your PATH environment variable.
- Download the zlib package: http://www.zlib.net/zlib123-dll.zip and extract the zlib1.dll, rename it to zlib.dll and move it into your Windows\System32.
- Download the iconv package: http://sourceforge.net/project/showfiles.php?group_id=25167&package_id=51458. Find and extract the iconv.dll into your Windows\System32.
- Download the rubygems package and follow the instructions, basically extracting the package and running ruby
setup.rb - Verify that everything works properly by trying a
gem install rails, once that installs then do:rails test_project
January 14, 2009
That file isn't open!
I sometimes need to do something like delete a file and I can't because, according to windows, a program has the file open. Sometimes this happens because a process doesn't exit when you think it has.
Do you want to find out what program has a file open?
You can do it with a free program called ProcessExplorer.
In the program's Find menu choose 'Find Handle or DLL...' (Or press ctrl-F)
Enter a part of the file's name. Press enter. Voila! You now have a listing that includes the process id that has that file open. If you kill the process, you should have no trouble deleting that pesky file.
If you are not sure what killing a process is or if you should, then just restart the computer and that should fix the problem.
Do you want to find out what program has a file open?
You can do it with a free program called ProcessExplorer.
In the program's Find menu choose 'Find Handle or DLL...' (Or press ctrl-F)
Enter a part of the file's name. Press enter. Voila! You now have a listing that includes the process id that has that file open. If you kill the process, you should have no trouble deleting that pesky file.
If you are not sure what killing a process is or if you should, then just restart the computer and that should fix the problem.
December 24, 2008
Updating RubyGems broke the gem command
On a windows box where I have ruby installed at "C:\Program Files\ruby\" rather than "C:\ruby\".
I ran:
gem update --system
The result was that the next time I tried to execute the gem command I got the following:
C:\>gem
The filename, directory name, or volume label syntax is incorrect.
I found that the gem.bat file had been changed and there was an extra double-quote on two lines.
@"ruby.exe"" "c:/Program Files/ruby/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
And
@"ruby.exe"" "%~dpn0" %*
In both these cases, where there were two juxtaposed double-quotes (two double-quotes in a row), I had to remove one of the double quotes. Yielding:
@"ruby.exe" "c:/Program Files/ruby/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
And
@"ruby.exe" "%~dpn0" %*
Problem was solved. I found a comment on the RubyGems forum that agreed with my fix.
I ran:
gem update --system
The result was that the next time I tried to execute the gem command I got the following:
C:\>gem
The filename, directory name, or volume label syntax is incorrect.
I found that the gem.bat file had been changed and there was an extra double-quote on two lines.
@"ruby.exe"" "c:/Program Files/ruby/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
And
@"ruby.exe"" "%~dpn0" %*
In both these cases, where there were two juxtaposed double-quotes (two double-quotes in a row), I had to remove one of the double quotes. Yielding:
@"ruby.exe" "c:/Program Files/ruby/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
And
@"ruby.exe" "%~dpn0" %*
Problem was solved. I found a comment on the RubyGems forum that agreed with my fix.
December 09, 2008
Using patches to manage bug change-sets
I have just discovered that you can manage sets of changes in Eclipse by using patches.
In the Package Explorer, select Team | Create Patch...
Follow wizard to export the patch file to the clipboard, the filesystem or the workspace.
You can then Override and Update to return the workspace to a state corresponding to the CVS repository.
Later, you can Apply Patch.. from the Team submenu, select the patch file you previously exported. Voila, your changes are back.
In the Package Explorer, select Team | Create Patch...
Follow wizard to export the patch file to the clipboard, the filesystem or the workspace.You can then Override and Update to return the workspace to a state corresponding to the CVS repository.
Later, you can Apply Patch.. from the Team submenu, select the patch file you previously exported. Voila, your changes are back.
October 14, 2008
Identifying the source of a java Class
My coworker, Mike, shared this with me. You can find out what jar a class is loaded from.
Class.forName("com.foo.MyClass")
.getProtectionDomain().getCodeSource()
Class.forName("com.foo.MyClass")
.getProtectionDomain().getCodeSource()
October 13, 2008
Setting up Websphere for a remote debugger
Here are a couple of references for configuring Websphere for use with a remote debugger:
Jacoozi: Remote Debugging with Eclipse
IBM Documentation -- another method, i have not tried.
Basically:
In the websphere administration console, go to a server's configuration and set it up.
Jacoozi: Remote Debugging with Eclipse
IBM Documentation -- another method, i have not tried.
Basically:
In the websphere administration console, go to a server's configuration and set it up.
October 07, 2008
Getting DB2 Error Code information
There is a way to get DB2 error information if you have DB2 installed.
Start the DB2 Command Line Processor (CLP).
For SQLCODE -551 you type: "? sql551"
For SQLSTATE 56098: "? 56098"
Start the DB2 Command Line Processor (CLP).
For SQLCODE -551 you type: "? sql551"
For SQLSTATE 56098: "? 56098"
May 27, 2008
Bugzilla Comments are mostly plain text, so don't use HTML
Today I tried to get fancy using HTML in a bugzilla.
I wanted to do something like
<pre>
... some code ...
</pre>
for the sake of readability.
Well, I found out that doing so will just result in those tags showing up in the comment.
But bugzilla will try to create some hyperlinks for things in comments. See the Hints and Tips page of the bugzilla manual for more information.
I wanted to do something like
<pre>
... some code ...
</pre>
for the sake of readability.
Well, I found out that doing so will just result in those tags showing up in the comment.
But bugzilla will try to create some hyperlinks for things in comments. See the Hints and Tips page of the bugzilla manual for more information.
March 19, 2008
ILog JRules BOM Update is trying to remove classes that I need!
Periodically, I need to update the JRules Execution Object Model and then update entries in the Business Object Model, accordingly.
Yesterday, when I did my normal procedure for this, the Update BOM option on a BOM Entry tried to remove a bunch of classes that I needed in the BOM.
I didn't know why. So I experimented. I created a brand new BOM Entry and tried to add the classes that JRules wanted to remove from the real BOM Entry. It threw an error. I tried to add some classes that were direct dependencies of the first, and they had the same problem.
I tried to think what had changed that these classes suddenly couldn't be in the BOM. Then I remembered that we had recently changed the base class to use Log4J. Log4J isn't part of the XOM. So maybe the BOM can't use a class if it doesn't have a access to to the classes dependencies. So, I tried adding a Log4J jar to the XOM project. After doing that, the classes from the XOM that had become dependent upon Log4J stayed in the BOM. The next time I tried to update the BOM, those classes remained in the BOM.
Yesterday, when I did my normal procedure for this, the Update BOM option on a BOM Entry tried to remove a bunch of classes that I needed in the BOM.
I didn't know why. So I experimented. I created a brand new BOM Entry and tried to add the classes that JRules wanted to remove from the real BOM Entry. It threw an error. I tried to add some classes that were direct dependencies of the first, and they had the same problem.
I tried to think what had changed that these classes suddenly couldn't be in the BOM. Then I remembered that we had recently changed the base class to use Log4J. Log4J isn't part of the XOM. So maybe the BOM can't use a class if it doesn't have a access to to the classes dependencies. So, I tried adding a Log4J jar to the XOM project. After doing that, the classes from the XOM that had become dependent upon Log4J stayed in the BOM. The next time I tried to update the BOM, those classes remained in the BOM.
Subscribe to:
Posts (Atom)