v_c

Vagrant, CentOS 7 and VirtualBox

Using Vagrant and VirtualBox, a full CentOS 7 development environment can be generated.

Vagrant is an open-source tool that allows users to create a repeatable, portable, description of an environment in a single file. The environment can then be generated using a virtualization tool like VirtualBox. This case uses a Ubuntu 14.04 LTS host, though any modern Linux distribution should work.

This specific instance uses CentOS, an open source packaging of Red Hat Enterprise Linux, performs security/user/update tasks; and installs the development environment, GUI and Guest Additions.

All files can be found on GitHub.

lambda_java_header

Java, Amazon AWS Lambda and Ant

Using Java, Amazon Web Services (AWS) and Ant; a function can be created/deployed that performs the role of a scheduled task. The code can be used to make web service calls, run backup tasks, clean a database table, etc.

Source code is discussed, and a walk through goes over the process of registering the function with AWS.

All source code can be found on GitHub.

Continue reading

header3-624x222

GeoServer 2.6.2, Programmatically Registering an SLD

While using GeoServer 2.6.2 for a project, I ran into an issue registering a styled layer descriptor (SLD) over the REST interface.

The SLD in question uses a PointSymbolizer, referring to a graphic in the same directory as the SLD. When I login to GeoServer’s administrative interface, I can easily create the SLD from scratch, and everything validates/saves/displays as expected. Original SLD.

Continue reading

banner

Temperature/Humidity Logger

Recently, a need arose to take humidity readings of a crawlspace, over an extended period of time. An Arduino clone called the Bare Bones Board (BBB) is used in this project, mainly for its ability to be mounted to a breadboard.

Using a commercial-off-the-shelf sensor and microSD card, the logger takes temperature and humidity readings at a predefined time interval and writes the readings to a text file on the card. An Octave/MATLAB script is shown that plots the results.

All source code can be found on GitHub.

Continue reading

Banner

Analog Sensor Calibration

Using a simple mathematical formula, it is possible to calibrate analog sensor readings. If you are using a COTS analog sensor, and have access to a high quality, or more reliable sensor, taking several readings can provide a coefficient and offset for calibration.

In this example, a voltage sensor is implemented with a voltage divider. A digital multimeter is used to glean more accurate readings, and a coefficient/offset is generated with Octave/MATLAB.

All source code can be found on GitHub.

Continue reading

banner_04122015

Arduino Mega 2560 R3, ICSP Programming and Bootloader Reload using AVRDUDE

Using an off-board programming tool, it’s possible to program the Arduino Mega 2560 directly through the ICSP pins.

I have a Sparkfun Pocket AVR Programmer at my desk, but according to their documentation as of 04.12.2015, the ATmega2560 is unsupported. Pololu has an inexpensive USB AVR Programmer that is up to task.

Continue reading

banner

jsTree/jQuery, Dynamic Node Addition

jsTree is a jQuery plugin allowing easy integration of interactive trees. Both products are well supported, pervasive and useful. Creating the static jsTree is trivial, but the syntax for dynamically editing the tree after the ‘ready.jstree’ event can be difficult for the newcomer.

My specific use case was to create the tree based on the result from an external web service call. The call finished long after the tree was loaded, so the JSON result needed parsed, and the tree updated.

JSFiddle showing functionality.

Screenshot in case JSFiddle is down:

screenshot

 

Screenshot from 2015-01-18 17:50:51

Using grep to Find Files Containing Text

This command is used to find files in a directory structure containing a target search string. The command line utility ‘grep’ can be found on most modern Unix based systems.

$ grep --exclude=*\.{run,zip,tgz} -nr ./ -e "Hello World"
  • –exclude: multiple file types to ignore.
  • -nr: include line numbers in output display, recurse.
  • ./: search current directory.
  • -e: regular expression to search for follows.
  • “Hello World”: target search string.

Nothing ground-breaking here, this is more for my own documentation; I end up using this just not often enough to memorize it, but often enough I have to Google around a few minutes each time.

Screenshot from 2014-04-27 11:33:56

NOAA Specific Area Message Encoding (SAME)…Geocoded

While working on a web services project I needed to parse Specific Area Message Encoding (SAME) geocodes from NOAA (Wikipedia) (NOAA). Specifically, I needed to be able to parse the six-digit geocodes from HERE, and get a lat/lon back. From what I can tell, this list won’t be changing much, so server side geocoding is preferred. I figured this had been done by someone, somewhere…yet looking through NOAA’s official documentation and Googling did not result in geocoded geocodes.

Using Java stub code and the Google Geocoding API, I generated a geocoded list of each entry…

Local Copy of Original List: SameCode.txt
Geocoded Version: SameCodeGeocoded.txt

Technical notes:
0. The string delimiter is now a semicolon.
1. This list is up to date as of 04.27.2014.
2. The Google Geocoding API only allows 2500 queries a day for personal use. I split up the list and ran the code twice over a 48 hour period.
3. The API had some trouble with a few of the U.S. Pacific Islands, using Google Earth and Wikipedia, I hand annotated those ones (less than half a dozen).

header

Weather Underground Web API using C#, Part 2

For part 2 of the Weather Underground API post, I’ll be taking weather data, and injecting it into a KML file. The Keyhole Markup Language (KML) is an XML based format that allows geographic data e.g. lines, points, polygons, to be easily seen in compatible viewers.

Using the previous post as a starting point, we’ll be adding:

  • Front Matter. Starts the KML file, defines the encoding, has a concise description of the file.
  • Style Section. Defines the way the balloons and text will look in the KML file.
  • KML Encoding. The information from the Wunderground API call is encapsulated in pertinent KML.
  • System.IO.File. Is used to write the output file.

Continue reading