Skip to content

Instantly share code, notes, and snippets.

View grenade's full-sized avatar

rob thijssen grenade

View GitHub Profile
#!/bin/bash
# gnome setup
curl -L https://gist.github.com/grenade/ba62d9a0369fe9a7bed5/raw/01-gnome-setup.sh | sh
# vcs setup
curl -L https://gist.github.com/grenade/ba62d9a0369fe9a7bed5/raw/02-vcs-setup.sh | sh
# secrets setup
curl -L https://gist.github.com/grenade/ba62d9a0369fe9a7bed5/raw/03-secrets-setup.sh | sh

Keybase proof

I hereby claim:

  • I am grenade on github.
  • I am grenade (https://keybase.io/grenade) on keybase.
  • I have a public key whose fingerprint is 1C09 AC24 C113 C7F0 80DD 4AA5 B3C5 A958 508A 43F2

To claim this, I am signing this object:

  • what is allthethings.json? why is it useful? how do i use it?
  • how can you tell wether the trees are open or closed? where can you check the reason for a closure?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@grenade
grenade / rdp.sh
Last active January 13, 2016 08:52
create an rdp session to an ec2 or ix windows instance using password-store and awscli to effortlessly manage instance passwords
#! /bin/bash
# usage:
# $ rdp cltbld@b-2008-ec2-0999
# $ rdp b-2008-ec2-0999
# $ kb=en-us rdp b-2008-ec2-0999
res=${res:=2400x1200}
kb=${kb:=en-gb}
key=${key:=~/.ssh/aws-ssh-key}
$EC2SettingsFile='C:\Program Files\Amazon\Ec2ConfigService\Settings\Config.xml'
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
$xmlElementToModify = $xmlElement.Plugins
foreach ($element in $xmlElementToModify.Plugin){
if ($element.name -eq 'Ec2SetPassword') {$element.State='Enabled'}
elseif ($element.name -eq 'Ec2HandleUserData') {$element.State='Enabled'}
elseif ($element.name -eq 'Ec2DynamicBootVolumeSize') {$element.State='Enabled'}
}
$xml.Save($EC2SettingsFile)
function Set-PagefileSize {
<#
.Synopsis
#>
param (
[int] $initialSize = 1024,
[int] $maximumSize = 1024
)
$pf = Get-WmiObject -Query "Select * From Win32_PageFileSetting Where Name='c:\\pagefile.sys'"
if (($initialSize -ne $pf.InitialSize) -or ($maximumSize -ne $pf.MaximumSize)) {
@grenade
grenade / setup.ps1
Last active September 21, 2015 11:22
Set-ExecutionPolicy RemoteSigned
& 'C:\Program Files\Amazon\Ec2ConfigService\Scripts\UserScript.ps1'
function Install-BundleClone {
param (
[string] $url = 'https://hg.mozilla.org/hgcustom/version-control-tools/raw-file/default/hgext/bundleclone/__init__.py',
[string] $path = 'C:\mozilla-build\hg',
[string] $filename = 'bundleclone.py',
[string] $hgrc = 'C:\Users\cltbld\.hgrc'
)
if (Test-Path $path) {
$target = ('{0}\{1}' -f $path, $filename)
if (Test-Path $target) {
  • We can't use the 2008-spot names for manually created instances. It confuses cloud-tools (we spin up duplicate instances when cloud-tools finds the enabled slave name). We can use the on-demand instance names (buildbot: staging, production):
    • staging parallel builds, not reported in treeherder (ensure locked_masterid == 372 in slavealloc):
      • us-east-1:
        • build: b-2008-ec2-0990 - b-2008-ec2-0994
        • try: y-2008-ec2-0990 - y-2008-ec2-0994
      • us-west-2:
        • build: b-2008-ec2-0995 - b-2008-ec2-0999
        • try: y-2008-ec2-0995 - y-2008-ec2-0999
    • production primary builds, reported in treeherder (remove locked_masterid in slavealloc):
  • us-east-1: