February 05, 2006
Java on OpenBSD 3.8

The developers of OpenBSD do not provide binaries or simple to install packages of Java because this language contains proprietary (that is, not open source) code. The code can not be audited by the OpenBSD standards and may contain security problems. Consquently, getting this installed and working on an OpenBSD system requires building Java from sources. This is a real problem.As I looked through the documentation and got this accomplished, I found that there was no complete guide to this, for a total n00b like me. There are two how-to's I found that are close, this one which is nearly correct, and this one, which has an error or two.

I am using -current OpenBSD 3.8, downloaded from their mirrors 12/23/05. After install, you need to set up the ports tree from the CDROM sources as described in the OpenBSD FAQ on this topic. After this is done, you will find the Makefile for Java SDK 1.4.2 in the /usr/ports/devel/java/sdk/1.4/ directory.

Before attempting to compile Java 1.4.2 you need to install certain needed packages:

PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/3.8/packages/i386/
export PKG_PATH
sudo pkg_add autoconf-2.59.tgz
sudo pkg_add gettext-0.10.40p3.tgz
sudo pkg_add ghostscript-7.05p3.tgz
sudo pkg_add ghostscript-fonts-6.0.tgz
sudo pkg_add gmake-3.80p1.tgz
sudo pkg_add gtar-1.15.1p2.tgz
sudo pkg_add iodbc-2.50.3.tgz
sudo pkg_add jkd-linux-1.3.1_16.tgz
sudo pkg_add libtldl-1.5.18.tgz
sudo pkg_add libtool-1.5.18p2.tgz
sudo pkg_add nspr-4.4.1.tgz
sudo pkg_add openmotif-2.1.30.5p0.tgz
sudo pkg_add redhat_base-8.0p5.tgz
sudo pkg_add unzip-5.52.tgz
sudo pkg_add zip-2.3p0.tgz

Install as many of these from packages as possible. During the compile, if some are not present (e.g., libtldl) they will install from ports along with dependencies (e.g., libtool) which will fail due to incompatibilities. Others (openmotif, iodbc) seem to build from ports ok. One other needed file is zcrypt29.zip which is downloaded during the build.

Next, you need to go the Sun's site and get the source files. Go to http://www.sun.com/software/communitysource/j2se/java2/download.xml and register with Sun then download the Java 2 SDK 1.4.2 SCSL Source file j2sdk-1_4_2-src-scsl.zip and SCSK binary file j2sdk-1_4_2-bin-scsl.zip.

While at Sun's site, you also need to got to http://java.sun.com/products/archive/j2se/1.4.2/ and download the Java 2 SDK for 1.4.2 j2sdk-1_4_2-linux-i586.bin and then go to http://java.sun.com/products/archive/index.html to pick up the Java SDK for 1.3.1 j2sdk-1_3_1_16-linux-i586.bin. Yes, you need both 1.4.2 and 1.3.1 binaries. Also, you need version 16 of the 1.3.1 binary - the make wil choke on the latest version.

Then, go over to http://www.eyesbeyond.com/freebsddom/java/JDK14SCSLConfirm.html and get patchset 7, bsd-jdk14-patches-7.tar.gz. The makefile looks for version 7 and will not run with the latest patchset 8.

