What does a tech support geek do all day anyway?

I hate to let a calendar month go by with no post.

Though hey, I’m so far behind on reading my web comics, I don’t even know how far behind I am anymore. That’s when you know it’s serious.

Being a parent and keeping things from falling apart has pretty much taken up all my energy outside work at this point. It takes up a lot of time, too, but the real constraint is energy and enthusiasm. It’s hard to really get into anything significant that you know will probably be interrupted soon. Thus I haven’t even gotten around to checking out the Android-friendly ORMlite updates. Someday!

At least some of the arcane stuff I’ve been working on for my day job is publicly visible! Too bad VMware doesn’t really have a way for KB authors to sign our work, but here are a few bits of interest in the web server / application server world…

I have some in the pipeline to attempt to finally explain Tomcat auto-deployment and logging in a way that a non-expert can follow and use (I dare say the engineers are too close to their work). I should work on the official docs, but that’s not officially part of my goals… if I could get someone to pay me for it, I probably would. I think I have something of a gift for technical docs. It just takes me such a long time, I doubt anyone would consider it worth funding. At the same time, I don’t want to quit doing actual technical work in order to document it.

Maybe soon I’ll document my journey of trying to use Fedora 16 for my workstation (VPNs… virtualization… and dual monitors, oh my!)

Broadcom wifi and Fedora

I bought my Lenovo G550 laptop with the idea that, while being fairly inexpensive, Linux would run well on it. And for the most part, that’s been true. Even the camera worked without a hitch. The main problem I had was that under Fedora 13, I couldn’t get the video to mirror to the SVGA output – the screen would just go black when I tried, rendering it useless for presentations. But that seemed to be solved with Fedora 14, so I chalked it up to temporary machine-specific weirdness.

The real problem since then has been the wifi. When I originally installed the box, I saw that the wifi wasn’t working. I ran lspci, saw that I had a Broadcom BCM4312 chipset, and found with a quick trip to Google that it needed some proprietary firmware (joy). There were some old articles on the net about how to do that by cutting it out of other drivers, but it seemed the modern way to do this is just to enable the rpmfusion repos and install kmod-wl. So I did that, and it worked. Problem solved and largely forgotten, for a while.

However, as far as I can recall, this never worked on Fedora 14. So I was stuck with either no wifi (Fedora 14), or no presentations (Fedora 13). I chose to run Fedora 13 for my personal hacking, and use the Windows boot (which naturally worked fine) for presentations. Then a month or two ago I updated Fedora 13, and wifi stopped working there too. Even if I booted an earlier kernel; under no version could I get it working. Windows of course still worked, so I knew it wasn’t hardware.

Fedora 15 just went GA a few days ago. I installed it yesterday, tried the same trick with kmod-wl, and glory be! Wifi worked! Mirrored video worked! I was back in business.

Then I found that my Gnome 3 desktop (which by the way… not sure I like… weird merger of Mac and Android) had gotten into a weird state, and ran a system update for bug fixes. Calamity! Wifi was back to broken – again, with either the original kernel or the updated one. NetworkManager failed to even run – it would start with a red mark in my toolbar, then just disappear. Maybe it’s not kernel-specific? Maybe it’s NetworkManager? I don’t know.

