In a Jetty+Facelets+ICEFaces+EclipseLinkJPA environment, there's no standard and easy way to manage EntityManager lifecycle without having to create/destroy it in every method communicating with database. That's not very convenient.
Google search on this problem didn't found much, altough it found this link: http://javanotepad.blogspot.com/2007/08/managing-jpa-entitymanager-lifecycle.html.
Based on that idea I implemented similar servlet context listener, but bound EntityManager to ServletRequest instead of binding it to a thread. This approach could work in Servlet/JSP-only (perhaps JSF too), but with ICEFaces it didn't work (the original approach, entitymanager per thread, most likely wouldn't work too) becouse of ICEFaces request processing specifics (ServletRequestListener didn't got notified for every "request", the same ServletRequest was used for several "requests", etc.). To solve this, I wrote JSF phase listener, which injects EntityManager as request attribute for every JSF request and cleans it up after request processing.
So here is resulting code (sources are in the same .jar):
Link: http://www.aneas.org/knowledge/asus_f3jp_fan_control.php
Here's another linux customization. It makes my Asus F5SL laptop much quieter with Debian. Before that the fan was almost always on and its noice was very irritating.
The main source comes from this site: http://www.aneas.org/knowledge/asus_f3jp_fan_control.php.
I just wrote the Debian init.d script to run it as a daemon. To make it work, just:
1. compile fan.c file to 'fan' executable (using command gcc fan.c -o fan)
2. copy 'fan' to /usr/local/bin.
3. Also copy asus-fan-check.sh to /usr/local/bin.
4. Then copy asus-fan.sh to /etc/init.d.
5. Also you may need to make these scripts executable:
chmod +x /usr/local/bin/asus-fan-check.sh
chmod +x /usr/local/bin/asus-fan.sh
6. Now execute
update-rc.d asus-fan.sh defaults
to start it automatically on boot.
7. Done. It can be started immediately using command
/etc/init.d/asus-fan.sh start
Exact fan speeds depending on temperature can be adjusted in the file /usr/local/bin/asus-fan-check.sh.
Note: Most commands should be run as root user.
Warning: it can be dangerous to alter the default functionality of laptop cooling and your laptop may overheat. So be warned...
I've got yet another USB device that has problems with Linux ![]()
It's Gembird USB2.0 card reader (vendor/product ids - 058f:6362).
Turned out it doesn't work with EHCI usb driver (that is needed for USB2.0 devices to run at full speed), while with older OHCI (USB1.1) driver it is correctly detected and working.
Looks like there are more picky USB2.0 devices that "don't like linux" for some reason and operates only in USB1.1 mode at lower speed.
But luckily from linux 2.6.21 EHCI driver has a possibility to dynamically pass some devices to the older OHCI/UHCI driver. It is controlled by new file in the sysfs filesystem.
To automate this I wrote the simple script to be used in conjunction with udev rules. All it does is forces the device to use the USB1.1 mode on insertion and restore USB port mode on device removal.
Script to force OHCI (USB1.1) mode for USB device
Udev rules to call force_ohci.sh on device insertion/removal
Since for some other reasons I'm still using 2.6.18 kernel, I adjusted the kernel patch that adds forcing USB1.1 mode functionality for 2.6.18 - it is here
Link: http://evgetme.sourceforge.net/
This weekend I've found some time to work on evGetMe and released new version 0.4.0.
Most important change is that it is no longer limited to Siemens phones.
Link: http://evgetme.sourceforge.net/minipool.html

Recently I've put my j2me multiplayer pool game engine to the net. It was written by me few years ago as a labor for the university. It lacks actual game logic, but allows for several players to roll the balls using internet or binary sms's. It has no specific requirements, and should run on almost every j2me phone.
By the way, it was developed on siemens m50