Skip to content

Instantly share code, notes, and snippets.

View grenade's full-sized avatar

rob thijssen grenade

View GitHub Profile
@grenade
grenade / color.sh
Created October 23, 2018 08:33
I don't remember where this script came from (I didn't write it), but it's a hoot.
#!/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"
#!/bin/bash -e
shopt -s extglob
aws_profile=occ-taskcluster
aws_region=us-west-2
aws_key_name=occ_ami_builder
aws_instance_type=c4.2xlarge
declare -A aws_instance_export_tasks
#!/bin/bash
tip=ce24611f29dc
work_dir=~/hg/iso-to-ami-1703
commit_message="Bug 1474548 - test win10 1703 build 15063.296; try: -b do -p win64 -u all -t none"
hg robustcheckout --sharebase ~/hg/hg.m.o/m-u --purge --upstream https://hg.mozilla.org/mozilla-unified --revision ${tip} https://hg.mozilla.org/mozilla-central ${work_dir}
cd ${work_dir}
hg import https://hg.mozilla.org/try/raw-rev/8c6380ee0c4c --no-commit
hg commit -m ${commit_message}
deployment_task_id=dRak30YeSrq5fRzmgBChFA
task_state=$(curl -s 'https://queue.taskcluster.net/v1/task/${deployment_task_id}/status' | jq -r '.status.state')
while [ "${task_state}" != "completed" ]; do
echo ${task_state}
sleep 60
task_state=$(curl -s 'https://queue.taskcluster.net/v1/task/${deployment_task_id}/status' | jq -r '.status.state')
done;
hg push try -f
import ldap
l = ldap.initialize('ldap://ldap.myserver.com:389')
binddn = 'cn=myUserName,ou=GenericID,dc=my,dc=company,dc=com'
pw = 'myPassword'
basedn = 'ou=UserUnits,dc=my,dc=company,dc=com'
searchFilter = '(&(gidNumber=123456)(objectClass=posixAccount))'
searchAttribute = ['mail','department']
# this will scope the entire subtree under UserUnits
searchScope = ldap.SCOPE_SUBTREE
# bind to the server
# uninstall onedrive
Start-Process -FilePath 'c:\Windows\SysWOW64\OneDriveSetup.exe' -ArgumentList @('/uninstall') -NoNewWindow -Wait
# disable onedrive file sync
New-Item -ItemType Directory -Force -Path 'HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive'
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive' -Name 'DisableFileSyncNGSC' -Value 1
# remove onedrive from explorer menu
New-PSDrive -Name 'HKCR' -PSProvider 'Registry' -Root 'HKEY_CLASSES_ROOT'
Set-ItemProperty -Path 'HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}' -Name 'System.IsPinnedToNameSpaceTree' 0
@grenade
grenade / Get-GoogleChromeMsiProperties.ps1
Last active July 31, 2019 07:32
Extract a Product Name and Product Id (ProductCode) from an MSI file
Remove-Item -Path '.\Get-MSIProperties.ps1' -Force -ErrorAction SilentlyContinue
(New-Object System.Net.WebClient).DownloadFile('https://gist.githubusercontent.com/grenade/3979bb88e8dc224fe9d94f839c59cf8d/raw/Get-MSIProperties.ps1', '.\Get-MSIProperties.ps1')
. .\Get-MSIProperties.ps1
foreach ($installer in @('googlechromestandaloneenterprise.msi', 'googlechromestandaloneenterprise64.msi')) {
Write-Host '----------------------------------------------------'
Write-Host ('.\{0}' -f $installer)
Remove-Item -Path ('.\{0}' -f $installer) -Force -ErrorAction SilentlyContinue
(New-Object System.Net.WebClient).DownloadFile(('https://dl.google.com/tag/s/dl/chrome/install/{0}' -f $installer), ('.\{0}' -f $installer))
$msi = (Get-MSIProperties -Path ('.\{0}' -f $installer))
$msi
@grenade
grenade / install-watchman.sh
Last active June 17, 2020 10:08 — forked from davidmason/install-watchman.bash
To install watchman on Fedora 28, these are all the hoops I had to jump through.
# The following packages are needed during `make`
# - openssl-devel so you don't get:
# ContentHash.cpp:13:10: fatal error: openssl/sha.h: No such file or directory
# - redhat-rpm-config so you don't get:
# gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
# - python-devel so you don't get:
# pywatchman/bser.c:31:10: fatal error: Python.h: No such file or directory
sudo dnf install openssl-devel redhat-rpm-config python-devel libtool
# The rest is just instructions from
launch hvm linux image (not pv)
use screenshot to get bios pic of xen server version during boot
download pv drivers compatible with xen server version
use virtualbox
create image with iso
hci mode, not ide so you get sata hdd
install windows
@grenade
grenade / BanskoGuide.md
Last active March 8, 2018 13:44
Rob's Guide to Bansko and Surroundings

some (nice) places to visit in Bansko and nearby:

  • an old monastery. nice walk and nice place for a picnic if it's not raining. let yourself in through the door in the big white wall. enjoy the drinking water from the tap in the tree: https://goo.gl/maps/nRaJCaixuVR2
  • hotsprings - outdoors, but fun in any weather:
  • in the forest, normally cooler (warm, not hot), clean in morning and early afternoon, murky by evening (pro tip: the big muscly, body-builder, chatting, smiling Bulgarian sometimes loitering nearby is a masseur. he will give you a massage for a small fee):