Skip to content

Instantly share code, notes, and snippets.

View grenade's full-sized avatar

rob thijssen grenade

View GitHub Profile
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):
@grenade
grenade / query-unsplash.sh
Last active November 28, 2019 08:46
create cron jobs: update password store & repos
#!/bin/bash
# add to cron if not in cron list
crontab -l | grep $0 || (crontab -l ; echo "*/2 * * * * $0") | crontab -
# create folders
mkdir -p ${HOME}/Desktop/backgrounds/data ${HOME}/cron/log/$(basename ${0##*/} .sh)
# configuration
access_key=$(pass unsplash/accesskey)
xfreerdp /u:Administrator /p:"$(pass Mozilla/relops/ec2/Administrator@base-win10-64)" /kbd:809 /w:2400 /h:1200 +clipboard /v:54.80.63.132
ec2_profile="taskcluster"
ec2_region="us-east-1"
target_instance_id="i-00000000000000000"
shrink_instance_id="i-99999999999999999"
# determine the device name of the root volume (usually "/dev/sda1")
target_instance_device=$(aws ec2 describe-instance-attribute --profile ${ec2_profile} --region ${ec2_region} --instance-id ${target_instance_id} --attribute rootDeviceName | jq -r '.RootDeviceName.Value')
# determine the ec2 volume id of the root volume