Category: Uncategorized

Installing Sun Java 6

I was able to install the package sun-java6-jdk from synaptic with no problems.  The update alternatives were what caused me problems:

skp@pecan:~$ sudo update-java-alternatives --list
[sudo] password for skp:
java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
java-6-sun 63 /usr/lib/jvm/java-6-sun
skp@pecan:~$ sudo update-java-alternatives --set java-6-sun
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
skp@pecan:~$

These errors threw me off at first because I thought they kept it from working.  You can run java -version to see that it really is using the correct version.  Sun’s version reports this:

skp@pecan:~$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
skp@pecan:~$

Open JDK reports this:

skp@pecan:~$ java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.1) (6b22-1.10.1-0ubuntu1)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

As far as I can tell, the “No Alternatives for” messages aren’t causing a problem, so I am not going to worry about it.  If you have any info on that, please comment.

This is the error message that I am getting from my Java that the Sun JDK has solved in the past. I’ll leave it for another later post, but I wanted to share it in case anyone has any ideas. Please comment if you do:

The program '.' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 1359 error_code 8 request_code 140 minor_code 4)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Resources

Ubuntu 11.04 Natty First Thoughts

This weekend, I finally installed an Ubuntu release close to its release date.  This is probably the closest I have ever gotten it done!  So, here are my first thoughts after using it two work days.

The Install

The install went very well for me.  I have a Broadcom wireless card, which has given me problems in the past.  I was expecting to need to plug it into the wired network to get it to work.  I chose to install rather than use the try Ubuntu mode.  At first, the network indicator said that hardware drivers were not enabled and I could not connect.  I went ahead and told it to download updates as it installed knowing it would not be able to.  Then, I checked part way through copying the files and found that I could connect.  Once booted, I only had a couple of updates available in Update Manager so I am wondering if it actually did download them as it installed.  Also, the wireless was just working without me having to do anything after the install!

What I liked

First, it was new.  I like new features and new software — this definitely had the new feeling.  Unity is definitely different (in a good way).

I like the dash and the way the features comparable to gnome-do are built right into the interface.  The desktop interface is pretty light, yet I can quickly open the apps I want.

I like the way the launcher is on the left.  I have a wide screen laptop, and it probably makes more sense to use up the width rather than the height for the launcher.  Also, I like that it auto-hides when I have windows that use up the entire width of the screen, but otherwise, it always displays.

Notification Area

One issue I had was with a couple of applications that normally show icons in the notification area: Shutter and Gnome-RDP.  Shutter mentioned that it was waiting on a Perl interface to do the notifications, but I think I read about a fix that I will have to follow up with.

What surprised me is that I had a couple of other applications that were able to use the notification area.  Skype worked just fine.  Also, I have an application I wrote myself that worked with no problems: Project Sarah.

RDesktop

I usually use RDesktop not in full screen mode, but in a window that fills up the screen.  This makes it easy to switch between the remote desktop and the local.  I can also drag the window around if I need to see part of the remote and my desktop at the same time.

Unfortunately, Unity takes all the decorations off RDesktop now, and I can’t reposition the window.  That was a little frustrating.

Dual Screen Issues

I liked the fact that Ubuntu seemed to autodetect when I unplugged my external monitor.  It automatically switched back to single screen mode.

The problem is that I couldn’t see anything on the external screen.  The clock displayed with everything on the top, but below that was black.  I could drag windows across to the screen, and they would just disappear.  When I set it to mirror, both screens looked fine and everything worked as planned.

I also had trouble with my Java application crashing with a bizarre error.  When I didn’t have the external monitor connected, it worked fine.  I have typically been able to solve that problem by installing the Sun JDK as opposed to the OpenJDK.  I need to work through installing the Sun JDK, and that might do the trick.

Various Usability Issues

For the most part, I liked the launcher and the new interface, but there were a few things I have to get used to.  For example, in the old Gnome interface, I could minimize a window from the task bar by clicking on it after it is already active.  That doesn’t seem to work in Unity.

Also, I had trouble installing new custom menus.  I wanted to create a menu item for my Java programs that I wrote.  I also usually create a menu item for the different Eclipse profiles.  Before, I would right click on the Applications Menu and choose Edit Menu.  Now, it took me a bit to learn that I had to open the “Main Menu” application from the Dash.

Then, once I added the menus, they didn’t show up when I searched from the Dash until after I rebooted.  There’s got to be an easier way to add applications to the list or at least a way to reindex without rebooting.  I’ll follow up when I find it.

One more thing I noticed.  Most of the time I use the keyboard to launch applications (before Unity with Gnome-Do).  But, every once in a while my hand is already on the mouse, and I would rather use that.  Or, maybe I can’t quite remember the name of the program I want to open (hey, I am getting older).  Maybe I just need to get used to the new interface, but the Applications menu seemed a little easier for the mouse.

Settings

Previously, I could go to the Applications Menu to find all the different programs to change settings.  At first, I had trouble figuring out where I could go.  I wanted to see if there where any new settings.

Well, I found the Gnome-Control-Center in the power menu.  Instead of rebooting, you can go to “System Settings”.

Review

