Skip to content

Instantly share code, notes, and snippets.

View usrbinkat's full-sized avatar
👩‍💻

Kat Morgan usrbinkat

👩‍💻
View GitHub Profile
@usrbinkat
usrbinkat / hastebin.sh
Created December 2, 2019 16:56
Hastebin Curl Bash Wrapper
#!/bin/bash
#(optional) in the format user.name:password@ (you need the @ after)
#password="$(< ~/.hidden_password)"
url="hastebin.com"
key="$(curl --silent --insecure --data-binary @/dev/fd/0 https://$url/documents | cut -d "\"" -f 4)"
echo "https://$url/$key"
@usrbinkat
usrbinkat / generate-ssh-key.sh
Created July 2, 2020 16:10 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
$url = "https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.1.0.0p1-Beta/OpenSSH-Win32.zip"
$output = "C:\OpenSSH-Win32.zip"
$start_time = Get-Date
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $output)
Expand-Archive c:\OpenSSH-Win32.zip c:\Program Files\OpenSSH
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
net start sshd
Set-Service sshd -StartupType Automatic
@usrbinkat
usrbinkat / extract-ignition-filesystem.py
Created October 20, 2020 03:58 — forked from sjenning/extract-ignition-filesystem.py
Extracts a filesystem from an ignition file
#!/usr/bin/env python3
import json
import os
import sys
import base64
ign_file = open(sys.argv[1])
ign_json = json.load(ign_file)
ign_file.close()
@usrbinkat
usrbinkat / rootless-pull-ubi.md
Last active July 19, 2021 16:47
Rootless Koffer Nested Podman
@usrbinkat
usrbinkat / how-to-koffer.md
Last active February 3, 2021 23:03
CloudCtl | Connected Mirror

Prereqs

  1. Follow CloudCtl startup Readme
  2. Run the following as root from the directory cd /root/

Write koffer.yml

cat <<EOF | tee ~/koffer.yml
koffer:
  silent: false
  mirror: localhost:5000
@usrbinkat
usrbinkat / shipperd-skopeo-poc.md
Last active February 4, 2021 21:19
ShipperD Operator Proof-of-Concept

Goal Validate design of ShipperD Operator

  • Create Airgap'd cluster (TPDK + Sparta IaC Deploy in AWS Airgap VPC)
  • Create project shipperd-operator
  • Create pod with skopeo enabled container (Konductor container during POC phase)
  • Create serviceaccount shipperd
  • Exec into container oc rsh -n shipperd-operator po/pod-name-xyz-qwer
  • Skopeo login --authfile iva shipperd uname:token to image-registry.openshift-image-registry.svc:5000
  • Validate OCP Internal Registry ready to recieve images YAML Config
  • copy image from external registry using authfile
@usrbinkat
usrbinkat / squash-git.md
Last active February 17, 2021 19:03
squash commits

Clone repo & update with latest from upstream master

git clone https://github.com/CodeSparta/content.git    
git checkout master    
git remote add upstream https://github.com/ComplianceAsCode/content.git    
git fetch upstream master

Merge codesparta/content ref(sparta)

git checkout -b feature_kubeapi_cis_1-2-25
@usrbinkat
usrbinkat / koffer-collector-operators-local.md
Last active February 19, 2021 23:23
Koffer collector-operators testing
#!/bin/bash -x
#
# Setup:
# .
# ├── bundle
# ├── koffer.sh
# └── pull-secret.json
#
# Place pull secret in $(pwd)/pull-secret.json
@usrbinkat
usrbinkat / container-image-file-save-load-transport.md
Last active March 17, 2021 00:00
Exercise in container image saving, loading from file, and embedding as compressed base64 encoded text string

Container image file and transportation

Conclusion:

Images can be saved to file or base64 encoded for building directly into golang binaries, python/bash scripts, and carrying independently across disconnected systems.

Unfortunately, the only way to preserve image metadata is to save as a docker-archive transport type, and to podman load the resulting archive via following step:

cat pause-3.2.tar | podman load
cat registry-latest.tar | podman load