e088 axeorcat
Go to content Go to navigation Go to search

Ubuntu Server Setup Edgy to Feisty

Upgrading from Edgy to Feisty went like clockwork, to use an archaic analogy.

At time of writing this gave me newer releases of a lot of important packages I use:

Feisty 7.04 released 2007/4/19
Kernel: 2.6.20-15
Libc6: 2.5-0ubuntu14
apache2: 2.2.3-3.2
mysql-server-5.0_5.0.38
postgresql-server: 8.2_8.2.3-3
php: 5.2.1-0ubuntu1
python: 2.5.1
ruby: 1.8.5-4
gnome: 2.18.1-0
sun-java: 6-00-2

Edgy 6.01 released 2006/10/26
Kernel: 2.6.17-10
libc6: 2.4
apache2: 2.0.55-4
mysql-server: 5.0_5.0.24a-9
posgresql-server: 8.1_8.1.4
php: 5.1.6
python: 2.4.3
ruby: 1.8_1.8.4-5
gnome: 2.16.1-0
sun-java: 1.5.0-08

Only slight manual intervention was requried for postgres which gives instructions during the upgrade to the console. Basically you just run pg_upgradecluster and remove pg 8.1 when it’s all looking good. To use the JDK package it can help to set JAVA_HOME to /usr/lib/jvm/java-6-sun in your profile.

PHP MDB2 Quick Guide

The basics


require_once 'MDB2.php';

// normally want just a single connection instance
$db =& MDB2::singleton('pgsql://user:pwd@server/dbname');

// for autoExecute, MDB2_AUTOQUERY, limitQuery, etc
$db->loadModule('Extended');

$db->escape( $s );

// core selects
$db->queryAll('SELECT * FROM people');
$db->queryRow('SELECT * FROM people WHERE id = 1');
$db->queryCol('SELECT name FROM people');

// using Extended module
$db->getOne()
$db->getRow()
$db->getCol()
$db->getAll()
$db->getAssoc()


// MDB2 "types" are different from PHP types 'text' => '', 'boolean' => true, 'integer' => 0, 'decimal' => 0.0, 'float' => 0.0, 'timestamp' => '1970-01-01 00:00:00', 'time' => '00:00:00', 'date' => '1970-01-01', 'clob' => '', 'blob' => '', )

Transaction blocks


if ($mdb2->supports('transactions')) { $mdb2->beginTransaction();

}
$result = $mdb2->query('DELETE people');
if (PEAR::isError($result)) {

if ($mdb2->in_transaction) { $mdb2->rollback(); // echo 'rollback'; }
} else { if ($mdb2->in_transaction) { $mdb2->commit(); // echo 'commit'; }
}

Extras


// to allow empty strings
$mdb2->setOption( 'portability', MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL
);

Alternatively, get higher level and check out symfony

Ruby performance notes

FROM mongrel users

The mysql.rb is just for development, and it sucks horribly.

If you use inject() anywhere, benchmark that usage. inject() can be
elegant as heck, but it's also often as slow as it is elegant, and it
tends to create a lot of junk objects that have to be garbage
collected. It can sometimes be phenomenally slow compared to a
solution that doesn't use it.

Do you do any string creation, aggregating from smaller pieces? Use
<< instead of +.

In hash lookups with strings, hash dups the key. If you give it a
frozen string it's faster. If you do a lot of hash lookups this can
add up.

In general, try to be aware of your frivolous object creation. Ruby
isn't terribly slow with object creation, but it's still more
expensive to use a new object than to reuse an old one, especially
when garbage collection is taken into account.

*best* off using mod_xsendfile from
apache, which lets you write the giganto data to a file and then put an
"X-Sendfile" header in the response pointing at this file. Apache will
then pick the file up as the response body and shoot it to the client
without bothering you.

First, the memory leak was because of a bug in how the GC in Ruby was collecting threads after they used a Mutex. Don't ask me why, but switching to Sync fixed it. Problem is, this also causes the leak on Win32. Still working on that problem.

explain this:
http://pastie.caboo.se/10194
vs.
http://pastie.caboo.se/10317
First one leaks, second one doesn't (with graphs even).

Zed Shaw:
1) Threads suck ass in Ruby.
2) The GC sucks even worse.
3) Combining two forms of suckage makes for ultra suckage.

Ruby templating

