SLF4J and making JUL shut up

Monday, February 15th, 2010

I’ve decided to switch to the Simple Logging Facade for Java (SLF4J) plus Logback to bridge java.util.logging (JUL), Log4J, and Apache Commons Logging all into one log output.

Problem is, JUL won’t shut up. Frameworks that log to JUL output the log to the console, and then SLF4J repeats it right after. However, putting this code in before running SLF4BridgeHandler.install() seems to fix it:

java.util.logging.Logger root_logger = java.util.logging.LogManager.getLogManager().getLogger("");

java.util.logging.Handler[] root_handlers = root_logger.getHandlers();

rootLogger.removeHandler(root_handlers[0]);

Now I get one single log output alone.

Trying to get OSX to work well in VirtualBox

Friday, February 12th, 2010

Now that VirtualBox 3.1.4 is out, I decided to try OSX. I would like to thank this thread on the VBox forums for a few hints on how to do this.

I am doing this on a Core 2 Duo. This should work on any processor that has at least SSE3.

These instructions are for people who are used to using VirtualBox.

You need:

  1. At least VirtualBox 3.1.4
  2. A Hackintosh ISO. I used iDeneb 1.6 Lite, which is based on OSX Leopard 10.5.8. Others may or may not work depending if they include the appropriate hacks.

Make a new virtual machine, set:

  1. Set it for FreeBSD
  2. With at least 1GB of memory
  3. And at least 10GB of HD space

Set the additional settings of:

  1. System->Motherboard->Enable IO APIC to on
  2. Do NOT enable EFI, it is not complete enough for OSX yet
  3. System->Processor->Processor(s) matching what you actually have
  4. System->Processor->Enable PAE/NX to on
  5. Display->Video->128MB of video memory, with 3D Acceleration enabled
  6. Storage->IDE Controller->Type set to ICH6
  7. Network->Adapter 1->Attached to Bridged Adapter, advanced->Intel PRO/1000 MT Desktop (NOT MT Server or T Server)

Exit VirtualBox, edit the XML definition for the machine. For me, and I named my machine OSX, this was under ~/.VirtualBox/Machines/OSX/OSX.xml. Add the line…

<ExtraDataItem name="VBoxInternal2/SupportExtHwProfile" value="on"/>

… inside the <ExtraData> block, and save it and restart VirtualBox.

Mount the iDeneb ISO inside your virtual machine, and start it up. Remember to press enter to start the CD on boot.

Use the disk utility to format your drive to HSF journaled. Select that drive in the installer and hit the customize button before installing.

Select the following options in the iDeneb OSx86 Components menu:

  1. Kernel->Qoopz
  2. Essential Patches->ACPI Fix
  3. Essential Patches->PS/2 Drivers->ApplePS2 Old
  4. Drivers->Chipset->ICHx Fixed

Now, just install. This takes about 20 minutes.

To get network working after boot, go into the client’s menu while running and do Devices->Network Adapters, uncheck Cable connected, hit okay, go back in, and check Cable connected. After that OSX will connect to the network, and you have to do this every time you boot.

Sound cannot be fixed at the current time: VirtualBox’s AC97 emulation supports a version of ICH AC97 too old for the popular third party AppleAC97Audio.kext to support. Hopefully VirtualBox will get a HDA emulation, which will improve chances of being emulated correctly.

2D speed seems to be pretty fast without specific drivers, although some operations will be noticeably slow. I wish there was a specific video driver for this.

Using Xfce4 on my Debian-using Powerbook, rejecting Gnome+Mono

Tuesday, December 22nd, 2009

Gnome on Debian, installed using the meta-package, pulls in Mono. You used to be able to bypass this requirement by installing gnote instead of Tomboy, but Gnome now pulls in many other Mono-using apps, of which there are better replacements.

Since I feel Mono is bloated, slow, and anti-FOSS and Debian doesn’t want to remove the Mono requirement (although, yes, I can just not use the meta-package, but that’s just broken behavior), I have decided to try alternatives.

I purged Gnome the hard way by removing libgtk2 and libglib2 and doing several rounds of deborphan --guess-all | xargs apt-get remove combined with apt-get autoremove. In the long run this removed tons of crap I never used.

Next, I installed Xfce with apt-get install xfce4 xfce4-goodies xorg desktop-base tango-icon-theme xfprint4, and also did apt-get install iceweasel pidgin gwibber network-manager-gnome vim-gtk gtk-engines to get the apps I really did want installed. I also installed Slim as a replacement for GDM.

I changed my GTK, Xfwm, and icon themes to “Clearlooks”, “Default-4.4″, and “Tango” respectively. I set The Xfce Session Manager imported my Gnome Session Manager configuration, so apps I have set to startup on session start was maintained.

I also added the app launchers I had on my Gnome panel to the Xfce panel and moved the virtual desktop chooser to the far left, set my panel to be 24 pixels tall, and enabled composting inside Xfwm.

So, after doing all that, I have to say… everything is faster. Gnome had requirements that caused several daemons to start on boot, which increased the time between bootloader and X start, and GDM takes several more times longer to start than Slim. Xfce also starts near instantly compared to Gnome, yet it has the same functionality.

If I had actually bothered to time it, I would not be surprised if I get a usable desktop in half the time I did with Gnome. Xfce is clearly a better product with a lot less bloat.

Also, memory usage wise, I can run Xfce plus X, Pidgin, and NetworkManager in under 200 megs of RAM. Gwibber uses roughly 150 (I think it might be leaking), and Firefox being open with a single tab open uses around 75. A useful Linux desktop doesn’t have to be a bloated mess.

Update: I swapped out NetworkManager for WICD. WICD in total uses less RAM and doesn’t have the hald dependency. Once Xfce’s Power Manager switches to use the new API instead of through hald, that’ll be one less thing to load on boot (it wastes time, not memory).

I need to find a good replacement for Gwibber though, it leaks like crazy. I’ve been running it almost 11 days now, and it’s using a 1gb of memory.

5 years

Saturday, November 21st, 2009

Ad Terras Per Aspera is now 5 years old, and I’m still writing for this blog.

Olympia Snowe does not represent the people of Maine

Wednesday, September 30th, 2009

Olympia Snowe has voted against the public option, she has voted against the American people, and she has proven again and again that she does not take her job seriously.

This ad from Progressive Change Campaign Committee is currently being run in Maine and DC because she should not be holding her Senate seat and she should vacate it immediately and let the people of Maine choose someone who wants to see America last another 200 years.

To be honest, I am very angry. She was elected to serve the people several times, and I can’t remember once when she has actually done this. She serves private interest groups, she votes for wars, she does everything in her power to keep the American people down.

People like her mention 9/11 over and over… but every time she votes against the American people, every time she votes for the war, every time she votes against better health care and better education and better national security through diplomacy and transparency, the terrorists win just a little more.