Brad Lucas

Programming, Clojure and other interests

Devnull

June 30, 2017

For testing it is sometimes of interest to have a web service which returns OK for anything that is passed to it much like the null device in Unix. In Unix you can open open the /dev/null device and write to it. It is an empty file that accepts all data written to it without storing the data.

For a web service to act in a similar fashion it would run and accept anything passed as a parameter in urls passed to it.

Clojure

How could such an application be built in Clojure? One way would be to use HTTP Kit and have it return OK for anything that is passed to it.


Continue reading →

Bump Version

June 29, 2017

A script to bump the version number in a pom.xml file.

bump-version.sh

#!/bin/bash

# A script to bump the version number inside a pom.xml file
#

if [ -z "$1" ]
then
    echo ""
    echo "Bump version script for incrementing the version number in a project's pom.xml file."
    echo ""
    echo "Usage: bump-version 'version-string'"
    echo ""
    echo ""
    exit
fi

VER=$1
echo $VER

# enure we have a value 
CMD="mvn versions:set -DnewVersion=$VER"
echo "Executing:"
echo $CMD

mvn versions:set -DnewVersion=$VER


echo "done"


Continue reading →

Diff Heroku Configs

June 28, 2017

Here is a script that was created to diff the configurations between two Heroku apps. This came about when configuring and testing a development and a production Heroku system. In this case you want to know how they differ.

#!/bin/bash

APP1=$1
APP2=$2

CMD="diff <(heroku config --app $APP1) <(heroku config --app $APP2)"
echo $CMD

eval $CMD

Continue reading →

Car Rental Fees And Taxes

June 27, 2017

It looks like fees and taxes for car rentals is out of control. Anyone notice? Here is an example.

I wanted to rent a car for two weeks so I shopped around. It looks like for a car it would be about $360 dollars a week that totalled specifically to $729.30 for two weeks.

Click the button to finalize and the total is $1046. What? There is $317 dollars in taxes and fees. Nearly the price of a week's rental.



|-----------------------------------+-------+---------|
| Compact Suv                       |       |  729.30 |
| Unlimited Mileage                 |       |         |
|-----------------------------------+-------+---------|
|                                   |       |         |
|-----------------------------------+-------+---------|
| TAXES & FEE                       |       |         |
|-----------------------------------+-------+---------|
| Consolidated Facility Chg 6.00/Dy | 84.00 |         |
| Concession Recovery Fee 11.11 Pct | 81.77 |         |
| Wa State Rental Tax 5.9 Pct       | 48.25 |         |
| Rta Tax 0.80 Pct                  |  6.54 |         |
| Sports Facility Tax 1.00 Pct      |  8.18 |         |
| Veh License Cost Recovery .48/Day |  6.72 |         |
| Sales Tax (10.0%)                 | 81.78 |         |
|-----------------------------------+-------+---------|
|                                   |       |  317.24 |
|-----------------------------------+-------+---------|
|                                   |       |         |
| TOTAL                             |       | 1046.54 |
|-----------------------------------+-------+---------|


Continue reading →

All Jobs Tend To Face Time

June 26, 2017

I've noticed that to some extent all jobs tend to face time. Sure, there are exceptions but there is a tendency.

When you hear things like, "90% of the job is just showing up", there might be a clue there.

Large organizations seem to tend to not trust their employees and in return force a culture of face time because that is the simplest way to hold someone accountable.

"Well, at least he/she shows up" keeps many people employeed.


Continue reading →