All in all, I am really excited about my new Ubuntu and Unity.  I will have to blog some more as I get past the issues in case you are going through them too.

Resources

Source Code in WordPress

Since this is a technical blog, I like to post source code in various forms from time to time.  But, WordPress.com hasn’t been very easy in that regard.

WordPress.com was rather limited — the only thing I found was the [- sourcecode -] tag.  You can read more on that here.

Now that I am on my own site, I am looking to try to improve source code handling with a plugin.

Of cource, the Source Code post mentions that they use the SyntaxHighlighter plugin for WordPress.com. I found another list of plugins, but that just led me back to a different link to the same SyntaxHighlighter.  It does mention a Visual Code Editor that might be interesting.  Apparently, it will work in conjunction with the SyntaxHighlighter. Now, this list looks much more promising: 12 WordPress Plugins to Display and Highlight Code within your Blog

I did a little more looking into the WordPress version (SyntaxHighlighter Plus).  Here is a list of syntaxes supported.  At the bottom, there is some information about how to create your own syntaxes.

This Developer Formatter plugin looks very promising.  The problem is it didn’t work for me.  It seemed to break the editor.

I ran across this thread that talks about adding Code Mirror to the TinyMCE editor.  If I ever get time, I’ll have to try my hand at writing a plugin.

 

LogMeIn VPN; PullMeHairOut on Ubuntu

You would think a stereotypical Linux user would not mind getting his hands dirty in the command-line trying to make a program work.  Well, either this user is not typical or that’s not true.  The LogMeIn Hamagi VPN solution seems to have some cool features, but the Linux client was painful to figure out.  Some documentation or instructions would be nice, but I think a nice basic user interface would also be helpful.  Command-line is cool, but I just need to get connected, and I don’t want to learn yet another networking tool to get where I need to go.

If you are attempting Hamachi, this blog post is your lifesaver:

Eric Lefevre-Ardant on Java & Agile: How to use LogMeIn under Linux

Next task is finding the Linux client.  They don’t have a production one, but they do have a beta version available.  Check out their beta page: LogMeIn Labs & Betas.  This part is awesome once you find it — choose your flavor, deb or rpm, they have it.  The Deb worked great for me on Ubuntu x64 10.04.

After installing, it was like nothing happened.  No new menu items show up in the menu.  Well, don’t worry, it installs a service and a command line program.  Here are the files shown in the package:

Files in the package

When the package installs, it starts the service.  You can see it running here:

Service Running

Now, you have it installed.  You need to use the command-line program to connect.  First, you simply need to connect to the LogMeIn server (everything goes through there server).  Note that you don’t need a user name or any credentials for this part (that will come later).  Here’s the command plain and simple:

sudo hamachi login

Now, if you have an account on LogMeIn, you need to “attach” to it.  If you are connecting to someone else’s network, you can skip this step.

sudo hamachi attach <email_address>

As far as I can tell, the next command just sets a name for your client.  This is the name that will appear in the administration pages online for LogMeIn Hamachi.

sudo hamachi   set-nick <name>

In my case, I set my nickname to “stephen”:

My Nickname Setup

Then, online it will show this name:

Nickname Used

Now, the final step is to connect to the network.  This is where it got really confusing for me.  It was not the command or how to do anything, but the problem was just determining what network ID to use.  So, let me walk you through how to figure out the ID.

The person with the account on LogMeIn who setup the network, will need to login and view the “My Networks” page.  Then, click on the edit link next to the network:

Viewing the Network Settings
Then, here’s where you see the network ID to use in the join command.

Finding the Network ID for the Join command

Once you know this ID, you can simply run the command:

sudo hamachi do-join "<network ID>"

It may ask you the password for the network.  The LogMeIn account holder can optionally setup the password.  If no password was setup, just hit enter, and it will proceed.  Here’s what the configuration looks like when you setup a network:

Network Password Setup

Now, you should be connected.  You should have a new network interface in your network settings:

ham0 network interface

If you need to connect to other machines in the Hamachi network by IP address, you will need the LogMeIn account holder to give you those IP addresses.  You talk to other machines via the IP address for the Hamachi network not the local network.

All in all, once you get it setup, it seems to work well.  I don’t like the fact that you have to run the program as administrator.  For my other VPNs, I don’t need super user access to configure or connect.  I also don’t like having an extra service running in the background.  Why can’t it just use the Network Manager Applet like the other VPNs?

Now, I would be amiss if I didn’t mention the GUI.  I found a Community Thread that points to a front-end called Haiguichi.  It has a Deb package that you can install, and that part worked fine.  It gives you a new menu item under Applications > Internet > Haiguichi.  I couldn’t get it to configure though, and I finally figured out the command-line, so I left it alone.

Great Link: App List for Ubuntu

I ran across this link recently, and I always want to share great lists of applications.  Building your toolbox is always fun.  Or should we say loading the app under the Christmas tree!

Ubuntu Linux Help: More Useful Open Source Applications 2011

PDF Mod is the new app that I picked up right away off the list.  I haven’t had a lot of chance to use it yet, but I think it will come in handy.  Install it with this link: apt:pdfmod.

 

Gizmod for Volume on Mythbuntu

