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 <tim@tabdeveloper.com>
# 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 July 9, 2024 04:49
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
Last active July 24, 2024 17:10
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@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
}