Writing
Cannot find setclasspath.sh when starting up Tomcat 7
In attempting to start Tomcat 7 on my MacBook Pro on El Capitan, I was getting the following error: amp-macbook:Cellar anton$ catalina start Cannot find /usr/local/Cellar/tomcat7/7.0.63/libexec/bin/setclasspath.sh This file is needed to run this program I found the issue to be due to my CATALINA_HOME environment variable. To resolve this, just do the following from your…
Enable root in OS X Yosemite and El Capitan
I needed to do some file moving between users and noticed my admin account didn’t have access, so I tried “su” and “sudo” without success. Apparently, like it Yosemite, root access is disabled by default. Here’s how to enable it: 1. Open Directory Utility (I usually do it via CMD + spacebar, then type "dire")…
Homebrew: How to install on OS X
Since moving to OS X in 2011/2012 for work to do all my development, I’ve moved Homebrew to a must-have. Adding it here for archiving purposes. From a terminal: 1. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2. brew tap caskroom/cask The 2nd point is to install Homebrew Cask as well, which extends Homebrew’s functionality. Now get…
How to install jshell via Homebrew
At the time of this writing, Java 9 is in beta. I installed because I wanted to check out jshell, Java’s new REPL (read-evaluate-print-loop). On top of the below, I brew-installed jenv (a must for managing different JDK versions). $ brew install Caskroom/versions/java9-beta $ jenv add /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home $ jenv shell oracle64-9-ea $ java -version java…
Mongo DB: Iterate through a MongoCollection
This is specifically for Mongo 3.x, where MongoCollection is preferred over DBCollection. Adding for personal archiving. MongoCollection<Document> mongoCollection = getMongoCollection(databaseName, collectionName); FindIterable<Document> documents = mongoCollection.find(eq(COLUMN, "lastName")) .sort(ascending("lastname")); for (Document document : documents) { … }
Cucumber-JVM: Running a @Before step only for certain scenarios
You can make use Cucumber’s @Before and @After to execute only for certain scenarios like the below. This is especially useful if you, say, wanted to make a (Mongo) DB connection for a few test scenarios. @Before("@mongo") public void beforeScenario() { // actions } @After("@mongo") public void afterScenario() { // actions } To complete the…