I want a ruby templating system that is

  • clean syntax, ideally with customizable special characters, and which ideally allows the template itself to be valid XML if i want
  • quick and dirty (i.e. no XML based parsing step required)
  • works for any type of text (i.e. no XML based parsing step required!!)
  • support for templates as files (dont want to have to supply strings in memory)
  • easy way to include other templates
  • all the basic constructs must work well (conditionals, loops etc)
  • powerful & extendable

All this you would expect if you are coming from Java or Python or Perl which have several excellent choices which tick all the boxes.

As of 25 Sep 2006 this seems to be the state of play:

erubis
More powerful and faster version of erb.

erb/eruby
Builtin to ruby distro. Insists on evaluating from a binding. eruby is marginally faster in my experience. Default ugly ASP/JSP like syntax. Has few features itself but you can craft on stuff as it uses the power of Ruby.

cs/Template :: http://cstemplate.rubyforge.org/
written in C but can’t do a simple conditional like [ if foo.length > 2 ]

PageTemplate :: http://coolnamehere.com/products/pagetemplate/
reasonable syntax, immature, unsupported, include other files? Proper object path navigation missing

Canny :: http://canny.sourceforge.net/documentation.shtml
Smarty port. Easy, file support (includes), conditionals. Unsupported.

Kwartz :: http://www.kuwata-lab.com/kwartz/
Tries to be too clever. Slow. Nesting gets complicated.

Amrita :: http://amrita.sourceforge.jp/
Tries to be too clever. Slow.

XTemplate :: http://xtemplate.sourceforge.net/
Tries to be too clever. Slow.

Conclusion

erubis seems to be the winner. Some of the other systems could be ok but have no momentum behind them.

Obfuscated Ruby

#!/usr/local/bin/ruby
puts(
  ( `svn pl -R`.scan(/\S.*'(.*)':\n((?:  .*\n)+)/)\
    .inject({}) { |h, (d, p)| h[d] = p.strip.split(/\s+/); h }\
    .select { |d, ps| ps.include? 'svn:externals' }\
    .map { |xd, ps| [xd, `svn pg svn:externals #{xd}`] }\
    .map { |xd, exts| exts.strip.split
       (/\s*\n/).map { |l| xd + '/' + l.split(/\s+/).first } }\
    .inject { |a, b| a + b }\
    .map { |d| "cd #{d} && svn up 2>&1" } \
    << 'svn up . --ignore-externals 2>&1'
  )\
  .map { |cmd| [cmd, Thread.new { `#{cmd}` }] }\
  .map { |cmd, thread| "#{cmd}\n#{thread.value}" }.join("\n")
)
From here

Podcast quotes

“I’m not going to say that you should write everything in Python or even that you can write everything in Python. There comes a point where even Java is not efficient enough. You really want your CPUs and your memory to be used extremely efficiently then languages like C and C++ are the right choice…but there are enormous amount of application areas where the cost of software development is so much higher than the cost of software deployment” Guido van Rossum

Database object or page cacheing?

I’ve found in practice (in common with a lot of other people) that database object cacheing like Hibernate’s 2nd level object and query caches are not that useful in general for my applications (it’s still too low level) and can complicate matters. I really want to cache higher level output, such as entire blocks of page content and let pages be rebuilt from the db without intervening db caches.

If your cache supports tagging, an interesting idea for web page cacheing is to work out which db objects a page depends on, and apply id tags to the cached page for those objects. When any of those db objects are updated, an interceptor can automatically expire tagged content from the page cache.

So for example, a page that depends on Article id 3445 and Message id 3938 in schema db is cached with tags [“db.Article.3445”, “db.Message.3938”].

The page builder generates the cache key and these tags, and any others such as generic labels like “content.latest” which can be used for periodic expiry of large numbers of cached articles which are tagged with that tag.

Java vs Python vs PHP vs Ruby. Best language for web programming?

Introduction

Every time I start a new large web project I am tempted to switch languages. Surely there’s something better? Faster? More fun? More robust? It seems the grass is always greener.

But then just as I am on the point of switching, there always appear good reasons not to switch. Sometimes it’s fear of the unknown, so I end up on an endless trail of late night web-surfing. Half constructed websites that promise the world’s greatest framework, appserver, or template language. I get really excited! These guys have the right idea, just what I’ve been looking for! Then I check the news section that hasn’t been updated in months or years and I sigh. A product is no use to me if there’s nobody to support it. I will find bugs in it so I just can’t take that risk.

You could say that language shouldn’t matter, and your software should be componentized and accessible over RPC or language bridges. Unfortunately those architectures have their own issues. Firstly the burden of having multiple versions of the same APIs, not to mention multiple developer skillsets.

So language really matters. Having downloaded and played with all the crap under the sun, what is the best language choice?

Disclaimer

What matters to me
The areas of assessment I have chosen to focus on are personal. They are insufficiently specified. They are not orthogonal (e.g. cacheing is much easier in a long running server) but I have still allocated separate sections of equal importance because they are equally important at a high level.

High traffic
It is often quoted that performance is a secondary consideration. For me it is not. It is primary, alongside speed of development, not below it in the order of priorities. That’s because I am not interested in “mom and pop” sites (playing around in development) but in real world, large scale deployments (e.g. 1000 hits per second). If I just wanted a simple web framework to sit on a single colo box this assessment would be very different, and would probably end with Ruby on Rails or Django.

First draft
I haven’t looked into all the areas in detail of each language yet. This is a work in progress. There are many details to my assessments that I have left out, and many gaps in my knowledge when it comes to PHP and Python production deployments (where that occurs I have given the benefit of the doubt and allocated a reasonable score, not a harsh one just because I haven’t found anything good yet).

Dynamic languages versus Java

The divide is really between Java on one side and the dynamic languages on the other. Java has great appservers that take advantage of Java’s easy stable threading. The dynamic languages currently run on lower quality VMs and have various threading issues and harder to use thread libraries.

Embedding dynamic language interpreters in Apache is the most common way of deploying these solutions. The difficulties in getting good per-machine performance are illustrated by the restrictions mentioned in the following extract (for mod_python but the same principles apply to mod_XXX)

mod_python


  • Where shared data needs to be visible to all handlers, regardless of which child process they execute in, and changes made to the data by one handler are immediately available to another, including any executing in another child process, an external data store such as a database or shared memory must be used. Global variables in normal Python modules cannot be used for this purpose.

  • Access to and modification of shared data in an external data store must be protected so as to prevent multiple threads in the same or different processes from interfering with each other. This would normally be achieved through a locking mechanism visible to all child processes.

  • A handler must be re-entrant, or simply put, be able to be called concurrently by multiple threads at the same time. Data which needs to exist for the life of the request, would need to be stored as stack base data, thread local data, or cached in the request object. Global variables within the actual handler module cannot be used for this purpose.

  • Where global data in a module local to a child process is still used, for example as a cache, access to and modification of the global data must be protected by local thread locking mechanisms.

Assessment area

Each area is scored from 1-5, apart from base language which is scored 1-10.

  • base language (e.g. ability to evaluate code from strings is great for dynamic template creation in a database and is something sorely lacking from Java)
  • setup (always more important than you give it credit for. How many environments do you need to create? Easy to upgrade in packages? Is it supported at your host?)
  • standards (best if you’re trying to hire people if the community has rallied around 1 or 2 frameworks not 10 competing ones)
  • templates (simple powerful templating language is a must)
  • server (nice to have at least the option of a long running server)
  • database drivers (is there a robust fast driver for my choice of database)
  • persistence APIs (this is a big deal)
  • cacheing (it would be nice if I could keep some stuff like config info in memory, and some other stuff like sessions in remote caches, clustering options)

Java (Score: 31)

Base language Score: 2
Unicode since day 1 makes me add another point here (unicode won’t be in PHP until PHP 6). Flexible in theory: multiple languages run on the JVM (PHP, Python etc) so technically you can dump “Java” the language but still use the JVM and write your web code in PHP or whatever (e.g. see caucho’s PHP implementation). In practice there are a lot of issues with this. In general, Java’s too low level for web work (think rigid “interface->abstract base->multiple implementation” code patterns). It just feels clunky and slow. JSP recompilation takes an age. If you go the servlet way, reloading your webapp takes even longer with a big model. Not to mention massive memory usage.

Setup Score: 2
Installing a JVM and appserver is easy enough but somehow it’s still a hassle.

Standards Score: 3
Options are few. There’s just one JSTL and JSP which is a good thing. Frameworks are mostly crap (very slow to develop in) so will ignore those.

Templates Score: 4
A few choices. Powerful and robust. JSP/JSTL well established. JSP should be nice and dynamic but ironically suffers from not being object oriented (due to the way classloader works). Easy tag creation. Alternatives are the well established Velocity or freemarker. etc