Our remote control has been working fine with my Mythbuntu setup for a while now, but there are a few things I would like to work better. Volume is one of those thing. Lirc controls the volume differently between Hulu Desktop and the built-in video player. It is a little annoying.

So, after a little Googling, this thread sparked my interest in Gizmod.

Installing…

To install it on my system, I followed the Ubuntu directions. That calls for installing via the repositories:

sudo apt-get install gizmod

Next, I had to address the UDev / Security. First, that means creating an “input” group:

sudo groupadd -f input
sudo gpasswd -a username input

Then, I added the following lines to /etc/udev/rules.d/99-input.rules:

KERNEL=="event*",       NAME="input/%k", MODE:="660", GROUP="input"
KERNEL=="js*",          NAME="input/%k", MODE:="664", GROUP="input"

Then, to make the changes take effect, I ran:

sudo service udev restart

Here’s the problem. When I tried to start gizmod, I got this error:

GizmoDaemon v3.4 -=- (c) 2007, Tim Burrell &lt;tim.burrell@gmail.com&gt;=---------=
Unable to Initialize Gizmod :: User Script dir [/usr/etc/gizmod/modules.d] does NOT exist or permissions are wrong!
GizmoDaemon Shut Down.

Recompiling

I found a bug report that seemed to suggest that maybe recompiling from the source might fix the problem. So, here is what I did.

So, I downloaded the latest version from the Download Page. Then, here’s the command to unzip:

tar -xjvf gizmod-3.5.tar.bz2

cd gizmod-3.5/

Installing dependencies

The easiest way to make sure that you have all the dependencies is with apt-get. Otherwise, you need to check the documentation and manually go through the list installing all the programs.

sudo apt-get build-dep gizmod

Then, continuing on, I followed the instructions and ran CMake.

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DSYSCONF_INSTALL_DIR=/etc ../../gizmod-3.5

make

The make command failed with this error:

skp@gabriel:~/Downloads/gizmod-3.5/build$ make
[ 29%] Built target H
[ 31%] Building CXX object libGizmod/CMakeFiles/Gizmod.dir/CPUUsage.o
/home/skp/Downloads/gizmod-3.5/libGizmod/CPUUsage.cpp: In constructor ‘Gizmod::CPUUsageInfo::CPUUsageInfo()’:
/home/skp/Downloads/gizmod-3.5/libGizmod/CPUUsage.cpp:83: error: ‘memset’ was not declared in this scope
make[2]: *** [libGizmod/CMakeFiles/Gizmod.dir/CPUUsage.o] Error 1
make[1]: *** [libGizmod/CMakeFiles/Gizmod.dir/all] Error 2
make: *** [all] Error 2

I found a fix online. The fix was to add #Include <cstring>:

Then, it worked. Everything compiled with no problem.

Lastly, I finished the compile/install with:

sudo make install

Now, I haven’t used it very much. I think I need to do some configuring and hacking to get it to do what I want it to. Currently, it doesn’t seem to do well with Hulu Desktop.

Taking Cheesy Pictures With Your WebCam

If you have to go to the grocery store, you may as well make it fun.  My son can’t quite read yet, so I like to make picture lists of what we need and I have him go through the list and help me get all of the items.  Usually, I just use Google’s image search to build my list of pictures.  Today, I couldn’t find the right picture, and I decided to try my hand at taking my own pictures.

Here’s where I got lazy.  Why take a picture with my phone or digital camera and then take the time to copy over to my laptop?  I have a camera on my laptop.  Why can’t I use that?

Here’s how to make it work…

Installing Drivers and Software

I found my answers in Ubuntu’s Documentation.  If you need help with the drivers part, you can look there, but my driver was installed by default with the Ubuntu installation.  The part I needed was Cheese.  The Cheese program did exactly what I needed.

Ubuntu Documetation: WebCam

You can either use Ubuntu Software Center to install Cheese like this…

Installing Cheese with Ubuntu Software Center

Or, you can use Synaptic…

Synaptic to Install Cheese

Once installed, you’ll find it under the Sound and Video menu:

Cheese on the Menu

Using Cheese

Taking the picture is as easy as saying Cheese!  Open the program, get your web cam pointed right, and click the take photo button.

Taking the Picture

Note, Cheese has different modes.  You can either take a picture, video, or burst mode.  You can select the mode at the bottom:

Mode Icons

More Info…

Cheese Website

To Watch: Free Software University

I would say Software to Watch, but it’s more learning to watch.  I made it through college.  Do I really want more punishment?  Well, I guess I am a nerd.  Bring it on!  Knowledge is always something I can use more of.  Maybe I will even get the chance to teach.  In any regard, keep an eye on this Free Software University.

Links:

Great Link: How to Become and Amazing Open Source Person

I ran across this the other day:

Open Source.com: How to become an amazing contributor (to an open source project)

I would love to be one of those people in the story.  Being amazing is always a good thing.  Actually, one of the things that stood out to me was that this is a two way street.  The author was lauding these people, but at the same time, they commented on how it was easy to contribute.  They found documentation that helped.  The code was structured in a way that made hacking easier.  I think both the contributor and contributee are amazing.