Now, put all these files into /usr/ports/distfiles (make the directory if it doesn't exist). They do not need to be expanded or installed in any way - leave them in their compressed form as downloaded.

Before you build Java, be sure you have lots of disk space. At the end of make && make install, the build files use up over 1.9GB. I created a temporary build space by copying /usr/ports/devel/jdk/1.4/ to /home/tmp/ (where there was plenty of space) and creating a symbolic link. Now cd /usr/ports/devel/jdk/1.4/. Type sudo make and, on a slow computer, come back in 5-8 hours. After the make has completed, type sudo make install.

After all this is done, the plugin is found as /usr/local/jdk-1.4.2/jrs/plugin/i386/ns610/libjavaplugin_oji.so. To install for you, mkdir ~/.mozilla/plugins and ln-s /usr/local/jdk-1.4.2/jrs/plugin/i386/ns610/libjavaplugin_oji.so ~/.mozilla/plugins or, for all users, sudo mkdir /usr/local/lib/mozilla-plugins and ln -s /usr/local/jdk-1.4.2/jrs/plugin/i386/ns610/libjavaplugin_oji.so /usr/local/lib/mozilla-plugins.
To check if the Java plugin has been installed in your Firefox or Mozilla browser, enter "about:plugins" in the URL bar and see. Now, clean up by running cd /usr/ports/devel/jdk/1.4/ and sudo make clean. You can also remove any packages used in the build, if space is an issue.

Works for me.

January 23, 2006
Old boxes running BSD

I have been recycling my older computers, as I take them out of service, by removing Windows and using Linux. Most of these boxes are Pentium 2's ranging from 233MHz to 600MHz with relatively sparse memory (64-128MB) and small HDs from 400MB to 1 GB. They are all too underpowered to run WinXP at anything but a crawl.

I was installing a variety on distros and had narrowed it down to Vector (based on Slackware) and Ubuntu. The Ubuntu desktop installation is fairly bloated but a lightweight system can be installed. Using 6.04 RC2, you can install a "server" (previously called a "custom" install in 5.10) which is a fairly minimal system, then install Xorg and Xfce or some other lightweight window manager. Although they would run fine in console/server mode, I kept having problems with boxes which used earlier iterations of the Intel i810 onboard video chipset. The desktop would not refresh, the icon in the menus didn't show up, etc. etc.

In frustration, I decided to switch these boxes to OpenBSD which went to the 3.8 release in November. I chose this because support for Atmel wireless is included in the base distro and I am using the Linksys WUSB11 v2.5 on these boxes. The conclusions are 1) installation is not as easy as Linux, 2) the syntax for BSD command gets some getting used to (if you come from a Linux background), and 3) after all that, the performance is excellent! OpenBSD appears to run faster than Linux on these underpowered boxes and is fairly easily customized.

The first problem is that many older computers cannot boot from the OpenBSD CDROM. You can boot from a floppy, but I had multiple failures with floppies made using Windows or Linux boxes. Ultimately, the solution was to make the floppy on a BSD box by first checking the floppy with the fdformat, command, copy the floppy38.fs image using dd, then checking for a correct copy as described in the link. The next stumbling block is the assignment of slices in the BSD partition, also nicely covered in the BSD FAQ's.

Once you get the install done boot to your new system, type man afterboot for some info. Getting the WUSB11 to work was fairly easy. The wireless adapter was recognized and assigned interface atu0. For some reason, it seemed that you have to first bring it down before it will accept the nwid (=ssid) information:

ifconfig atu0 down
ifconfig atu0 nwid your_ssid chan 11 mode 11b
ifconfig atu0 xxx.xxx.xxx.xxx
ifconfig atu0 up

The default gateway is set and the routing table checked:

route add default 192.168.1.xxx
route -n show

You can create a file called /etc/hostname.atu0 which contains this information so that it is loaded at boot. Other important files are the /etc/resolv.conf (like Linux) and /etc/mygate (the ip address of the default gateway). With this, the system was connected so I could download and install the nano, firefox, and bash packages. To get X working, I simply invoked startx as root and, surprisingly, even though there was no xorg.conf file, fvwm came up at 1280x1024. I then looked at /var/log/Xorg.log and found the information to put into the blanks once I ran xorgconfig. After that, edit the xinitrc so that xdm comes up at boot and you're pretty much set as simple desktop. I have stayed with fvwm so far as it's light, fast, and has almost all the functionality you need. It's a bit different from Linux but, since I use Mac OS X on my everyday computer, I think I'm sticking with it.

January 21, 2006
Broken PHP

