configuration

How to turn off (disable) Akka logging

Using Akka logging is a great thing, until you need to turn it off. In short, to disable Akka logging, you need to create a file named application.conf in your SBT src/main/resources folder, and set the loglevel to “OFF” in that file, like this:

Nginx configuration: How to drop the query string on a rewrite

As a quick note, if you need to drop the query string when configuring an Nginx rewrite request, this syntax works:

rewrite ^/foo/bar.*$  /bar?  permanent;

The key is to use the ? character at the end of the URL/URI you are redirecting users to. That drops the query string, so the user will be redirected to the exact /bar URI.

For more information, see the Nginx rewrite module page.

How to use a my.cnf configuration file with MAMP/MySQL

I don’t know why, but I was unable to get MySQL under MAMP 3.5 to read a my.cnf configuration file. I put that file in all of the usual places, but it wasn’t read. Then I tried to get it to read my configuration file by modifying this MAMP/MySQL startup script:

/Applications/MAMP/bin/startMysql.sh

but all I got then was an error message that these two options don’t work:

--defaults-file=FILE
--defaults-extra-file=FILE

I got those errors even though those options are shown in the mysqld_safe help output:

How to disable Drupal 8 Twig debugging

Twig debugging in Drupal 8 is great — really great — when you need it as you’re developing a new Drupal 8 theme. But when you don’t need it, it generates a lot of extra output in your HTML that gets in the way of working on your theme development.

So, as a quick note to self, to disable (turn off) Drupal 8 Twig debugging, follow these steps:

How to configure SBT to work with Eclipse alvin June 21, 2015 - 11:14am

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a short recipe, Recipe 18.7, “How to configure SBT to work with Eclipse.”

Problem

You want to use Eclipse with a project you’re managing with SBT.

Solution

Use the Scala IDE for Eclipse project so you can work on Scala projects in Eclipse, and use the “sbteclipse” plug-in to enable SBT to generate files for Eclipse.

How to create an SBT project with subprojects alvin June 21, 2015 - 11:12am

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a short recipe, Recipe 18.6, “How to create an SBT project with subprojects.”

Problem

You want to configure SBT to work with a main project that depends on other subprojects you’re developing.

Solution

Create your subproject as a regular SBT project, but without a project subdirectory. Then, in your main project, define a project/Build.scala file that defines the dependencies between the main project and subprojects.

How to read a YAML configuration file in Scala

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 12.6, “How to read a YAML configuration file in Scala.”

Problem

You need to read a YAML configuration file in a Scala application.

How to restore an Android emulator to its initial "factory" settings (wipe the data)

To restore an Android emulator to its initial, default settings, you need to find its “image” file on your filesystem and delete it. The image file will be found in your $HOME/.android/avd/<avdname>.avd folder.

For example, I was just working with an AVD named Nexus_6_API_21, and its directory on my Mac OS X system is /Users/al/.android/avd/Nexus_6_API_21.avd. I moved into that directory and found several “.img” files, deleted them, and then restarted the emulator, and it went back to its default settings.