Server Score: 5
Plenty of very fast, well proven, multi-threaded app servers available.

Database Drivers Score: 5
Solid vendor approved, portable, JDBC. Scrollable result sets etc.

Persistence APIs Score: 5
Hibernate all the way.

Cacheing Score: 5
Great choice of excellent caches (ehcache etc)

Python (Score: 30)

Language Score: 8
Nice but not good for embedding due to whitespace significance.

Setup Score: 3
Easy enough to install mod_python. App servers add a layer of hassle.

Standards Score: 2
Always liked the look of Django and not much else. Too many web frameworks, templating systems and app servers, most out of date, all pretty hacky and over-stretched for developer time.

Templates Score: 3
Havent found one I like yet. Spyce makes grandiose claims for itself but at first glance this seems unjustified. It seems very lacking in features to me (check out their “core” tag library). Mind you, it’s nicer than PSP – have you seen how you end a block? That’s thanks to whitespace significance (which works ok elsewhere in Python but not in this context).

Server Score: 4
If you go the appserver route what options are there?
medusa looks cool. Webware is quite well documented at least but as an example when you run an install script to create an app space, it generates a “sessions/” folder on your filesystem (is it targetted at play development, not large production sites?). TwistedMatrix http server has a great name and should perform well (as Twisted does for general network programming) but their own docs admit the new version is not ready for primetime.

Database Score: 4
C stuff

Persistence APIs Score: 3
DB Api is reasonable but PyPersist and other OO mapping?

_Cacheing: Score: 3
Limited cacheing options.

PHP (Score: 31)

Base language Score: 8
Quite ugly but there’s no denying it gets the job done in the web arena. The single namespace is a pain at first glance but is not in practice. PHP5 copied some good bits from Java.

Setup Score: 5
mod_php or CGI mode very easy to setup. Feels lightweight. Well suported by distros.

Standards Score: 4
Frameworks are mostly crap (feature poor) so will ignore those. If Zend framework (when finished) becomes standard that will be an awesome boost. Unfortunately I dont like it much but I can live with it if it becomes well supported.

Templates Score: 4
PHP and smarty. Both quite good.

Server Score: 1
No decent appserver that I’ve found. You could try Quercus I guess.

Database Drivers Score: 4
C drivers.

Persistence APIs Score: 3
Pear DB stuff and other persistence frameworks are reasonable.

Cacheing Score: 2
Limited to memcached really.

Conclusion

There isn’t a winner. Just as I suspected. The grass is always greener.

Ubuntu Desktop setup

Install Sun’s JDK

You will need to accept the license manually so first you may need to set debconf to use an interactive confirmation method
dpkg-reconfigure debconf
If you do not do this, installation may fail with the error “sun-dlj-v1-1 license could not be presented
Next install the software
sudo aptitude install sun-java5-jdk
We’re not quite there still because default Ubuntu comes with gcj installed so you need to tell it to use Sun’s JVM as an alternative.
By default, about 80 of the executable files under /usr/bin are actually symlinks to files under /etc/alternatives which are managed by update-alternatives
sudo update-alternatives --config java
After selecting Sun’s JVM, the symlink under /etc/alternatives will change from
java -> /usr/lib/jvm/java-gcj/jre/bin/java
to
java -> /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
If you still have problems with gcj getting in the way you can remove it with apt-get remove -purge java-gcj-compat

Multimedia players/codecs

Ubuntu wiki page. (if using adept make sure you tick unsupported and proprietary software boxes, and select packages from all)

Amarok has no sound
Easily fixed by installing “xine extra plugins” (libxine-extracodecs)

totem cannot play back xvid AVIs etc
Easily fixed by installing gstreamer plugins packages.

install realplayer so I can watch BBC news ;)
dpkg -i realplayer_10.0.7-0.0_i386.deb Now it works nicely in Firefox after a restart.

Configuration

KDE hotkeys
For some reason this is under “System Settings”->“Regional and Accessibility”

_ Change KDE single click to double click_
Compulsory for selecting multiple files. Do this in mouse settings.

The default is lax security

Time and time again with products intended for server applications, the default settings are for development rather than production. This just hast to be wrong thinking - I'd expect it frin Microsoft perhaps.