I have this script which reads an image from a webcam, crops and resizes it, then displays it in the blog (upper right). The Jensen webcam has been down for a long time, but it recently cane back up, only now the script doesn't work. At first I thought the image feed was somehow blocked, but the curl function creates temp.jpg perfectly well. However, temp1.jpg was not being created. The pointed to a problem with the PHP command imagejpeg.

After much head scratching, I found that the function of imagejpeg has been changed in PHP 4.4.1 and later by adding safe_mode checks in image* functions and cURL. Accordingly, imagejpeg will not work until the destination jpeg file has been opened. The new script:

$imageData = CurlLoadJPEG ("http://www.evsmartin.com/wid001t.jpg");

if (!$imageData) {
$imageData = @imagecreatefromjpeg ("./error.jpg");
}

$dst_img=imagecreatetruecolor(200,150);
imagecopyresized($dst_img,$imageData,0,0,240,0,200,150,240,180);
$newjpg = @fopen("./temp1.jpg", "w");
imagejpeg($dst_img,"./temp1.jpg");
imagedestroy($dst_img);
imagedestroy($imageData);

fixes this. Yes, I know this is an ugly hack, opening temp1.jpg with a unused variable. Well, I had somewhere to go this AM.

January 14, 2006
Joe Bageant

A recommendation for a blog worth putting on your links, Joe Bageant. Here is a sample of his post What the 'Left Behind' Series Really Means:

"The best thing about the Left Behind books is the way the non-Christians get their guts pulled out by God." -- 15-year old fundamentalist fan of the Left Behind series.

That is the sophisticated language and appeal of America's all-time best selling adult novels celebrating the ethnic cleansing of non-Christians at the hands of Christ. If a Muslim were to write an Islamic version of the last book in the Left Behind series, Glorious Appearing, and publish it across the Middle East, Americans would go beserk. Yet tens of millions of Christians eagerly await and celebrate an End Time when everyone who disagrees with them will be murdered in ways that make Islamic beheading look like a bridal shower. Jesus -- who apparently has a much nastier streak than we have been led to believe -- merely speaks and "the bodies of the enemy are ripped wide open down the middle." In the book Christians have to drive carefully to avoid "hitting splayed and filleted corpses of men and women and horses" Even as the riders' tongues are melting in their mouths and they are being wide open gutted by God's own hand, the poor damned horses are getting the same treatment. Sort of a divinely inspired version of "Fuck you and the horse you rode in on."

Try Revenge of the Mutt People or The Simulacran Republic:

Americans, rich or poor, now live in a culture entirely perceived through, simulacra-media images and illusions. We live inside a self-referential media hologram of a nation that has not existed for quite some time now, especially in America's heartland. Our national reality is held together by a pale, carbon imprint of the original. The well-off with their upscale consumer aesthetic, live inside gated Disneyesque communities with gleaming uninhabited front porches representing some bucolic notion of the Great American home and family. The working class, true to its sports culture aesthetic, is a spectator to politics ... politics which are so entirely imagistic as to be holograms of a process, not a process. Social realism is a television commercial for America, a simulacran republic of eagles, church spires, brave young soldiers and heroic firefighters and "freedom of choice" within the hologram. America's citizens have been reduced to Balkanized consumer units by the corporate state's culture producing machinery.

We no longer have a country -- just the hollow shell of one, a global corporation masquerading electronically and digitally as a nation called the United States.

It even includes a quote from Timothy Leary. Lot's of good stuff here.

January 08, 2006
Obvious predictions for 2006

First, overt civil war will break out in Iraq. Second, foreign nationals, US nationals, US military support troops, and some US forces will be evacuated as the security situation becomes worse, all the while the Bush administration will be declaring victory, explaining the violence as Iraqi government (= Shia) troops "standing up" and "taking the fight" to the insurgents and terrorists (= Sunnis).

For example, consider the comments of Lt. Gen. Ricardo Sanchez, V Corps commander, to his troops as they are re-deployed to Iraq, He told the soldiers that "conditions there have changed" and "the country's on the verge of a civil war."

