Skip to content

Instantly share code, notes, and snippets.

View grenade's full-sized avatar

rob thijssen grenade

View GitHub Profile
#!/bin/bash
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
tmp_dir=$(mktemp -d -t XXXXXXXXXX)
build_sha=03d329e58c07abe3ebadbe45651b5936a6f8b13d
tc_task_group_url=$(curl -s https://api.github.com/repos/mozilla-releng/OpenCloudConfig/commits/${build_sha}/statuses | jq -r '.[0].target_url')
tc_task_group_id=$(basename ${tc_task_group_url})
mkdir -p ${script_dir}/latest
#!/bin/bash
# usage:
# curl -sL https://gist.github.com/grenade/ec1e657ae52392756e7ff1827daa68d1/raw/cctv-setup.sh?$(uuidgen) | bash
#sudo dnf install -y https://github.com/kerberos-io/etcher/releases/download/v1.5.70/kerberosio-etcher-electron-1.5.70.x86_64.rpm
sudo dnf install -y pv hdparm unzip
curl -LO https://github.com/hypriot/flash/releases/download/2.7.0/flash
@grenade
grenade / nvidia-driver-reinstall.sh
Last active June 2, 2024 14:25
reinstall nvidia driver from rpm-fusion after a fedora upgrade
#!/bin/bash
# usage:
# curl -sL https://gist.github.com/grenade/8844d472bc1dcec48d37291b0b7b7220/raw/nvidia-driver-reinstall.sh?$(uuidgen) | bash
# uninstall all nvidia packages
sudo dnf erase '*nvidia*'
# disable the nvidia driver that doesn't come from rpm-fusion
# https://rpmfusion.org/Howto/CUDA#Which_driver_Package
---
provisionerId: gecko-1
workerType: b-linux
priority: highest
payload:
image: 'python:3-alpine'
features:
taskclusterProxy: true
command:
- /bin/sh
# written for fedora 32, x86-64
# rpmfusion repos
sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# spotify (from rpmfusion)
sudo dnf install -y lpf-spotify-client
lpf approve spotify-client
retries: 0
created: '2020-06-25T11:39:24.518Z'
deadline: '2020-06-28T11:59:03.691Z'
expires: '2021-06-29T11:59:03.691Z'
provisionerId: relops
workerType: win2019
priority: highest
tags: {}
scopes: []
payload:
$subscription = 'dd0d4271-9b26-4c37-a025-1284a43a4385';
$observations = @{};
foreach ($resourceGroupName in @('taskcluster-staging-workers-us-central')) {
$observations[$resourceGroupName] = @{};
while (($vms = @(Get-AzVm -ResourceGroupName $resourceGroupName -Status)) -or ($vms.Length -gt 0)) {
Write-Output -InputObject ('{0} virtual machines observed in {1}' -f $vms.Length, $resourceGroupName);
foreach ($vm in $vms) {
$name = $vm.Name;
if (-not $observations[$resourceGroupName].ContainsKey($name)) {
$observations[$resourceGroupName][$name] = @{};
sudo dnf install arduino -y
pip3 install esptool
python3 $(which esptool.py)
wget https://micropython.org/resources/firmware/esp32-idf3-20200606-unstable-v1.12-510-g1e6d18c91.bin -o ~/Downloads/esp43/esp32-idf3-20200606-unstable-v1.12-510-g1e6d18c91.bin
sudo python3 ~/.local/bin/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 460800 write_flash --flash_mode dio --verify -z 0x1000 ~/Downloads/esp32/esp32-idf3-20200606-unstable-v1.12-510-g1e6d18c91.bin
foreach ($location in @('EastUS')) {
Get-AzVmSize -Location $location | % {
New-Object -TypeName PSobject -Property @{
Name = $_.Name;
NumberOfCores = $_.NumberOfCores;
MemoryInMB = $_.MemoryInMB;
MaxDataDiskCount = $_.MaxDataDiskCount;
OSDiskSizeInMB = $_.OSDiskSizeInMB;
ResourceDiskSizeInMB = $_.ResourceDiskSizeInMB;
Family = $(switch -regex ($_.Name) {
# usage:
# Invoke-Expression (New-Object Net.WebClient).DownloadString(('https://gist.githubusercontent.com/grenade/3f2fbc64e7210de136e7eb69aae63f81/raw/build-azure-images.ps1?{0}' -f [Guid]::NewGuid()));
# job settings. change these for the tasks at hand.
$targetCloudPlatform = 'azure';
$workFolder = ('{0}{1}{2}-ci' -f 'D:', ([IO.Path]::DirectorySeparatorChar), $targetCloudPlatform);
$imagesToBuild = @(
('win7-32-{0}' -f $targetCloudPlatform),
('win7-32-gpu-{0}' -f $targetCloudPlatform)
);