Tech Tips

Ubuntu Sata drive reset VT6421 bug

Upgrade time for an older storage server (really a workstation), running Ubuntu 10.04. The old workstation did not have any Sata controllers in it, so I had to install a new MASSCOOL XWT-RC018 run-of-the-mill PCI Sata controller. Popped in two brand new Samsung Spinpoing 1 TB drives (SAMSUNG Spinpoint F3 HD103SJ 1TB 7200 RPM) and started to setup Software raid-1 in Ubuntu.

Read More

Ubuntu: Fixing the “Not replacing deleted config file”.

A recent upgrade to a new Ubuntu server version, caused my dovecote server to not be happy.   Apparently in my haste, I had kept my old configuration files for Dovecot that had several features replaced or depreciated.  I tried removing the package using “apt-get remove dovecot*”, but my config files were still left behind.

Read More

TDL3 Variant Removal

Recently I worked on a client’s workstation that had a very interesting “infection”. Google internet searches would be redirected to random company websites and the Microsoft Windows Update website refused to load properly.

The client was running Avast and SpyBot (with Tea-Timer). I turned up the detection level in Avast to show exactly what was being scanned and/or retrieved from the internet. Sure enough, I spotted a variety of strange URLs being retrieved, like “rudolfdisney.com”.

Read More

Dead Simple Java Web Services and Clients

If you are like me and have seen a ton of languages out there provide web services with a few simple instructions (Perl / PHP / Python), you may have the impression that it should be pretty easy in Java? Couple of lines of code and voila a server. A few more lines and voila a client that consumes said service. Unfortunately that does not seem to be the case in my experience. WDSL setup this…wimport that (but only with JDK’s greater than 1.6_05..).

Here is a dead simple way to setup clients and services in a few steps.

Read More

Apache Cayenne – Simple Count Query

I’m currently working on a project involved with using Apache Cayenne, a pretty lightweight ORM (object relationship mapping framework). So far I have been very impressed with its ease of use over other framework such as Hibernate and the minimalistic approach it takes to the mapping. Configuration files are used at a minimum and they are extremely easy to understand.

The one thing that I have found a bit lacking, are straightforward real world examples. While, the Java documentation is fantastic and there are only a few minimal “Getting Started” pages on the main website, I really couldn’t find a good example of some more complicated logic examples.

In anycase, here is some code that hopefully will save someone else a bit of time. This is an example of how to call a “NamedQuery” in Cayenne that accepts a single parameter and returns a count of rows for a particular table. This assumes at least a basic understanding of the Cayenne system and that you have at least been through the tutorial.

Read More

Netbeans 6.7 Database Explorer Timeout Workaround

I had small issue recently in that the Netbeans 6.7 database explorer was timing out just trying to connect to my production database. Apparently the Mysql server needs to respond back within a few mili-seconds and there are no configuration settings in Netbeans to increase this timeout. Our production database has an initial lag time when you first connect, but it is pretty zippy thereafter (I suspect my cheap home based switches or my Windows computer).

Read More

Quick PHP RSS Feeds

Here is a snippet of code that I wish I had when I needed to write a small routine to output a PHP RSS feed.
RSS Feeds are XML-like so they need to be carefully crafted.

1.) Setup the main header of the rss feed. Remember to carefully escape all of your text going into string
fields using htmlentities().

Read More