_Apache_ Why would you want Apache revealing its and its modules version numbers to the worl? ServerTokens should be Prod by default, not as an option. _PHP_
;;;;;;;;;;; ; WARNING ; ;;;;;;;;;;; ; This is the default settings file for new PHP installations. ; By default, PHP installs itself with a configuration suitable for ; development purposes, and *NOT* for production purposes. ; For several security-oriented considerations that should be taken ; before going online with your site, please consult php.ini-recommended ; and http://php.net/manual/en/security.php.
If your application does not catch the exception thrown from the PDO constructor, the default action taken by the zend engine is to terminate the script and display a back trace. This back trace will likely reveal the full database connection details, including the username and password. It is your responsibility to catch this exception, either explicitly (via a catch statement) or implicitly via set_exception_handler().

Damn Java Gotchas

1. Commons BeanUtils.populate() is a very useful function but it

  • does not set public properties
  • will not call a setter method if its return type is not void

So if your class has a nicely chained setter method like


MyClass setFoo(String s) { this.foo = s; return this; }

this test will fail


map.put( "foo", "bar" );
BeanUtils.populate( myobj, map );
assertNotNull( myobj.getFoo() ); // fail!!

BeanUtils says “mmm, let’s see… I have a key ‘foo’ in my map and a ‘setFoo’ method on the class…mmm…let’s see…not sure what to do, so er, I won’t do anything at all”.

Hibernate Performance

Instead of

SELECT a ...

use

SELECT DISTINCT a INNER JOIN FETCH a.rels ...

Then each iteration over as will not hit the DB.
for( A a : as ) { for( Rel r : a.getRels() ) { ... } }

Getting Tomcat native APR to work

2006-08-04 19:56:02,750,INFO,main,,,,,,,The Apache Tomc
at Native library which allows optimal performance in production environments was not found on the jav
a.library.path: /usr/java/jdk1.5.0_05-b05/jre/lib/i386/server:/usr/java/jdk1.5.0_05-b05/jre/lib/i386:/
usr/java/jdk1.5.0_05-b05/jre/../lib/i386:/usr/X11R6/lib:/usr/java/jai-1_1_2/lib

Speed up java xml validation with DTD cacheing

To cache DTDs on the filesystem

  • download them into a specific shared directory /mydtddir and create an Oasis standard catalog.xml file in the directory which refers to each of your saved DTDs.
  • tell your SAXBuilder to use the Apache commons XML resolver.
  • Specify where the resolver should look for the catalog.xml file using either props file on the classpath called CatalogManager.properties or by setting the system property xml.catalog.files.

Hey presto, all your java apps which use the commons resolver will then use cached DTDs for massive performance gains.

The next obvious question is how/where to obtain and store the DTDs on your system. In theory under Debian you can just install a package of the DTDs you need such as for xhtml

apt-get install w3c-dtd-xhtml

and then just point your resolver at /etc/xml/catalog.

Unfortunately (as usual) the OS package is overly complicated. It relies on a large set of files distributed all over the place which delegate to each other. Apart from making resolution slower due to multiple parses/file opens. at the time of writing, the files simply seem to be broken and contain unresolvable oasis extension DTDs.

e.g. the default catalog for xhtml is /usr/share/xml/xhtml/schema/dtd/1.0/catalog.xml.
This has a doctype which refers to an unresolvable GlobalTransCorp DTD. This fails to resolve:

$ xmlcatalog /etc/xml/catalog
"-//GlobalTransCorp//DTD XML Catalogs V1.0-Based Extension V1.0//EN"
No entry for PUBLIC
-//GlobalTransCorp//DTD XML Catalogs V1.0-Based Extension V1.0//EN

Therefore I usually choose to manage my own dtds under /etc/dtds.

Quickstart python, mod_ruby & mod_perl on debian

Package installs

You need the ruby-dev package or you’ll get an error later when using gem require’: no such file to load – mkmf

  • aptitude install apache2-dev
  • aptitude install ruby1.8 ruby1.8-dev eruby
  • aptitude install python2.4-pygresql
  • aptitude install libapache2-mod-perl2
  • aptitude install libapache2-mod-ruby
  • perl -MCPAN -e “install Bundle::Apache2”
  • perl -MCPAN -e “install Apache::Template”
  • export POSTGRES_INCLUDE=...
  • export POSTGRES_LIB=...
  • tar zxf rubygems-0.9.0.tgz; ruby setup.rb;
  • export RUBYOPT=rubygems
  • gem install activerecord
  • gem install postgres

Note that “gem install postgres” did not seem to work. I had to manually

