Skip to content

Instantly share code, notes, and snippets.

View JayDoubleu's full-sized avatar
🎯
Focusing

Jay W JayDoubleu

🎯
Focusing
View GitHub Profile
@JayDoubleu
JayDoubleu / octopusTentacleRegistration.ps1
Last active June 30, 2023 12:26
Script to register octopus tentacle
param (
[Parameter(Mandatory = $true)][string] $serverThumbprint,
[Parameter(Mandatory = $true)][string] $serverUrl,
[Parameter(Mandatory = $true)][string] $serverApiKey,
[Parameter(Mandatory = $true)][string] $instancePort,
[Parameter(Mandatory = $true)][string] $instanceWorkerPool
)
$instanceName = $env:computerName
$instanceHostname = [System.Net.Dns]::GetHostByName(($env:computerName)).HostName
- task: Bash@3
displayName: Retrieve current agent public IP
inputs:
targetType: 'inline'
script: |
echo "##vso[task.setvariable variable=AGENT_IP]$(curl -s http://ipinfo.io/json| jq -r '.ip')"
import fnmatch
import os
#import re2 as re
import regex as re
import subprocess
from subprocess import PIPE, STDOUT
import argparse
import yaml
import csv
@JayDoubleu
JayDoubleu / deployNetworkWatchers.bicep
Created May 17, 2023 17:44
Bicep code to deploy network watchers
param tags object = {}
param environment
param prefix string
param regions array = [
'uksouth'
'ukwest'
'northeurope'
'westeurope'
'eastus'
'southcentralus'
@JayDoubleu
JayDoubleu / azureDevOpsOrg.bicep
Created May 17, 2023 17:18
Bicep file to Link, Create or Update Azure DevOps Organisation
@description('The name of the Azure Resource to be created.')
param resourceName string
@description('The name of the Azure DevOps organization.')
param accountName string
@description('The operation type to be performed on the Azure DevOps organization.')
@allowed([
'Create '
'Link '
@JayDoubleu
JayDoubleu / Export-CACertificates.md
Last active November 21, 2023 10:28
Code to extract all Windows store certificates as PEM to be used by WSL behind corporate SSL proxy
function Export-CACertificates {
    param(
        [string]$OutputFile = 'all_ca_certificates.pem',
        [ValidateSet("DOS", "UNIX")]
        [string]$NewLineFormat = "DOS"
    )

    $newline = if ($NewLineFormat -eq "DOS") { "`r`n" } else { "`n" }
@JayDoubleu
JayDoubleu / apt_wait.sh
Created March 31, 2022 10:34 — forked from tedivm/apt_wait.sh
A BASH function to wait for `apt` to finish and release all locks.
#!/usr/bin/env bash
apt_wait () {
while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
sleep 1
done
while sudo fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do
sleep 1
done
if [ -f /var/log/unattended-upgrades/unattended-upgrades.log ]; then
<#
.SYNOPSIS
Returns all permutations of paths through the front door object to the target backends configured.
.DESCRIPTION
For the provided Azure Front Door resource, this function generates output objects for each permutation of:
* Url input
* Pattern Matched
@JayDoubleu
JayDoubleu / customToolbox.sh
Created February 19, 2022 19:33
Get podman command used to create toolbox container which can be used for tweaks etc
podman inspect fedora-toolbox-35 | jq -r '.[0].Config.CreateCommand | join(" ")'
@JayDoubleu
JayDoubleu / gitlab_runner_podman.md
Created February 19, 2022 19:03
gitlab ci runner with podman

Rootfull runner (same as docker itself)

sudo systemctl enable podman.socket
sudo systemctl start podman.socket
sudo podman run -d --name gitlab-runner --restart always --security-opt label=disable \
    -v /run/podman/podman.sock:/var/run/docker.sock \
    -v gitlab-runner-config:/etc/gitlab-runner \
    docker.io/gitlab/gitlab-runner:latest