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 / colima.md
Last active March 2, 2024 08:37
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.

@res0nat0r
res0nat0r / oneliners.md
Last active November 9, 2023 20:45
Oneliners and code snippets
  • Port forward over AWS SSM:
aws ssm start-session --target $INSTANCE_ID \
 --document-name AWS-StartPortForwardingSession \
 --parameters '{"portNumber":["80"],"localPortNumber":["9999"]}'

  • Convert video container type:
@res0nat0r
res0nat0r / hello-deployment.yml
Last active July 1, 2023 00:29
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 / 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 / lfs.txt
Last active April 14, 2023 02:35
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.
#!/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
##
@res0nat0r
res0nat0r / 00-k8s-notes.md
Last active March 1, 2023 10:10
Kubernetes Notes

List all containers in pod:

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

Get events related to pod:

@res0nat0r
res0nat0r / lambda.js
Created October 4, 2022 18:50
Lambda network connectivity tester
const http = require('https');
exports.handler = async (event, context) => {
return new Promise((resolve, reject) => {
const options = {
host: 'httpbin.org',
path: '/uuid',
port: 443,
method: 'GET'
};
const req = http.request(options, (res) => {