old_contents:
#!/bin/ash
echo "compiling... be patient"
gccgo -o go `ls *.go | grep -v signal_notunix.go | grep -v _test.go | grep -v bootstrap | grep -v doc` -static-libgo

new_contents:
#!/bin/ash
echo "compiling... be patient"
gccgo -Wl,-t -v -o go `ls *.go | grep -v signal_notunix.go | grep -v _test.go | grep -v bootstrap | grep -v doc` -static-libgo

subject: improve autogen

message: improve autogen

repos: michalliu/faux-go,michalliu/faux-go


old_contents:
#!/bin/ash
#
# startscript: normaly run it only once
# (c) 2015/2016 sosyco@googlemail.com  www.sosyco.de
#
# enhance the repositories and update the system
if ! [ -f "/etc/apk/repositories.org" ];
then
  cp /etc/apk/repositories /etc/apk/repositories.org
  sed -ni 'p; s/\/main/\/community/p' /etc/apk/repositories
fi
apk update
apk upgrade
apk add git sudo docker
rc-update add docker boot

# add new user "dockeradmin" without password
# and generate sshkeys
getent passwd dockeradmin > /dev/null 2&>1
if ! [ $? -eq 0 ];
then
  ssh-keygen -f dockeradmin -t rsa -b 4096 -C dockeradmin -N ''
  adduser -D dockeradmin
  mkdir -p /home/dockeradmin/.ssh/
  cp dockeradmin.pub /home/dockeradmin/.ssh/authorized_keys
  chmod 700 -R /home/dockeradmin/.ssh
  chown dockeradmin.dockeradmin -R /home/dockeradmin/.ssh
  echo "dockeradmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
  adduser dockeradmin docker
fi
sed -i "s/DOCKER_OPTS.*/DOCKER_OPTS=\"--bip=192.168.199.1\/24\"/" /etc/conf.d/docker
echo "don't forget to save the private sshkey: dockeardmin"

new_contents:
#!/bin/ash
#
# startscript: normaly run it only once
# (c) 2015/2016 sosyco@googlemail.com  www.sosyco.de
#
# enhance the repositories and update the system
if ! [ -f "/etc/apk/repositories.org" ];
then
  cp /etc/apk/repositories /etc/apk/repositories.org
  sed -ni 'p; s/\/main/\/community/p' /etc/apk/repositories
fi
apk update
apk upgrade
apk add git sudo docker
rc-update add docker boot

# add new user "dockeradmin" without password
# and generate sshkeys
getent passwd dockeradmin > /dev/null 2&>1
if ! [ $? -eq 0 ];
then
  ssh-keygen -f dockeradmin -t rsa -b 4096 -C dockeradmin -N ''
  adduser -D -S /bin/ash dockeradmin
  sed -i "s/dockeradmin\:!/dockeradmin\:/g" /etc/shadow
  mkdir -p /home/dockeradmin/.ssh/
  cp dockeradmin.pub /home/dockeradmin/.ssh/authorized_keys
  chmod 700 -R /home/dockeradmin/.ssh
  chown dockeradmin.dockeradmin -R /home/dockeradmin/.ssh
  echo "dockeradmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
  adduser dockeradmin docker
fi
sed -i "s/DOCKER_OPTS.*/DOCKER_OPTS=\"--bip=192.168.199.1\/24\"/" /etc/conf.d/docker
echo "don't forget to save the private sshkey: dockeardmin"

# generate containeradmin (if we need one)
sh-keygen -f containeradmin -t rsa -b 4096 -C containeradmin -N ''
mkdir -p /home/dockeradmin/container/ssh/containeradmin
cp containeradmin.pub /home/dockeradmin/container/ssh/containeradmin/authorized_keys
cp containeradmin /home/dockeradmin/.ssh/containeradmin
chmod 700 -R /home/dockeradmin/.ssh
chown dockeradmin.dockeradmin -R /home/dockeradmin/.ssh
chmod 755 -R /home/dockeradmin/container/ssh/containeradmin

subject: Update installation.ash