Well, I just installed again, and ran updates, and then installed kmod-wl (which looks like it might have pulled in an updated broadcom-wl for the new kernel), and it looks like the wifi is back up. But this is a lousy situation – I’m going to be fearing making system updates because my wifi will break :-( I’m not even sure who to complain to… the driver is 3rd-party, in fact so is the repo, so it’s not Fedora’s fault per se. On the other hand maybe the reason it keeps breaking is because Fedora moves too quickly and changes kernel APIs too much for the wifi firmware to keep up.

For now, I guess the solution is to dual-boot F15 with itself, and only update one at a time to make sure one is always working. (Or try Ubuntu, some of you will say; but I like Fedora, and they don’t share bootloaders very well.)

App inventor first fiddlings

I’m finally getting a chance to try out App Inventor.

The first thing I found is that Java applets and jnlp seem to crash firefox on Fedora 13. That’s a shame. But the Chrome browser seems to do better, so I proceeded forward with that. Also, it looks like Google heard my complaint and, in addition to a .deb package, now provides a simple tarball for non-deb Linux users (that wasn’t so hard, was it?).

The first thing that comes up when you visit the site and have access is some kind of UI builder thing. Among the first things I noticed about this is that it only has LinearLayout and TableLayout. I guess that’s for the sake of simplicity, but… no RelativeLayout? It’s not obvious how to use everything that’s there, or how to hook anything up to actions. Things became more interesting when I discovered the “Blocks Editor”.

BTW, was there some kind of manual to read? I don’t remember seeing one, but I probably breezed by it. Ah yes – I started there and headed down the installation rabbit trail. Back to the intro; it brings up both the Designer (that’s the first thingy) and the Blocks Editor right away. So there it is.

Of course I quickly built a layout with a text editor and button and deployed it to my phone (emulator, actually) right off to see it in action. That worked. However later on when I was working on a regular app in Eclipse and tried to deploy it, that seemed to fail. The log was full of errors I’m not used to – something about not matching a certificate. Did app inventor’s tooling ruin my emulator for other development? Good to find out before I try it on my actual phone.

So, I just tried the first tutorial. It’s fairly cool that while you’re building your app in the tool, it’s being updated at the same time on the phone. Obviously, there’s an app inventor component running on the phone to make that happen. When you’re done building it, you can package it as a standalone app. While I was waiting for that to finish, I brought up adb logcat to see what was going on. It said that the adb server was “out of date” and restarted it – this apparently cut app inventor’s connection. I don’t know if this is specific to Linux or even my system, but it doesn’t seem like you can use it in parallel with the other SDK tools. Then again, logcat didn’t get cut off when I reconnected app inventor.

As I read initially, there doesn’t seem to be any ability to create multiple screens. But there’s a “canvas” block that looks promising for achieving a multi-screen effect.

When I went to add some contacts for the second tutorial, the act of leaving the app inventor setup evidently triggered the “server is out of date” problem again. I wasn’t able to reconnect app inventor to the emulator; I eventually restarted the Blocks Editor. It seems to be necessary to re-download the Blocks Editor each time – I can’t just re-start the one I already have, or it doesn’t come up with the project contents.

That’s about all I have time for now. It looks like an interesting way to introduce someone to creating simple apps to the phone – especially if they’re graphically minded. I’ll show this to my Android group tomorrow.


Android App Inventor on Fedora 13 #appinventor

Wouldn’t you know it, the App Inventor for Android “extras” software for Linux (evidently you have to wait for an exclusive invite to access the actual software which is apparently a Java applet) is only supplied as a .deb package. What’s a Fedora user to do? Aside from reflect on our own no-doubt-sordid history of such OS bigotry.

Well for one thing, you can complain. I used Twitter. If you find an email or form where someone might listen… let me know.

Also, there’s this program called alien that will try to convert your .deb to an RPM. But getting that to work is tricky itself. Alien is kind of old. None of the canned packages for it worked for me. Perhaps understandably it’s not packaged in the Fedora yum repo (probably because it’s not really considered a good idea to do this conversion; you should build the RPM from source. But you can’t do that when the source is not available. Hopefully this will be a temporary problem). So we’re back to the old make/make install business (alien has no tests, how comforting). Actually it’s a Perl project so there’s perl Makefile.PL first.

I needed a few extra packages for alien to work:

sudo yum install rpm-build perl-ExtUtils-MakeMaker

And then I could get the source for alien, and

tar zfx alien_8.81.tar.gz
cd alien
perl Makefile.PL
make install

If I were smart I’d probably package it into an RPM and install that, but I don’t have the time; I’m just happy to have it working.

Now it’s time to actually use alien for the conversion. This is using rpmbuild under the covers, and it wants to install files with root permissions, so I pretty much have to do everything with sudo.

$ sudo /usr/local/bin/alien --to-rpm appinventor-extras_1.0-1_all.deb
Package build failed. Here's the log of the command (cd appinventor-extras-1.0; rpmbuild --buildroot=/home/luke/Downloads/appinventor-extras-1.0 -bb --target noarch appinventor-extras-1.0-2.spec):
Building target platforms: noarch
Building for target noarch
Processing files: appinventor-extras-1.0-2.noarch
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /bin/sh libX11.so.6 libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.4) libdl.so.2 libdl.so.2(GLIBC_2.0) libdl.so.2(GLIBC_2.1) libgcc_s.so.1 libgcc_s.so.1(GLIBC_2.0) libm.so.6 libm.so.6(GLIBC_2.0) libncurses.so.5 libpthread.so.0 libpthread.so.0(GLIBC_2.0) libpthread.so.0(GLIBC_2.1) libpthread.so.0(GLIBC_2.2) libpthread.so.0(GLIBC_2.3.2) librt.so.1 librt.so.1(GLIBC_2.2) libstdc++.so.6 libutil.so.1 libutil.so.1(GLIBC_2.0)
error: Arch dependent binaries in noarch package

