Skip to content

Instantly share code, notes, and snippets.

View rosskirkpat's full-sized avatar

Ross Kirkpatrick rosskirkpat

View GitHub Profile
#!/bin/bash
#
# Copyright 2011, Tim Branyen @tbranyen <[email protected]>
# Dual licensed under the MIT and GPL licenses.
#
# Automatically clone single or multiple repos into a folder,
# great for setting up a git projects folder.
#
# Install: curl https://gist.github.com/raw/902154/github.sh > /usr/local/bin/gh
# chmod +x /usr/local/bin/gh
@ssstonebraker
ssstonebraker / sed cheatsheet
Created August 2, 2013 14:06 — forked from un33k/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@steeve
steeve / _readme.md
Last active March 25, 2025 07:32
How to cross compile Go with CGO programs for a different OS/Arch

How to cross compile Go with CGO programs for a different OS/Arch

It is possible to compile Go programs for a different OS, even though go build says otherwise.

You'll need:

@jgreat
jgreat / 00-notes.md
Last active February 15, 2024 20:25
Rancher-Azure-Cloud-Provider-Storage-Classes

storageClass with PersistentVolumeClaims are really the way to do storage with Kubernetes.

For Azure There are 3 types of storage avalible.

  • (Slow, Limited, Going to cause tears) AzureFiles - CIFS share, with all the limitaions of CIFS :(
  • (Better) Azure Disk (Storage Account) - You can use this type with Azure "Node Driver" VMs in Rancher.
  • (Best) Azure Disk (Managed) - You will need to create your own VMs that support managed disk with premium storage, then use the "Custom" option.
@superseb
superseb / websocket-test-rancher2.md
Last active November 9, 2022 19:20
Websocket test Rancher 2

Run WebSocket test for Rancher 2

Option 1: curl

Replace rancher.yourdomain.com with your Rancher URL and token-xxxxx:string with your API bearer token.

Using curl

This depends on the version of curl used (especially cross operating system)

@daxmc99
daxmc99 / rioStart.sh
Last active January 24, 2020 01:10
rioStart.sh
#!/bin/bash
#set -x
#set -e
name='rio'
k3d delete --name=$name
k3d create -n $name --image rancher/k3s:v1.0.0 --publish 80:80 --publish 443:443 --publish 9443:9443 --publish 9080:9080 \
--server-arg --no-deploy=traefik
declare -i i; i=0
until k3d get-kubeconfig --name='rio'
do
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active October 29, 2025 11:37
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@jaymecd
jaymecd / build_stig_windows_with_packer.md
Last active September 12, 2023 21:53
Packer with WinRM over HTTPS

Way to build Windows STIG/CIS hardened AMI on AWS.

Problem is that WinRM Basic authentication is blocked by GroupPolicy.

Therefore it's required to setup WinRM over HTTPS.

@luthermonson
luthermonson / linefeed.ps1
Last active June 10, 2020 21:26
Powershell Native crlf and lf Functions
<#
switch between crlf and lf much like unix2dos and dos2unix but implemented in powershell.
put two functions into your $PROFILE and call like the following:
default params is your current working dir and ignoring .git and vendor dirs
crlf file.txt
crlf ./dir @(".git", "vendor")
lf file.txt
@luthermonson
luthermonson / gist:08589cc189690870ac2df594d57d2236
Last active September 11, 2020 22:31
Powershell to Tail Docker Logs
# Make sure you setup c:\ProgramData\docker\config\daemon.json to contain log-level: debug and debug: true
$idx = (Get-EventLog -LogName Application -Source Docker -Newest 1).Index
while ($True)
{
Start-Sleep -MilliSeconds 100
$idx2 = (Get-EventLog -LogName Application -Source Docker -Newest 1).index
if (-NOT($idx -eq $idx2)) {
Get-EventLog -logname Application -Source Docker -Newest ($idx2 - $idx) | Sort index | Select-Object Message
}