Of course, the admininstration immediately trots out Gen. Casey (in Washington) to state that Iraq is not on the verge of civil war. This spin and propanganda may fly with the GOP and other true believers in the Bush faith-based foreign policy, but sometimes reality intrudes.

These comments from Juan Cole are typical of the facts on the ground:

"I am an American currently working in Baghdad for a news organization. I've been here numerous times over the past 15 years.

The current security situation here has gotten much worse since the elections. We had a security briefing yesterday right after a fellow journalist was abducted. Besides the usual reminders to keep a low profile and going over our own unique security measures and procedures as to what to do in any given scenario we were told that there's a high probability of all out civil war.

Iraq has been in a low level civil war since the end of 2003 that has been increasing in intensity ever since, but now our security team is telling us that should all-out war break out most, if not all of us, may have to be evacuated to safety in a nearby country. Instead of the scores of Iraqis dying each day as do now, thousands a day could perish. Most Sunnis have given up hope of getting adequate representation in the new Iraqi government and radical elements in the Shiite parties want to exact revenge on the Sunni for supporting Saddam over the years. Shiite death squads roam the city at night (in police and army uniform no less) dragging all the male members of a Sunni family out into the street and executing them in front of their women folk. Sunni insurgents (not in uniform) do the same to Shiite families in areas claimed as theirs.

The Sunni insurgents, it seems, are now determined to bring the new government to its knees by cutting off fuel supplies to Baghdad. The city's supply of gasoline nearly dried up last week and local authorities literally shut the city down by banning all privately owned vehicles from the streets. They claimed it was to help hunt down the kidnappers of the Interior Minister's sister but the real reason seems to be to reduce the demand for gas until supplies could be replenished. Electricity in most Baghdad neighborhoods has now been further reduced to as low as 1 hour per day. The black market rate for fuel for generators has doubled again and in many areas even that has run out. At this rate the city will go dark by the end of the month. Iraqi troops are reluctant to escort fuel trucks into Baghdad and American troops have their hands full escorting their own convoys.

Most US casualties are a result of trying to protect US military supplies. You can forget about the US military escorting civilian fuel convoys. So it all comes down to the Iraq army's ability to get fuel into Baghdad and I don't have much confidence they will succeed."

Eventementes, mon cher, eventementes. Two trillion dollars! Bushie, you're doing a heck of a job!

Posted by Gordon at 11:17 AM | Add a comment to this 1 | Other blog comments on this post | Back to Top

View comments inline »
January 01, 2006
Airline nostalgia

Shirah has a post on the effects of airline deregulation. She tries to be even-handed, but this is one thing I still hold against Carter. This was clearly a severe negative.

I remember traveling to Florida in the early 70's. In the Atlanta airport, I had a two hour layover on a Eastern flight, so I went to the National counter and got on a flight leaving right then. It was great. Try doing that now. Eastern and National are history and the tickets are restricted. I still have some Eastern silverware, a ground crew rain slicker, and a sheaf of worthless bonds.

Album of the Year

After several plays, my candidate is Gimme Fiction by Spoon. Download the cut "Beast And Dragon, Adored" and tell me, doesn't the singer sound like Lennon? If you don't trust me, check out the reviews:

Pitchfork: "Gimme Fiction is actually a wildly diverse album, almost schizophrenic in its composition, vacillating between acoustic ballads, a bubbly, synth-tinged number."

Merge: "Gimme Fiction is an exhilarating album of keenly focused artistic vision and ambition."

That should help you decide.

December 31, 2005
Linda, check this out

Here is a weblog on airlines with links to other airline blogs and websites. Re: your current company, from "enplaned":

United Management: Have You No Shame?

Look up "chutzpah" in the dictionary and you'll see the beady eyes of United Airlines' CEO Glenn Tilton staring back at you. United proposes to give management a 15% stake (currently valued at $285mm) in the airline as it exits bankruptcy.