message:
Update installation.ash

add central containeradmin-account

repos: sosyco/alpine-dockerhost


old_contents:
#!/usr/bin/env ash

# Variables
BITS=${BITS:-'2048'}
CERT_DIR=${CERT_DIR:-'/etc/ssl/certs'}
DAYS=${DAYS:-'365'}
FQDN=${FQDN:-"example.churchoffoxx.net"}

# Functions

## Create the PEM format file
create_pem()
{
  cat ${CERT_DIR}/${FQDN}.crt ${CERT_DIR}/${FQDN}.key | tee ${CERT_DIR}/${FQDN}.pem
}

## Create the certificate
generate_cert()
{
  # Create the key and CSR
  openssl req -nodes \
    -newkey rsa:${BITS} \
    -keyout ${CERT_DIR}/${FQDN}.key \
    -out ${CERT_DIR}/${FQDN}.csr \
    -subj "/C=US/ST=State/L=Town/O=Church of Foxx/OU=Example/CN=${FQDN}"

  # Sign the CSR
  openssl x509 -req \
    -days ${DAYS} \
    -in ${CERT_DIR}/${FQDN}.csr \
    -signkey ${CERT_DIR}/${FQDN}.key \
    -out ${CERT_DIR}/${FQDN}.crt
}

## Check if the cert directory exists
make_cert_dir()
{
  # Create the directory if it doesn't exist yet
  if [[ -n ${CERT_DIR} ]]; then
    mkdir -p ${CERT_DIR}
  fi
}

## Display usage information
usage()
{
  echo "Usage: [Environment Variables] generate_ssl_cert.ash [options]"
  echo "  Environment Variables:"
  echo "    FQDN                fully qualified domain name of the server (default: example.churchoffoxx.net)"
}

# Logic

## Argument parsing
while [[ "$1" != "" ]]; do
  case $1 in
    -h | --help ) usage
                  exit 0
                  ;;
    * )           usage
                  exit 1
  esac
  shift
done

make_cert_dir
generate_cert
create_pem

new_contents:
#!/usr/bin/env ash

# Variables
BITS=${BITS:-'2048'}
CERT_DIR=${CERT_DIR:-'/etc/ssl/certs'}
DAYS=${DAYS:-'365'}
FQDN=${FQDN:-"example.churchoffoxx.net"}

# Functions

## Create the PEM format file
create_pem()
{
  cat ${CERT_DIR}/${FQDN}.crt ${CERT_DIR}/${FQDN}.key | tee ${CERT_DIR}/${FQDN}.pem
}

## Create the certificate
generate_cert()
{
  # Create the key and CSR
  openssl req -nodes \
    -newkey rsa:${BITS} \
    -keyout ${CERT_DIR}/${FQDN}.key \
    -out ${CERT_DIR}/${FQDN}.csr \
    -subj "/C=US/ST=State/L=Town/O=Church of Foxx/OU=Example/CN=${FQDN}"

  # Sign the CSR
  openssl x509 -req \
    -days ${DAYS} \
    -in ${CERT_DIR}/${FQDN}.csr \
    -signkey ${CERT_DIR}/${FQDN}.key \
    -out ${CERT_DIR}/${FQDN}.crt
}

## Check if the cert directory exists
make_cert_dir()
{
  # Create the directory if it doesn't exist yet
  if [[ -n ${CERT_DIR} ]]; then
    mkdir -p ${CERT_DIR}
  fi
}

## Display usage information
usage()
{
  echo "Usage: [Environment Variables] generate_ssl_cert.ash [options]"
  echo "  Environment Variables:"
  echo "    BITS                bits for the certificate (default: '2048')"
  echo "    CERT_DIR            directory to output to (default: '/etc/ssl/certs')"
  echo "    DAYS                days the cert is valid for (default: '365')"
  echo "    FQDN                fully qualified domain name of the server (default: example.churchoffoxx.net)"
}

# Logic

## Argument parsing
while [[ "$1" != "" ]]; do
  case $1 in
    -h | --help ) usage
                  exit 0
                  ;;
    * )           usage
                  exit 1
  esac
  shift
