Skip to content

Instantly share code, notes, and snippets.

View res0nat0r's full-sized avatar
🤗

Stefhen Hovland res0nat0r

🤗
  • Austin, TX
View GitHub Profile
@res0nat0r
res0nat0r / mfa.md
Last active October 11, 2021 23:01
Delete virtual MFA device from AWS account with awscli
aws iam deactivate-mfa-device --user-name user@example.com --serial-number \
  arn:aws:iam::12345:mfa/user\@example.com

aws iam delete-virtual-mfa-device --serial-number arn:aws:iam::12345:mfa/user\@example.com
@res0nat0r
res0nat0r / delete.md
Created May 2, 2019 00:23
Delete all untagged Google cloud container images
gcloud container images list-tags gcr.io/project/repo --filter='-tags:*' \
  --format='get(digest)' --limit=unlimited | parallel -I{} gcloud container images delete \
  --quiet gcr.io/project/repo@{}
@res0nat0r
res0nat0r / restore.py
Created May 1, 2019 21:29
Restore s3 objects from glacier with boto
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket('glacier-bucket')
for obj_sum in bucket.objects.all():
obj = s3.Object(obj_sum.bucket_name, obj_sum.key)
if obj.storage_class == 'GLACIER':
# Try to restore the object if the storage class is glacier and
# the object does not have a completed or ongoing restoration
# request.
@res0nat0r
res0nat0r / 00-k8s-notes.md
Last active November 30, 2025 15:05
Kubernetes Notes

List all containers in pod:

kubectl get pod <name> -o jsonpath="{.spec['containers','initContainers'][*].name}"

Get events related to pod:

@res0nat0r
res0nat0r / Dockerfile
Last active March 11, 2019 04:09
pipenv test for argo
FROM python:2.7.15
COPY main.py /app/main.py
RUN pip install pipenv
RUN pipenv install --system --deploy
EXPOSE 8080
WORKDIR /app
@res0nat0r
res0nat0r / preapprove.groovy
Last active February 20, 2019 23:13 — forked from tknerr/preapprove.groovy
pre-approve all Jenkins groovy scripts
import jenkins.*
import jenkins.model.*
Jenkins.instance.getExtensionList('org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval')[0].get().preapproveAll()
pipeline {
agent any
parameters {
string(defaultValue: '', description: 'The name of the organization working on this repository.', name: 'orgName')
}
stages{
stage("Create Repo Piplines") {
steps {
@res0nat0r
res0nat0r / readme.md
Created January 28, 2019 04:14 — forked from maxivak/readme.md
Provisioning Docker containers with Chef

Provisioning Docker container with Chef

Chef provisioning

  • Chef provisioning is a framework that allows clusters to be managed by the chef-client and the Chef server in the same way nodes are managed: with recipes.

  • Chef provisioning is a collection of resources that enable the creation of machines and machine infrastructures using the chef-client.

@res0nat0r
res0nat0r / picard_naming.txt
Last active December 16, 2018 18:01
MusicBrainz Picard file naming regex
$firstalphachar(%artist%)/$replace(%albumartist%-%album%/$if($gt(%totaldiscs%,1),%discnumber%$num(%tracknumber%,2),$num(%tracknumber%,2))-$lower(%artist%)-$lower(%title%), ,_)