command line

Scala: How to give SBT more memory (RAM) to work with

As a brief note, I was trying to run a Scala application inside SBT today and kept getting this “out of memory” error:

[error] (run-main-0) java.lang.OutOfMemoryError: GC overhead limit exceeded
java.lang.OutOfMemoryError: GC overhead limit exceeded

The solution to the problem was to allocate more memory when I start SBT. To give SBT more RAM I first issue this command at the command line:

How to manually specify the custom location of a Typesafe Config configuration file alvin May 12, 2018 - 6:19pm

If you need to manually specify the custom location of a Lightbend Config configuration file when running a Scala or Java application, I can confirm that this java command setting works:

java -Dconfig.file=my_app.conf [the rest of your app parameters]
     -------------------------

In my case I read the Lightbend Config file like this in my Scala application:

How to install and remove Drupal 8 modules at the command line with Composer

I find Drupal 8 module management to be confusing, but one thing I’ve learned is that you can install and remove Drupal 8 modules with Composer at the command line.

Adding a Drupal 8 module with Composer

The short story is that to add a new module — such as the reCAPTCHA anti-spam module — you type this command at the command line (in the root directory of your Drupal 8 website) to install it:

How to change the Mac Terminal title from the command line alvin December 14, 2017 - 9:23am

Mac Terminal FAQ: How can I change the title on the Mac Terminal app from the Mac/Unix command line?

I've been working on a project where I have three Mac Terminal tabs open at one time, and I found it was much easier to work this way when I changed the title on each Terminal window. This helped me easily identify what I was doing in each Terminal window.

Changing the Mac Terminal title

The basic escape sequence you need to change the Terminal title from the command line is this:

How to set the SBT logging level

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.13, “Setting the SBT Log Level.”

Problem

You’re having a problem compiling, running, or packaging your project with SBT, and need to adjust the SBT logging level to debug the problem. (Or, you’re interested in learning about how SBT works.)

Solution

Set the SBT logging level in your build.sbt file with this setting:

Teleport: The Unix/Linux ‘cd’ command, improved

Table of Contents1 - The Teleport command2 - Teleport command help3 - For basic use, tp is just like cd4 - Basic teleporting5 - Listing your teleport history6 - Teleport by number7 - Bash completion with Teleport8 - Teleport aliases9 - Adding/creating a teleport alias10 - Using a teleport alias11 - Listing your teleport aliases12 - Removing an alias13 - Teleport command - summary14 - Teleport command - download

Summary: By keeping a history of the directories you've visited, the Teleport command is an improvement on the Unix/Linux cd command. By having a memory, Teleport lets you jump from one directory to any previously visited directory, easily.

January, 2015 Update: The Teleport command now supports Bash completion. For more details on this, see the Github INSTALL.md file.