D’oh! alien is trying to create a noarch package, but it’s not actually architecture independent! Guess alien isn’t smart enough to figure that out or provide a reasonable default (like, the current system architecture). And guess what, there’s no option to override that. However, there IS an option to generate everything up to the rpmbuild command and then stop – it’s the –generate option:

sudo /usr/local/bin/alien --to-rpm appinventor-extras_1.0-1_all.deb \
                          -v --generate

And alien helpfully gave us the rpmbuild command line it tried, so we just need to modify the arch:

cd appinventor-extras-1.0/
sudo rpmbuild --buildroot=/home/luke/Downloads/appinventor-extras-1.0 \
              -bb --target i686 appinventor-extras-1.0-2.spec
cd ..
sudo yum install -nogpg appinventor-extras-1.0-2.i686.rpm

And there you have it. What a pain – and just to basically put some files in /usr/google/ (looks like mainly Android emulator images). And then wait for the invite.

Viewing source in eclipse with Android SDK (the easy way)

Forgot to mention, I finally got that article up on viewing source in Eclipse. I found the resources on how to do it weeks ago but wanted to write it up properly with screenshots and everything and was too busy! Anyway it’s over here:


I have a few things yet to do though:

  • This gives some hints on getting exactly the right version of source as opposed to a branch
  • Need to alter my published sources to comply with the license (oops)
  • Move the images and downloads to better hosting :-/

In other news, I need to look through this thread and see if I can get debugging a device to work in Fedora 12.

back in the saddle… (?)

Hoo boy have I been busy, mostly too busy to track it here. Found some actual contract work – well, if I could just get a signed contract. And also have been exploring Spring for a potential job offer. But my tech-fu has been failing left and right, don’t know what happened!

My trouble started a week ago when I went to my Android hack night and Eclipse on my laptop wouldn’t even bring up any editors. At the time I thought it was somehow related to the STS (SpringSource Tool Suite) I had installed (it’s another eclipse distro) but now I doubt it was related; there had been a number of other system updates and I think some of them caused problems, though I’m still at this date unclear what happened. I installed an entire parallel Fedora 12 system reusing my home directory but not introducing all the rpmfusion/jpackage stuff and it seemed to do better with Android but I ended up monkeying around with .eclipse and eclipse-workspace/.metadata until I’m not sure what I did anymore. All the while switching back and forth between the two OS installs did wonders for my firefox config. I *think* it’ll play Flash again now.

In the midst of all that I was trying to get work done and try out Spring. STS gave me fits, and I’m really not sure how much of it is STS/Java and how much was related to other issues was having. I stopped trying to figure things out on the notebook after a while, but I tried STS on Ubuntu and on WinXP and the best I could get it to was that it would build the examples and deploy them to tomcat, but this might not work after the first time, and half of my projects were riddled with all kinds of dependency problems. Dependencies in Java are a nightmare. I’m sure if I sat in a cube next to some gurus for a few days, they’d get my system in shape. But having to figure it out alone is infuriating.