Much of United management are the same guys who rode the airline into Chapter 11 (e.g. Hacker, Brace, McDonald). You'll recall that United filed after management lost its bet that it could get a government loan in return for a mere 9% reduction in employee wages. Government stiff-armed United, at which point there was no way out for United other than filing bankruptcy. It was management's plan that failed, it was management who were to blame for United's Ch 11 filing.

American Airlines management kept its company out of bankruptcy and has done a far better job at stripping out costs. American management isn't getting 15% of that company. Why should United management get a penny for screwing up where American has succeeded?

If United management had put into place some innovative new business plan that had made the airline more profitable, perhaps they'd deserve a greater slice of the pie. But the reality is that value creation in this case is coming almost entirely because of crushing vendors and most of all labor, rather than management inspiraton. If there's a spare $285mm available, split it between the long-suffering unsecured creditors and the Pension Benefit Guarantee Corp. Don't give it to United management.

Seriously, if there is that much money out there, how about topping up the pension fund which lacks some 9.5 billion dollars from that what was promised in a written contract to the employees! It's their money after all. First, there was the phony ESOP plan which gave unions a minority of seats on the board despite the majority ownership. Then, they took a further 2.5 billion in pay cuts in order to keep the airline flying with the understanding that their pensions would be safe. Then, the airline defaulted on the pension, with the connivance of the bankruptcy judge. Now, Mr. Tilton thinks he and his band of thieves should get paid for screwing the employees.

If this isn't a wake-up call for workers, I don't know what is. Companies exist primarily for the creditors', banks, and CEO's benefit; the shareholders are a distant fourth. And the employees? Let them find another job at Wal-Mart. For all their warts, unions and solidarity of workers are the only weapon employees have in this arena. Sure, there are venal, corrupt, and stupid union leaders, as there are CEOs, bankers, and politicians, but that is not sufficient or general indictment of labor unions. Even good unions can be screwed by the banks, management, and lawyers, abetted by the government. The GOP's long-term policy is to break and destroy union power. This has worsened the asymmetry of the playing field and increased the power of the corporations; they know they can disregard contracts and agreements in their single-minded pursuit of money and fear no repurcussions, as long as the donations keep coming and revolving door keeps spinning. Workers have no hope of any regulatory or government relief. Indeed, the current Congress and administration will do everything it can to enable these acts. The net result is that these employees will retire to face a bankrupt PBGA, Social Security (if the GOP has it's way), and a safety net in tatters, if it exists at all. Meanwhile, I expect Bush, Cheney, Tilton, Lay, and all the other pioneers to be resting comfortably in their walled cities. It's an apocalyptic vision, but mark my words.

In God We Trust
abu dollar

I have written in the past arguing that one of the motivating factors for the Iraq invasion was Saddam's plan to convert all oil transactions into euros or other currencies. This major threat to the dollar as the reserve currency would result in a freefall of the value of the greenback commensurate with our status as the world's largest debtor nation. Mike Whitney picks up on this:

There's a reason for this. The main impetus for the war was not petroleum, but greenbacks and the future of a currency that is underwritten by $8 trillion of debt. The only way to safeguard its dominance is to back up the listing dollar with boatloads of oil. And, that is exactly the plan.
***
At present, the greenback serves as the world's reserve currency, the main medium of exchange. This allows the US to pile up enormous debt while avoiding the pitfalls of skyrocketing interest rates or hyper-inflation. The $2 billion of borrowed wealth that props up the faltering empire every day comes primarily from the exporting powerhouses Japan and China. This means that America's profligate spending is financed by the labor of some of the most poorly paid workers in the world.
***
Hugo Chavez knows this, as did Saddam; that's why he switched to the euro 6 months before "Shock and Awe". Now, Putin is trading oil in euros and Iran will open an oil bourse in petro-euros in March. For Iran, its actions are tantamount to a declaration of war. Already, America's proxy Israel has threatened to attack in March. Is it merely coincidence that Iran's oil bourse is scheduled to open at the same time?

