Skip to content

Instantly share code, notes, and snippets.

View grenade's full-sized avatar

rob thijssen grenade

View GitHub Profile
@grenade
grenade / questions.md
Last active September 14, 2015 15:07
notes on creating a staging master for 2008 ec2 build testing
  • How do we make new staging masters only accept builds that we want it to? eg: prevent it from burning arbitrary builds?

    catlee: if it's just a staging master, it's fine if it burns

  • what makes it staging? being in the slavealloc staging mysql db or having environment set to preprod?

    catlee: a combination of things: using its own db (a local sqlite db is normal), and setting its configs to the staging configs

  • using the irc bot (:marvin) i set up in #aws:

Friday, September 11th, 2015

{
"env": {
"CommandPromptType": "Cross",
"ExtensionSdkDir": "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1\\ExtensionSDKs",
"Framework40Version": "v4.0",
"FrameworkDir": "C:\\Windows\\Microsoft.NET\\Framework64",
"FrameworkDIR64": "C:\\Windows\\Microsoft.NET\\Framework64",
"FrameworkVersion": "v4.0.30319",
"FrameworkVersion64": "v4.0.30319",
"FSHARPINSTALLDIR": "C:\\Program Files (x86)\\Microsoft SDKs\\F#\\3.1\\Framework\\v4.0\\",
@grenade
grenade / add-ec2-platform-support-relops.md
Last active September 1, 2015 17:36
Things I learned (am learning) while adding platform support for Windows Server 2008 in RelOps

Add support for a new platform in RelOps

Parent AMI

The first thing we need is an EC2 AMI to base the new platform instances on (this is not the Golden AMI, it is the parent of the Golden AMI). In the case of Windows Server 2008, Q & Mark had already created a suitable parent AMI using MDT (- I believe, further documentation as my understanding develops).

Cloud Tools

Cloud Tools contains the tools and configuration for EC2 AMI (and instance) creation.

Platform Configuration File

@grenade
grenade / color_chart.sh
Created August 15, 2015 15:38
Bash color chart. Useful for creating a better [PS1](https://gist.github.com/grenade/fbb22fbb774ce3df8add)
#!/bin/bash
useage() {
printf "\n\e[1;4mAscii Escape Code Helper Utility\e[m\n\n"
printf " \e[1mUseage:\e[m colors.sh [-|-b|-f|-bq|-fq|-?|?] [start] [end] [step]\n\n"
printf "The values for the first parameter may be one of the following:\n\n"
printf " \e[1m-\e[m Will result in the default output.\n"
printf " \e[1m-b\e[m This will display the 8 color version of this chart.\n"
printf " \e[1m-f\e[m This will display the 256 color version of this chart using foreground colors.\n"
printf " \e[1m-q\e[m This will display the 256 color version of this chart without the extra text.\n"
@grenade
grenade / .bashrc
Last active August 24, 2021 08:40
My PS1 implementation, documented
# ...
# User specific aliases and functions
export VCP_PREFIX="{ "
export VCP_NAME="{symbol}" # You can use "value" or "symbol" here
export VCP_BRANCH="{blue}{value}{reset}"
export VCP_OPERATION="{red}{value}{reset}"
export VCP_BEHIND="↓{value}"
export VCP_AHEAD="↑{value}"
export VCP_SEPARATOR="|"
<powershell><#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
.Synopsis
Bootstrap an AWS EC2 instance with cloud-tools (https://github.com/mozilla/build-cloud-tools)
.Description
This script will do the following when run:
- log output to the puppet mailing list, to enable debugging
- check and/or correct the hostname if required
@grenade
grenade / keyring_to_json.py
Created August 3, 2015 14:50
Should produce a json file containing secrets from the gnome keyring, but it doesn't. --http://stackoverflow.com/questions/31785239/serialise-child-collections-in-python-with-jsonpickle
#! /usr/bin/env python
import secretstorage
import jsonpickle
class Secret(object):
label = ""
username = ""
password = ""
@grenade
grenade / mass_password_reset.py
Last active August 29, 2015 14:26
This loopy bit of python will change multiple Gnome Keyring (Chrome on Linux) passwords in one go.
#! /usr/bin/env python
# use this script at your own risk. it works for me, but if it eats your homework and kills your dog, it's on you.
import secretstorage
# important: always run this script at least once with `mock_run_only = True` first to understand what would be changed.
mock_run_only = True
# leave empty if you only want to replace all old_passwords with new_password regardless of username
#--------------------
#
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
#
<powershell>
<#
.Synopsis
Bootstrap an AWS EC2 instance with cloud-tools (https://github.com/mozilla/build-cloud-tools)
.Description
This script will do the following when run:
- log output to the puppet mailing list, to enable debugging
- check and/or correct the hostname if required
- check and/or correct the primary dns suffix
- check and/or correct the nxlog aggregator configuration