Skip to content

Instantly share code, notes, and snippets.

View grenade's full-sized avatar

rob thijssen grenade

View GitHub Profile
function Write-Log {
param (
[string] $message,
[string] $logPath = [IO.Path]::Combine([IO.Path]::Combine(('{0}\' -f $env:SystemDrive), 'gpo_files'), 'log'),
[string] $logFile = [IO.Path]::Combine($logPath, 'update-nxlog.log'),
[string] $severity = 'INFO'
)
if (!(Test-Path $logPath)){
New-Item -ItemType Directory -Force -Path $logPath
}
@grenade
grenade / contribute-to-puppet.md
Last active February 23, 2017 10:56
Workflow for PuppetAgain hg contributions
#!/usr/bin/python
# 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/.
# MOZILLA DEPLOYMENT NOTES
# - This file is distributed to all buildslaves by Puppet, placed at
# /usr/local/bin/runslave.py on POSIX systems (linux, darwin) and
# C:\runslave.py on Windows systems
  • put all package versions in a folder named with the package id (or find a mechanism for extracting distinct package names in bash)
  • update manifest generator to only parse latest versions of packages
  • create a transform that generates the package html description
  • create a transform that generates a package index html page
16:41 <~bhearsum> i've got what's probably a silly puppet question...i just noticed that we have some "classes" (like https://github.com/mozilla/build-puppet/blob/master/modules/slave_secrets/manifests/init.pp) that take arguments, and now i'm not sure when to use class foo() vs. define foo(). https://docs.puppetlabs.com/guides/best_practices.html#classes-vs-defined-types doesn't seem to talk about classes with args
16:50 <dustin> "Thank you for your try submission. It's the best!"... always seems way too optimistic to me
16:50 <dustin> bhearsum: a class can only exist once on a host
16:50 <dustin> a define can exist multiple times
16:50 <dustin> "is-a" vs "has-a"
16:50 <dustin> parameterized classes weren't the bestest idea in puppet
16:50 <dustin> but the idea is
16:50 <dustin> include webserver
16:51 <dustin> means "this is a webserver"
16:51 <dustin> website { "trychooser": root => "/data/www/trychooser", .. }
#!/usr/bin/env python
# tooltool is a lookaside cache implemented in Python
# Copyright (C) 2011 John H. Ford <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation version 2
#
# This program is distributed in the hope that it will be useful,
@grenade
grenade / bootstrap-cloud-tools.md
Last active January 13, 2016 08:56
These instructions can be used for creating a local cloud tools working environment (bootstrap-cloud-tools) and spawning a new windows 2008 instance (create-instance).

Create a Mozilla-AWS working environment

Note: This depends on you having valid key credentials on aws-manager1 and a VPN connection to scl3.

tl;dr

Run this one liner, to skip all the steps below:

curl -L https://gist.githubusercontent.com/grenade/147ca1cae1c70102ddf9/raw/bootstrap-cloud-tools.sh | sh
@grenade
grenade / .bash_profile
Created June 24, 2015 19:00
vcprompt (git/hg/svn bash PS1)
D=$'\e[37;40m'
VIOLET=$'\e[35;40m'
GREEN=$'\e[32;40m'
YELLOW=$'\e[33;40m'
RED=$'\e[33;31m'
export VCPROMPT_FORMAT="[${VIOLET}%n${D}:${YELLOW}%b${D}:${GREEN}%r${D}] ${RED}%u%m${D}"
export PS1='\u@\h $(vcprompt)\$ '
#! /bin/bash
# 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/.
# usage:
# $ SANDBOX="/builds/aws_manager" ENV="bld" PLATFORM="win" ARCH="64" TARGET_HOST="$ENV-2008-ec2-golden" /builds/aws_manager/a0bab1937fbc8f06cfff/register.sh
echo "Attempting IP allocation and DNS mapping"
@grenade
grenade / update_firefox_developer_edition.sh
Last active August 10, 2024 22:29 — forked from simonewebdesign/install_sublime_text.sh
this script is based on another for Sublime Text (http://www.simonewebdesign.it/install-sublime-text-3-on-linux/). It will handle updates (detects the latest developer or nightly edition) and locale (using your $LANG environment variable) (only tested on a 64 bit, fedora system, feedback welcome).
#!/bin/sh
# Firefox Developer Edition install
# No need to download this script, just run it on your terminal:
# $ curl -L git.io/firefoxdev | sh
# When you need to update Firefox Developer Edition, run this script again.
START_CMD="firefox-dev"
INSTALLATION_DIR="/opt/${START_CMD}"