cd /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1/
ruby extconf.rb -with-pgsql-include-dir=X -with-pgsql-lib-dir=Y
make; make install

Apache setup

In mime.types


text/x-ruby  rb rbx

In httpd.conf:


AddType text/html .rbx
RubyRequire apache/ruby-run
<Files *.rbx> SetHandler ruby-object RubyHandler Apache::RubyRun.instance
</Files>
RubyRequire apache/eruby-run
<Files *.rhtml> SetHandler ruby-object RubyHandler Apache::ERubyRun.instance
</Files>
PerlRequire /www/docs/startup.pl
PerlModule ModPerl::Registry
<Location ~ ".pl$"> SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders
</Location>

Change foreground colour for gnome panel

Transparent panels are great in principle but they are not very readable in GNOME with black text.

Luckily GNOME widgets can be customized in a common way, as long as you know the right class names.

Just edit your .gtkrc-2.0 file in your home directory (create it if one does not exist) and set the colors that work for you. For example, a bright white text for inactive buttons and a blackish text for the active button is set as follow:

style "panel"
{
  fg[NORMAL]               = "#ffffff"
  fg[ACTIVE]               = "#0f0f0f"
  bg[ACTIVE]               = "#C0C0C0"
}
widget "<strong>PanelWidget</strong>" style "panel"
widget "<strong>PanelApplet</strong>" style "panel"
class "<strong>Panel</strong>" style "panel"
widget_class "<strong>Mail</strong>" style "panel"
class "<strong>notif</strong>" style "panel"
class "<strong>Notif</strong>" style "panel"
class "<strong>Tray</strong>" style "panel"
class "<strong>tray</strong>" style "panel"

Thanks to gnome support

memcached

Spent a while looking at memcached as its simplicity and cross platform nature is very appealing. It’s something you just make a socket to and dump some data into, and it just keeps it in memory. Problem is that memcached itself doesn’t do much other than that – put stuff in memory and define a protocol.

Some of the work you’d expect of a cacheing solution is left to the client implementation. Talking of which I tried out the perl and the java versions. The java client is bigger than you might think as it contains non-blocking code with quite complicated thread queues. Not sure I’d want that bloat in my application, but sensibly the default getInstance returns a blocking instance by default. The java client is not the worst code I’ve ever seen but it’s not exactly great either. There’s quite a lot of repetition, especially the code which sends each call type over the network. No big deal, I or anyone else could easily tidy it up and optimize it.

From previous experience I expect the overhead of all the non-blocking client code is actually not worth it, and that was confirmed by a (very simple) test class I wrote.

The perl test application I wrote performed better than the Java one in general. I expect this is due to some bloat in the Java client. In particular the Java client performed very poorly for large cache values, whilst the perl client scaled O(1).

For PHP, perl and so on, memcached could be useful just running on the same box as a semi persistent store for cross request data sharing, but you need to keep a very close eye on the client code, and probably write your own wrapper to implement all the other cache stuff you need in practice.

For Java, there are great cacheing solutions that run in-process of course, like ehcache, which I have had good results with (although I haven’t benchmarked them much yet), and several Java distributed cache solutions.

ubuntu gcc install authentication warning

After doing a

sudo apt-get install build-essential

I got

WARNING: The following packages cannot be authenticated! linux-kernel-headers libc6-dev cpp-4.0 cpp gcc-4.0 gcc libstdc+6-4.0-dev g+-4.0 g++ make dpkg-dev build-essential. Install these packages without verification [y/N]? y

So I installed it anyway.

Netgear DG834Gv2

I bought this combined ADSL modem and wireless 54g access point primarily because it looked nice and was quite cheap but am now regretting it. Worked ok at first, achieving some good file transfer times using windows and linux on my Tecra M5 which has an intel pro wireless 3945.

Then I started getting slowdowns. I tried turning off encryption and changing channels but nothing helped. My home is next to several offices and there are 6 wireless APs within range so thought this might just be congestion. I didn’t have this problem with my trusty old Buffalo AP though so something must be up.

I thought perhaps there was a compatibilty issue between my laptops wireless network card and the Netgear so I tried using the bundled USB dongle. The connection strength rose and file transfer times improved, but the difference was not massive and did not explain the huge random slowdowns that would occur.

I noticed that the ping times from my laptop to the Netgear were unbelievably bad – ranging wildly from a few ms to 8000ms! I moved right next to the AP and saw it settle down to 10ms, but even there it started jumping around up to 300ms and back!

