Don’t let the User Fail

One of the things that has been bothering me quite a bit as of late is debugging setup issues with OpenStack. Usually this consists of tracking down errors amongst 12 different log files when something goes wrong. There are multiple issues going on here. Firstly, the guides for setting up OpenStack, Folsom, are not so great, or situated for different environments (multinode vs single-node). [That being said, DevStack is pretty cool and easy to use]  Secondly, debugging a new setup and learning at the same time can be a pain.

The major issue of installing OpenStack could be solved through a dedicated install process. However, the larger issue is that the user is allowed to fail so quickly. It’s similar to refusing to validate an email address prior to submission and processing on a website. My suggestion is that many of these issues can be solved by doing step by step confirmations of the process. For example, if you were to install a web framework, the installation process/script should confirm:

  1. That a server is installed
  2. The installing user has permissions, or can be elevated to the permission level, to install the web application
  3. Copy the files over to the web server and start the web application
  4. The web application prompts for a configuration on the first run (I.e. Checking for writable permissions at the get go, setting up users, etc.)

Asking a system administrator to do all of these manual confirmations causes quite a few issues. For example, Some web applications have an issue with the database configuration after the web site has been put in use.  Lastly, if a script fails it should fail in a sandbox rather than the live environment. Gentoo sandboxes ebuilds prior to installing the executables on the system.

Another thing to note, if a user is configuring a database on install ask for the host, confirm that the host is enabled, and then allow for a database selection.

Things I learned a week or so ago

These few items are a few things that I found a week or so ago, but I hadn’t had the time to post them:

  • If the Nvidia package has difficulty finding the version number for the kernel, which is an issue for 3.7 and higher then link the Versions.h file to /usr/src/linux/include/linux/.
  • If you have “AutoAddDevices” in your xorg.conf file, your mouse and keyboard may not be found when X starts up.
  • For Gentoo users and people who manually build their applications, if you get an error on the build, make sure you that you reduce the number of concurrent builds when searching for the error. This is a matter of reducing the argument -jXX to -j1. This will help you resolve an issue where groupware_dav in the KDEPIM-runtime package fails to build. The solution to that issue: The build was having an issue with a libsasl library, and required for a revdep-rebuild.
  • For those who have an NVidia Optima: you may get an error that “Cannot load glx on :0.” This causes for the graphics performance to be less than stellar, and for KDE Desktop Effects to not operate. To resolve this issue: Make sure that the Intel/Mesa graphics driver is reinstalled and to switch the default OpenGL reference to be Xorg-server rather than NVidia. [Use the “eselect opengl set ” command to accomplish this] Setting the OpenGL setting will not affect Bumblebee’s OpenGL switching.

Links I’ve Found Interesting in the Last Week/Technical Things I’ve found Interesting (6 January 2013)

  • Getting the “Application Server Libraries not found” error with IntelliJ when you try to add a local Tomcat server? If you’re using Gentoo it’s a matter of file locations. Install the tomcat-api package, and make a symbolic link from the API within the Common and Shared Tomcat directories. Source.
  • Tomcat 7 has changed around how resources can be accessed. You can no longer use “getResourceAsStream” to get files placed in the Web-inf/Classes folder. Instead, you should attempt to get the resource through the context of the local thread. An example: Thread.currentThread().getContextClassLoader().getResourceAsStream(). This is useful for applications that use JasperReports [location of the JRXML file], and that are web applications. Source.
  •  If you are trying to stand up a web server, and don’t want to allow it to accept public connections? Set the accepted connections on tomcat to only listen on the local address. For tomcat see this. For NGinx see and set it only set listen to 127.0.0.1:[port].
  • Converting a GUI Netbeans project into a Maven based project? Most of the needed libraries will be covered by the default Maven repositories. However the swing-layout dependency is a special case. To use include the Netbeans repository reference, and include the swing-layout-1.0,4 dependency.
    Repository:

    <repositories> 
       <repository>
          <id>netbeans</id>
          <name>NetBeans</name>
          <url>http://bits.netbeans.org/maven2/</url>
       </repository>
    </repositories>

    Dependency:

    <dependency>
       <groupId>org.netbeans.external</groupId>
       <artifactId>swing-layout-1.0.4</artifactId>
       <version>RELEASE691</version>
    </dependency>
  • Ignoring failed tests on a maven build: Add this parameter to your mvn command: -Dmaven.test.skip=true
  • Sort directories and files with a human readable format: This is like ls –Sh, but it traverses directories.
  • If you have a set of directories to ignore, SVN propset includes an option to recursively ignore specified names/folders. A word of warning propset overwrites any svn:ignore properties.