done

make_cert_dir
generate_cert
create_pem

subject: Update generate_ssl_cert.ash

message: Update generate_ssl_cert.ash


new_contents:
#!/bin/ash
echo "compiling... be patient"
gccgo -o go `ls *.go | grep -v signal_notunix.go | grep -v _test.go | grep -v bootstrap | grep -v doc` -static-libgo

subject: add autogen.ash

message: add autogen.ash


new_contents:
notify "LeaChim";

import "lar-forecasting.ash";

boolean [location] quest_relevant_locations = $locations[
  the spooky forest,
  the dark neck of the woods,
  the dark heart of the woods,
  the dark elbow of the woods,
  the black forest,
  whitey's grove,
  the hidden temple,
  8-bit realm,
  the old landfill,
  the hidden park,
  the hidden apartment building,
  the hidden office building,
  the hidden bowling alley,
  the hidden hospital,
  the sleazy back alley,
  the haunted pantry,
  the haunted kitchen,
  the haunted billiards room,
  the haunted library,
  the haunted conservatory,
  the haunted gallery,
  the haunted bathroom,
  the haunted bedroom,
  the haunted ballroom,
  the haunted laboratory,
  the haunted storage room,
  the haunted nursery,
  the haunted wine cellar,
  the haunted laundry room,
  the haunted boiler room,
  the outskirts of cobb's knob,
  the bat hole entrance,
  guano junction,
  the batrat and ratbat burrow,
  the beanbat chamber,
  cobb's knob barracks,
  cobb's knob kitchens,
  cobb's knob harem,
  cobb's knob treasury,
  the "fun" house,
  inside the palindome,
  the degrassi knoll restroom,
  the degrassi knoll gym,
  the degrassi knoll bakery,
  the degrassi knoll garage,
  the unquiet garves,
  the defiled nook,
  the defiled niche,
  the defiled cranny,
  the defiled alcove,
  the penultimate fantasy airship,
  the castle in the clouds in the sky (basement),
  the castle in the clouds in the sky (ground floor),
  the castle in the clouds in the sky (top floor),
  the hole in the sky,
  infernal rackets backstage,
  the laugh floor,
  pandamonium slums,
  the goatlet,
  Itznotyerzitz Mine,
  lair of the ninja snowmen,
  the extreme slope,
  the icy peak,
  the smut orc logging camp,
  a-boo peak,
  twin peak,
  the obligatory pirate's cove,
  barrrney's barrr,
  the f'c'le,
  the poop deck,
  belowdecks,
  frat house,
  frat house in disguise,
  wartime frat house,
  wartime frat house (hippy disguise),
  hippy camp,
  hippy camp in disguise,
  wartime hippy camp,
  wartime hippy camp (frat disguise),
  sonofa beach,
  next to that barrel with something burning in it,
  near an abandoned refrigerator,
  over where the old tires are,
  out by that rusted-out car,
  the battlefield (frat uniform),
  the battlefield (hippy uniform),
  the arid\, extra-dry desert,
  the oasis,
  the upper chamber,
  the middle chamber,
];

int desired_turns = 500;

void main() {
  print("Coverage for " + desired_turns + " turns:");
  print ("Location, Combat/non-combat, monster name (out of the combat encounters)");
  foreach loc in quest_relevant_locations {
    int cnc_found = 0;
    int combat_found = 0;
    int monster_found = 0;
    for turn from 0 to desired_turns {
      if(lar_encounter_known_is_combat(loc, turn)) {
        cnc_found += 1;

        if(lar_encounter_is_combat(loc, turn)) {
          combat_found +=1;
        }

        if(lar_encounter_known_monster(loc, turn)) {
          monster_found += 1;
        }
      }
    }

    // Report
    print(loc + ": " + (cnc_found * 100 / desired_turns) + "%, " + (monster_found * 100 / (combat_found + 1)) + "%");
  }
}

subject: Add coverage script, to keep tabs on how far along the data is