I upgraded the firmware to version 3 and then…hey presto…I couldn’t even get an ADSL sync! I tried rebooting using the Netgear web console and doing several cold restarts to no avail: no internet.

I then connected to the Netgear using an ethernet cable and got a very scary result: ping times of 200ms! There was a serious hardware problem with this router. I had assumed it was a wireless problem (as wireless networks as everyone knows can be quite flakey, at least during initial tuning) but it now appeared to be much more general hardware problem inside the Netgear.

This Netgear product appears to have serious issues so I’ve ditched it. I have since read some bad reports about it in forums so mine might not be a one-off. Note that there is a newer v3 version of this product which may or may not be fixed. Personally I wouldn’t risk it.

Installing Ubuntu on a new Tecra M5 laptop

Get kubuntu linux configured on brand new Tecra M5 laptop

D500 to Sony

Trusty Samsung D500 vs Sony W810i

What's the best laptop with a trackpoint in April 2006

Laptops with tracksticks for efficient pointer control

Mysql user debian-sys-maint

There’s a mysql user called debian-sys-maint

Vertical Centering in XHTML

Use XHTML doctype and this technique to center vertically.

Playlist generation JSP

Simple JSP to generate asx, pls and m3u content.

Video/Audio Info (Standards and Formats)

Format, standards etc for mp4, H264, etc

Windows video compression tools

Windows MP4 video processing software

Linux Video: dvd::rip, mencoder, mp4

Linux gpac/x264/mp4/mpeg4ip/mplayer etc

Postgres Quick Reference

Postgres help sheet

Character Encoding in Forms & Java

Some fearsome reading on form textareas.

Ubuntu 5.1 on Tecra 9000

Smooth install of Ubuntu 5.1 on an old Tecra 9000 laptop.

Escaping & - when to use &amp?

Demo of when plain ampersands in URLs go wrong

Dont trust PHP? Use wget to mirror to static HTML

Use a mirror tool to create HTML files from a dynamic system.

Analog script from mailing list

A script found on pipermail

Tomcat JSP Strangeness

More web.xml wierdness.

Moving to apache2 and mod_jk the debian way

Moving to debian package installation of apache2 and configuring mod_jk (NOT mod_jk2!)

Wierd apt behaviour when downgrading

You need to remove a default release line from your apt conf:

APT::Default-Release “stable”;

in order to downgrade packages. Dont ask me why.

I performed successful downgrade from testing to stable for all my production servers that needed it using the pinning priority technique. Needed just a handful of manual apt-get install XXX/stable commands on top. Sweet.

Ongoing Drupal Issues

I record Drupal experiences in this post which changes over time.

Choosing a free CMS

Looking at some open source CMS software. Textpattern, Drupal, Bricolage, Mambo, Xoops, ezPublish…

hibernate, cglib etc

Found that final modifier stopped CGLIB proxies working.
Also, critical difference between s.load( Class, id ) and s.load( obj, id ) is that the former is the only one which will not hit the DB for a lazy object.

Linux PC installs: first Ubuntu release fails

Tecra 9100
Ubuntu warthog – install failed, said it couldnt proceed without floppy disk..
Tried pre-release Ubuntu hedgehog on Tecra 9100 – failed for same reason.
Fedora Core 2 installed fine

My Akasa PC
Ubuntu warthog – failed, said it couldnt detect the CDROM drive. The CDROM drive is a standard Sony CRX300a which shouldnt cause any probs.
pre-release Ubuntu hedgehog failed for same reason.
Fedora Core 2 installed fine

X - VNC

vncserver issues

misc errors

Misc error info.

Problems with CVS on vm0 and Tomcat symlinks

CVS server on vm0 kept leaving lock files around. Happened after couldnt get port 22 to vm0. There was some kind of file IO error on a particular file which was screwing everything up. Fixed by removing that file from CVS repository and readding it via cvs. The server had obviously got v confused by something low level.

Tomcat failed to follow symlinks so added the usual context resource entries. Interestingly, the allowLinking didnt work if the docBase was set to “” in the default context but was fine with a proper full path docBase in a named context.

USB Devices

If you cant delete registry keys, run as admin: C:\WINDOWS\SYSTEM32\regedt32.exe, and use the security menu. Then delete

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_067b&Pid_2501 to get USB devices recognized again.

0