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 / oneliners.md
Last active March 31, 2026 21:39
Oneliners and code snippets
  • List EC2 Instances:
function li() {
  aws ec2 describe-instances \
    | jq -r '.Reservations[].Instances[] | [(.Tags[]|select(.Key=="Name").Value),.InstanceId,.PrivateIpAddress,.VpcId,.State.Name,.LaunchTime] | @csv' \
    | mlr --c2p --implicit-csv-header label Nmae,InstanceId,PrivateIpAddress,VpcId,State,LaunchTime then sort -f LaunchTime then cat
  }
@res0nat0r
res0nat0r / create-aws-console-user.sh
Created October 7, 2015 16:00 — forked from stefhen/create-aws-console-user.sh
Create AWS console user from the awscli
#!/bin/bash
# USAGE: ./create-aws-console-user.sh $GROUPNAME $USERNAME $PASSWORD
# http://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_cliwpsapi
# Create administrator group
aws iam create-group --group-name $1
@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 / lfs.txt
Last active June 4, 2025 10:01
Lustre hsm commands
lfs hsm_archive /mnt/lustre/<path>/<filename> Copies the file to the archive.
lfs hsm_release /mnt/lustre/<path>/<filename> Removes the file from the Lustre file system; does not affect the archived file.
lfs hsm_restore /mnt/lustre/<path>/<filename> Restores the archived file back to the Lustre file system. This is an asynchronous, non-blocking restore. A client’s request to access an archived file will also restore the file back the Lustre file system if is has been released; this will be a synchronous and blocking restore.
lfs hsm_cancel /mnt/lustre/<path>/<filename> Cancels an lfs_hsm command that is underway.
@res0nat0r
res0nat0r / apt-cacher-ng.md
Created March 27, 2018 17:48
Allow apt-cacher-ng to work with https repos
  • In order for SSL/TLS to work, apt-cacher-ng has to be told beforehand which domains it can CONNECT to via the PassThroughPattern: option in /etc/apt-cacher-ng/acng.conf. For instance, to allow apt-cacher-ng to proxy anything, you can do:

PassThroughPattern: .*

@res0nat0r
res0nat0r / hello-deployment.yml
Last active November 13, 2024 21:09
Internal / External Kubernetes Service Example
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: hello-world
@res0nat0r
res0nat0r / colima.md
Last active September 24, 2024 02:08
Set proxy in Colima Docker container

abiosoft/colima#294 (comment)


Note: this assumes Colima v0.4.0 or newer.

SSH into the VM colima ssh

Edit docker init script sudo vi /etc/init.d/docker.

#!/usr/bin/env python
from ipaddress import ip_network, ip_address
import sys
cidrs = []
with open(sys.argv[1], "r") as f:
for line in f:
@res0nat0r
res0nat0r / ebs-report.py
Created April 6, 2017 22:38
EBS Volume Report
#! /usr/bin/python
################################################################################
## ebs-report - Creates a CSV report for EBS volumes, including some snapshot information
## Written by N2W Software
## Date: July 2014
## License: You can use/modify/circulate or do whatever you want.
## Just note that this script is given "As Is" without any warranty
##
## Usage: see README file
##