No, it's not.

The empire requires a steady diet of petrodollars to maintain its gluttonous appetite for debt. If the oil-producing nations switch to euros, the dollar would freefall like a wingless gull and America would be trapped in a bottomless vat of red ink.

America's prodigious dept has made the war for the world's remaining resources an existential struggle. A retreat from Iraq is no longer possible. If America's debt is not propped up with oil reserves the anemic dollar will crumble with the economy following right behind.

The 42% rise in the Nikkei index this year made investment in Japan profitable this year. However, Japan and China's economies are closely tied to dollars, so a fall in value will negatively affect those markets. Euros, especially German stocks, and even Bolivars may be the currency of choice if you plan to retire in anything except a cardboard box.

December 30, 2005
It's not about the oil

Chalabi !What can you about Ahmed Chalabi? Bush family retainer, CIA asset, bunko man, convicted felon, international fugitive, serial liar, and outgoing Deputy Prime Minister in the Iraq puppet transitional government, he's the model of a Republican renaissance man. Yet, I foolishly counted him out after he received less than 32,000 vote nationwide, well short of the 40,000 needed to qualify for a seat in the new Parliament. My sources say that even this meager count was prima faciae evidence of fraud in the election. Without a seat, it would be impossible for Chalabi to retain control of the oil on behalf of his patrons in the Bush/Cheney/Halliburton cabal.

So, Chalabi has made his move now. It will be months for the election to be sorted out and the deal-making to create a new government, so Chalabi has pushed out the incumbent oil minister and named himself minister in control of the oil exports and income of Iraq.

Iraq has continued to export around 1.2 million barrels a day for the last 12 months (see chart), but the removal of Minister al-Uloum was justified by a supposed protests about recent IMF-mandated increases in domestic petrol prices and drop in production.

iraq-oil.gif

More likely is that al-Uloum, the son of a powerful Shia cleric, was increasingly speaking out on the part of the incoming Shia-dominated government against the ongoing looting of the oil output by first the Provisional Coalition Authority under Bremer and now by the interim government under Allawi, Talabani, Chalabi, and other long-time CIA salarymen. As revealed by Juan Cole 20-30,000 employees of the Iraqi national oil company in the three southern provinces have opposed and apparently have refused to implement the Gasoline Price Program forced on Jaafari by the IMF as well as starting a web and letter-writing campaign opposing privatization. And then there is this quote, "An official of the Oil Ministry in Baghdad told ISN Security Watch, on condition of anonymity: “We do not know the exact quantity of oil we are exporting, we do not exactly know the prices we are selling it for, and we do not know where the oil revenue is going to.""

Let's see. 1.2 million barrels at a special family price of $50 a barrel is some $60 million a day into Dr. Chalabi's famous Swiss accounts and Mr. Cheney's residual payments from Halliburton. Not too shabby. Though it appears that the chances for privatization are slim, US companies certainly will have the inside track on development and production contracts. And. it didn't cost the oil companies anything - the US taxpayers are footing the bill.

Meanwhile, in the North, no oil has been piped through Turkey to Ceyhan for months. The Kurds have long memories of the supression of the PUK by the Turkish Army. They now have control of the oil output in the Kirkuk region and have no intention of giving the Turks any share of the profits. Instead, President Jalal Talabani, acting as head of the PUK and autonomous Kurdish government, recently paid back his Iranian supporters and signed an agreement to pipe oil from the Kurdish zone to Iranian refineries.

This is the result of the incompetent Bush/GOP Iraq misadventure. A policy based on conservative fantasy has resulted in a bankrupt treasury, a broken Army, and a strengthened Iran. Their old enemy Saddam is gone and their Shia and Kurd clients are about to be inaugurated as the new rulers of Iraq. The mullahs now are virtually immune from American influence, seeing the US military bogged down in Iraq and unable to threaten Iran.