But the fun did not end there. My laptop started acting really odd yesterday; stopped being able to open applications and such. I rebooted and the shutdown had lots of complaints about stuff that was refusing to unmount and such. After reboot I couldn’t log in graphically. I got to a place where it was trying to login and stuck, and I couldn’t switch to any consoles so had to do a hard stop, and of course when it rebooted I was nailed with fsck (for BOTH installs of Fedora now). Then I was fiddling with it and started getting messages about “can’t modify (foo) – read-only filesystem” – this was for BOTH the OS and home partitions. From what I could gather in /var/log/messages, the OS started having problems with the filesystems and just remounted everything to read-only – have never seen this before. I rebooted (more scary umount msgs) and applied some Fedora updates, hopefully those may improve things, or I may just have a hardware problem and need a new drive or something. That’s doable but what a pain. I also noticed on the latest reboot that firefox is spawning off numerous gtk-gnash instances that burn CPU for two flash movies in my tabs that I’m not even playing. Killed them all but that really should not be happening. So not too confident in laptop still :-(

Agenda for today: root my old G1, try out CyanogenMod on it, and see if I can get androidscreencast going.

wireless doom, skin success, android device bridge

last night i put my laptop in suspend; this morning after un-suspend, wireless didn’t work for fedora. i installed a lot of updates to the OS last night so i guess one of them broke wireless. fabulous. submitting a bug. at least wired network is fine.

total success on the android g1 skins melding. basically, i created two subdirectories, one each for portrait/landscape images. then i merged the two layout files; as everything was pretty explicit in the layout files, my “parts” section consists of three parts: one shared “device” part (which is the display screen), and one part each for landscape and portrait (which just wrapped the rest of the previously separate layout files). i had to specify that the “device” part was rotated and translated for landscape – in portrait, x/y specify the upper left corner of the screen; in landscape where this is rotated, x/y refer to the lower left corner of the screen. also because for landscape the system automatically rotates the dpad effects, i had to re-rotate it to undo that (since everything is explicit and correct in the button layout) as commented in the HVGA layout. now all i need to do is send a copy to the original author and ask him to place it in the creative commons so i can rebrand it :-)

So, I thought for a quick bit of fun I’d try attaching to my phone from my computer (like you can to an emulator). Windows makes you install some USB driver and then reboot – well, the heck with rebooting. Under Ubuntu, you need to do some obscure udev voodoo to connect, but that’s OK. This is all it takes for Karmic Koala (thanks to this post):

$ sudo su -
# cat > /etc/udev/rules.d/51-android.rules
SUBSYTEM=="usb", SYSFS(idVendor)=="0bb4", SYMLINK+="android_adb", MODE="0666"
# chmod a+r !$
# service udev restart

Then I connected my device and it was visible to adb right away. I got a shell on the phone. It’s not a root shell like in an emulator, so there doesn’t seem to be a lot you can do! For instance, the /data directory isn’t readable, so no scoping out databases. You can run top, dmesg, etc. from the /system/bin directory. Maybe I’ll find uses for that. I was hoping maybe there’d be some kind of bridge to open a telnet connection to the console on the device (like on emulator) but I guess that’s not available. If I think about it, makes sense, you don’t want someone’s computer to be able to do much to your phone if you just happen to connect its USB cable.

Connected eclipse to it – only one process is visible, the uploader. But I set my app to debuggable and kicked it over to the phone, and debugging worked great. That’s pretty sweet! Definitely necessary if you’re really using the device interactively. And something that would be useful even if you weren’t planning to do any development: you can do a screen capture of your device from DDMS in Eclipse!

I was thinking that part of the reason people use Java so much is the awesome remote debugging abilities. But then it occurred to me to ask whether other languages do this too. Certainly they do – no particular reason why it shouldn’t be possible. Looks like gdb can do it for the languages it supports, and there are at least some ways to do it for Perl and Ruby, though I’m not clear on whether anybody actually does that – though knowing Ruby someone has an awesome way to debug into Rails apps as they run.