Running Dynamically Generated Hive Queries From a Shell Script

If you want to write a HQL hive query and run it mulitple times from a shell script, each time passing it different data for the query, here is a quick example that should get you started.

The first thing to know is that by specifying n number of -hivevar key value pairs when invoking hive on the command line will allow you to pass that data into the hive process.

For example, if you do the following

$ hive 
Continue reading “Running Dynamically Generated Hive Queries From a Shell Script”

Eclipse Android Development Error executing aapt: Cannot run program “/path/to/aapt”: error=2, No such file or directory: error=2, No such file or directory

Even though the ADT bundle provides a 64 bit version, the system requirements indicate that “64-bit distributions must be capable of running 32-bit applications.”  I failed to see that when installing it under Fedora Core 20 and was getting the following error from Eclipse:

Error executing aapt: Cannot run program "/home/rchapin/sdks/adt-bundle-linux-x86_64-20131030/sdk/build-tools/android-4.4/aapt": error=2, No such file or directory: error=2, No such file or directory  android_sdk    line 1   Android ADT Problem

I checked to see if the file was there.  Yep.  I → Continue reading “Eclipse Android Development Error executing aapt: Cannot run program “/path/to/aapt”: error=2, No such file or directory: error=2, No such file or directory”

Setting up Android in Eclipse, Unable to resolve target ‘android-18’

When setting up Eclipse for Android development, after you have installed the Develeper Tools and NDK Plugins and linked to the ADT-bundle and then imported your project (see othere posts related by searching for ‘android’) I got the following error:

[2014-03-24 14:14:53 - android_sdk] Unable to resolve target 'android-18'

I went and checked to make sure that the Platform.MinPlatformToolsRev property in the ~/path/to/adt-bundle-linux-x86_64-20131030/sdk/tools/source.properties matched that of my project.properties file.

They were both 18.  Eh?  Why the error?

So, in Eclipse, → Continue reading “Setting up Android in Eclipse, Unable to resolve target ‘android-18’”

Invalid Project Description, project path overlaps the location of another project with the same name When Importing Existing Android Project in Eclipse

I’ve got a new install of Eclipse and am setting up to do some Android development.

After getting the Develeper Tools and NDK Plugins installed and linking to the ADT-bundle that I downloaded, I was getting an error when attempting to import the existing project by going to File > Import > Android > Existing Android Code Into Workspace.

The error was:

Invalid project description /some/path/to/project/dir_name overlaps the location of another project: dir_name

After a few searches and a couple → Continue reading “Invalid Project Description, project path overlaps the location of another project with the same name When Importing Existing Android Project in Eclipse”

Restarting XServer in Fedora 20

I was having problems logging in this morning to my laptop.  When I entered my password, it just hung.   I pressed Ctrl-f2 to switch to an alternate tty, logged in as root and checked for errors in /var/log/messages.

Not seeing anything, I figured, I’d try and restart the Xserver.  Still not being completely familiar with the sysctl paradigm it wasn’t obvious how to restart it.

So, as root, I simply switched the runlevel to 3, and then back to 5 → Continue reading “Restarting XServer in Fedora 20”

Clone and Backup a Bootable USB Drive

We recently got a new ASUS laptop for the boys to use (I’ll use it too, it’s pretty sweet) which came with Windows 8.

It did not come with the install CD or license key, but included a recovery partition and the key in the BIOS.  Now that we’ve had it for a few weeks and verified that all of the hardware works, we are going to put Ubuntu on it, but I wanted to make sure that I would → Continue reading “Clone and Backup a Bootable USB Drive”

Creating a Beep from a Command Line or Shell Script

If you have a long-running command on shell-script that you want to generate a beep upon completion on your PC running Linux do the following:

Make sure that the pcspkr module is loaded:

# modprobe pcspkr

Then create a wrapper shell script that looks something like this:

#!/bin/bash

# Some long running command here . . .

echo -e '\a' /dev/console
Continue reading “Creating a Beep from a Command Line or Shell Script”

Eclipse Crashing with SIGSEGV, Problematic Frame libgdk and/or libsoup Problem Solved

I’m setting up a new workstation under Fedora Core 20 and getting my dev environment set up.

I had copied over my /opt dir from my old machine which included an older version of Eclipse (3.8.2) that I had been using.  That version wasn’t behaving very well and I decided to go with the latest and greatest stable version (Kepler, 4.3.1).

Unfortunately, Kepler was dumping core with the following error:

 A fatal error has been detected by the Java Runtime Continue reading “Eclipse Crashing with SIGSEGV, Problematic Frame libgdk and/or libsoup Problem Solved”

Excellent Example and Explanation on How to Inject Properties from an External Properties File from Outside of a WAR in a Spring Application

I am doing some refactoring on a Spring MVC application, pulling out configuration data and login crentials from the spring.xml file.

What I want to do is to consolodate sensitive data into external .properties files that can be read, at runtime by the app and not require recompiling the war to make changes.

Thanks to Ben Northrop and Summa Technologies for such a clear, concise and well written article.

The long and the short of it (copied from the → Continue reading “Excellent Example and Explanation on How to Inject Properties from an External Properties File from Outside of a WAR in a Spring Application”

Disabling Window Snapping for Fedora Core 20 Under Xfce

For me, window snapping is incredibly annoying.

For FC 20 with the Xfce spin, there a couple of knobs to turn before it can be turned off completely:

Applications Menu/Settings/Window Manager:

Go to the Advanced tab and uncheck ‘Snap windows to screen border’ and ‘Snap windows to other windows’

Applications Menu/Settings/Window Manager Tweaks:

Go to Accessibility tabUncheck the ‘Use edge resistance instead of window snapping’→ Continue reading “Disabling Window Snapping for Fedora Core 20 Under Xfce”