Skip to content

Instantly share code, notes, and snippets.

@jmsktm
jmsktm / aws-instance-info.sh
Created August 30, 2013 07:01
AWS instance information
#/bin/bash
echo "AMI ID: $(curl http://169.254.169.254/latest/meta-data/ami-id)\n"
echo "AMI LAUNCH INDEX: $(curl http://169.254.169.254/latest/meta-data/ami-launch-index)\n"
echo "AMI MANIFEST PATH: $(curl http://169.254.169.254/latest/meta-data/ami-manifest-path)\n"
echo "BLOCK DEVICE MAPPING: $(curl http://169.254.169.254/latest/meta-data/block-device-mapping/)\n"
echo "HOSTNAME: $(curl http://169.254.169.254/latest/meta-data/hostname)\n"
echo "INSTANCE ACTION: $(curl http://169.254.169.254/latest/meta-data/instance-action)\n"
echo "INSTANCE ID: $(curl http://169.254.169.254/latest/meta-data/instance-id)\n"
echo "INSTANCE TYPE: $(curl http://169.254.169.254/latest/meta-data/instance-type)\n"
echo "KERNEL ID: $(curl http://169.254.169.254/latest/meta-data/kernel-id)\n"
@jmsktm
jmsktm / hostmanager.sh
Last active December 21, 2015 06:59
shell script to resolve hostname on the basis of domain name during server startup.
#!/bin/bash
# Requires two env variables ACETRAVELS_DOMAIN and ACETRAVELS_MINION to be set in /env/environment
# Hostname is set only if the above variables are set and has not been set already
HOSTNAME_RESOLVER_URI="http://config-server.cloud.acetravels.com:3000"
CURRENT=`hostname`
DOMAIN=`echo $ACETRAVELS_DOMAIN`
MINION=`echo $ACETRAVELS_MINION`
if [ "$MINION" == "true" ]; then
if [ -n "$DOMAIN" ]; then
package com.linkedin.dust.renderer;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Writer;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.JavaScriptException;

Requirements:

If you're on OSX you're probably best off using Homebrew to install this stuff:

$ brew install node mongodb

Usage: