Skip to content

Instantly share code, notes, and snippets.

# change the yarn bucket name
OPTIONS="--bootstrap-action s3://elasticmapreduce/bootstrap-actions/configure-hadoop"
OPTIONS="${OPTIONS} --args -y,yarn.log-aggregation-enable=true,-y,yarn.log-aggregation.retain-seconds=-1,-y,yarn.log-aggregation.retain-check-interval-seconds=3000,-y,yarn.nodemanager.remote-app-log-dir=s3://your-bucket/emr/yarn-logs"

Keybase proof

I hereby claim:

  • I am cwensel on github.
  • I am cwensel (https://keybase.io/cwensel) on keybase.
  • I have a public key ASBqoJBj_Oaqu3SaUaTWJxzehB-i1AtD1hGnd8HSKsu8hQo

To claim this, I am signing this object:

import java.io.IOException;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
import cascading.CascadingException;
import cascading.tuple.coerce.Coercions;
import cascading.tuple.type.CoercibleType;
import cascading.util.Util;
import com.fasterxml.jackson.core.JsonProcessingException;
@cwensel
cwensel / tupleStreams.java
Last active March 22, 2017 06:12
Tuple Streams
long count = TupleEntryStream.entryStream( tap, flowProcess ).count();
assertEquals( 20, count );
int sum = TupleEntryStream.entryStream( tap, flowProcess )
.mapToInt( TupleEntryStream.fieldToInt( Fields.FIRST ) )
.sum();
assertEquals( 210, sum );
@cwensel
cwensel / S3LogsViaKafka.java
Last active September 15, 2017 21:23
Two Cascading Flows, first to read from S3 into a Kafka queue, second to read from the queue to a partitioned directory structure.
public class S3LogsViaKafka
{
public static final String DD_MMM_YYYY = "dd-MMM-yyyy";
public static final TimeZone UTC = TimeZone.getTimeZone( "UTC" );
public static final DateType DMY = new DateType( DD_MMM_YYYY, UTC );
public static final Fields KEY = new Fields( "date", DMY );
public static final Fields LINE = new Fields( "line", String.class );
public static final Fields KEY_LINE = KEY.append( LINE );
public static void main( String[] args )
@cwensel
cwensel / Export all.omnijs
Created April 10, 2020 17:20
Export all Omnigraffle canvases as images
/*{
"type": "action",
"description": "Export images from current document.",
"label": "Export Canvases",
"paletteLabel": "Export Canvases"
}*/
var _ = function () {
var action = new PlugIn.Action(function (selection) {
@cwensel
cwensel / cliw.sh
Created March 11, 2021 17:53
Docker CLI Wrapper
#!/usr/bin/env sh
APP_NAME="app"
USER_OPT=$(id -u $(logname)):$(id -g $(logname))
if [ -n "${ENTRY_BASH}" ]; then
ENTRY_OPT="--entrypoint /bin/bash"
fi
@cwensel
cwensel / cdk.json
Last active October 11, 2023 18:29
{
"app": "${PROJECT_HOME}/gradlew -q run ${GRADLE_OFFLINE_OPTION}",
"output": "build/cdk.out"
}
{
"app": "${PROJECT_HOME}/gradlew -q run ${GRADLE_OFFLINE_OPTION}",
"output": "build/cdk.out"
}
@cwensel
cwensel / DurationConverter.java
Created November 9, 2023 20:52
Uses mini-parsers-temporal library to add duration strings to config files
import heretical.parser.temporal.DurationParser;
import org.eclipse.microprofile.config.spi.Converter;
import java.time.Duration;
/**
* Uses <a href="https://github.com/Heretical/mini-parsers">Mini-Parsers</a> to parse a duration string
* in a config file.
*/
public class DurationConverter implements Converter<Duration> {