Skip to content

Instantly share code, notes, and snippets.

View foo4u's full-sized avatar

Scott Rossillo foo4u

View GitHub Profile
@foo4u
foo4u / 30_docker_ports.config
Last active July 6, 2023 00:45
Infinispan on Amazon AWS Beanstalk (should work with vanilla EC2 and ECS)
files:
/opt/elasticbeanstalk/hooks/appdeploy/post/10_docker_nat.sh:
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
set -u # Fail on unset variables
set -e # Fail if any command fails
PATH="$PATH:/sbin:/usr/bin"
@foo4u
foo4u / Wildfly.xml
Last active March 11, 2016 14:10
Wildfly Code Style for IntelliJ
<code_scheme name="Wildfly">
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="9999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="9999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value>
<package name="org.junit.Assert" withSubpackages="false" static="true" />
<package name="org.rendersnake.HtmlAttributesFactory" withSubpackages="false" static="false" />
<package name="org.mockito.Mockito" withSubpackages="true" static="true" />
@foo4u
foo4u / Partitioner.java
Created April 14, 2014 22:20
Provides a solution to the "Minimum Cuts for Palindrome Partitioning" problem http://basicalgos.blogspot.com/2013/03/67-palindrome-partitioning.html
/**
* Provides methods to determine minimum the number of cuts
* required to split a string into palindromes.
*
* @author Scott Rossillo
*/
public final class Partitioner {
/**
@foo4u
foo4u / headers.sh
Created October 14, 2013 17:40
Simple bash function using wget to print out headers (just add to .bashrc)
function headers {
wget -O /dev/null -S -q $1
}
@foo4u
foo4u / mmsagent.service
Last active December 24, 2015 19:09
MongoDB Monitoring Agent systemd service
[Unit]
Description=MongoDB Monitoring Agent
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
ExecStart=/usr/bin/python /var/lib/mmsagent/mms-agent/agent.py
Restart=always
User=mmsagent
@foo4u
foo4u / update.js
Created August 26, 2013 23:45
Editing each element in a MongoDB collection returned by find() using an integer to assign a unique value to a string field.
var foo = 0;
db.collection.find().forEach( function(doc) { doc.slug = (++foo).toString(); db.collection.save(doc); } )