Some of the Articles/Links/Video That I found Interesting in the Last Week

  • System Rebuild for Gentoo– This is the equivalent of formatting your computer and installing everything to the latest version. It will rebuild your dependencies and any new use flags that you may have added after the install.
  • SVN Status Codes– If you are dealing with the SVN command line client, this will explain some of the non-obvious status codes. [I.e. L and +]
  • Brute Force Hash Checker– This is an interesting attempt at speedily generating hashes [for the generation of rainbow tables] by using GPUs.
  • Torturing Interview Candidates: I’ve seen many of these techniques employed in interviews. I’m rather pleased that someone brought these to light.
  • How John Deer Uses R–  this was more of a presentation of a case study. However, it was quite interesting how some that is incredibly accessible is being used to benefit business decisions. I’ve done a few things with R, but its something I’d like to learn better.

New Equipment and Switching Workstations

Recently I got a sweet new laptop. After being stuck with laptops with cheap builds and parts, this is a welcomed new addition. When converting my previous workstation over to the new one, a few things came about some bad, and mostly good. The awesome bit about the new machine is going from a core duo to a Core i7 processor. My primary operating system has been Gentoo, so installing a new operating system requires a manual install, configuring a new kernel, and building all of the needed secondary applications.

Let’s start off with the annoyances:

  • Since both machines are Gentoo sharing the USE flags from Make.conf, and adjusting the new one to the new hardware included an outdated keyword or two. It turns out that Xvmc is outdated and by using an Nvidia card, one should use VDPAU. This was fixed by eliminating all mentions of Xvmc keywords.
  • IceTea Java requires printing [Cups], which CUPS require Java. This circular dependency was quite annoying. At the moment, I cannot recall how this was fixed. However, I believe it was fixed by forcing Portage to pick Oracle’s version of Java rather than IceTea. [I’m not sure how to set the preference prior to installing; I had to force/nodeps this one].
  • CrossOver Professional [at least the 10.3 version] requires the use of Python 2. If you have a new install, then Python 3 will be in place. To fix this: you’ll need to fix the Python 2 references in the installation directory. I found this guide to be helpful, although, it was a bit difficult to find. If the guide has been deleted, this is a copy from the site:
    $ cd ~/cxgames/bin
    $ sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" *
    $ sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" *
    
    $ cd ~/cxgames/lib/python
    $ sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" *.py
    $ sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" *.py
  • CrossOver Pro, despite having a 64bit version, requires multilib support. [Which was included, but for those who wish to be 64bit purist may find a little too late]. The kernel must include IA32 Emulation support [from the Executable file formats / Emulations section]. The CrossOver Pro documentation claims you should have ia32-libs installed. In Gentoo this is the equivalent to the app-emulation/emul-linux-x86-* libraries.
  • Nvidia Optimia – There is no fix for my laptop. It’s frustrating. Although, the Intel video card does quite well. I’ve tried to install bumblebee, but the configuration isn’t currently supported.

Some nice changes in the Linux environment/Gentoo:

  • The added features to the Linux kernel. It looks like better SSD Support has been added, awesome!
  • NetworkManager/NetworkManagement. I’ve struggled with a lack of dynamic network support a while. This should be included in the KDE meta-ebuild. Although, from my understanding, there is quite a bit of approval/support for WCID. NetworkManager has great desktop support clients, if the user unplugs an Ethernet cable; it tries to switch to WIFI.
  • If you have CrossOver Pro, and use the Bottle functionality. You can create mutually exclusive containers for applications. You can also export these bottles as archives and import them later. This is amazing! To bring over your copy of MS Office, you don’t have to deal with the trouble of recreating the environment, or reinstalling the dependencies.
  • LSOF- This can help you find what process is listening to which port. That can be helpful when tracing down rogue/bad installs of server components. Looking for the process that is responsible for port 90? Use the command lsof –i :90.
  • Adding SSH keys for passwordless logins. Prior to using this command, I always setup this functionality manually. Then I heard about ssh-copy-id. This command takes your default key [or one specified by an argument] and copies it to the right place at the target. The downside to this command is that it depends on quite a few defaults. [I.e. Default port of 22, default users, port following, and default keys] This is an annoyance that has a bit of good in it. Having a non-default SSH setup will require you to alias and setup a personal SSH config.