Skip to content

Instantly share code, notes, and snippets.

@chirauki
chirauki / clean.txt
Last active July 21, 2025 10:55
Openshit install cleanup
aws ec2 describe-vpcs --filters 'Name=tag:Name,Values=*rc4-1125-ocp-patch*' | jq -r '.Vpcs[] | .VpcId'
Terminate all instances:
aws ec2 describe-instances --page-size 400 --filters 'Name=tag:Name,Values=*rc4-1125*' | jq '.Reservations[] | .Instances[] | .InstanceId' | xargs aws ec2 terminate-instances --instance-ids
Delete all LBs:
for vpc in $(aws ec2 describe-vpcs --filters 'Name=tag:Name,Values=*rc4-1125*' | jq -r '.Vpcs[] | .VpcId') ; do for arn in $(aws elbv2 describe-load-balancers --page-size 400 --query 'LoadBalancers[?Type == `network`]' | jq -r --arg VPC ${vpc} '.[] | select(.VpcId==$VPC) | .LoadBalancerArn'); do aws elbv2 delete-load-balancer --load-balancer-arn ${arn} ; done ; done
for vpc in $(aws ec2 describe-vpcs --filters 'Name=tag:Name,Values=*rc4-1125*' | jq -r '.Vpcs[] | .VpcId') ; do for name in $(aws elb describe-load-balancers --page-size 400 | jq -r --arg VPC ${vpc} '.LoadBalancerDescriptions[] | select(.VPCId==$VPC) | .LoadBalancerName'); do aws elb delete-load-balancer --load-bala
#
# kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.2/manifests/tigera-operator.yaml
#
# For MKE
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
subjectName: tigera-operator-tigera-operator
name: tigera-operator-tigera-operator:cluster-admin
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: tf-productpage
name: tf-productpage
spec:
selector:
matchLabels:
app: tf-productpage
---
# Source: cilium/templates/cilium-agent-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: cilium
namespace: kube-system
---
# Source: cilium/templates/cilium-operator-serviceaccount.yaml
apiVersion: v1
@chirauki
chirauki / key1.json
Created July 22, 2020 09:52
some jwks
{ "keys":[ {"crv":"P-256","kid":"v9YZGmDYoXDllRoqgtQEQ3M-xeg8xrnciwV_mSP6Zpc","kty":"EC","x":"Xht4_7JXh0ZHztdjzbBgyzmM_ZZTBdZl5ncawzX-P78","y":"xrsqZ1FV8B3NIaEGnRGOGDAd_wXyTe4IAODq6R6k09A"}]}
# Copyright 2017 Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@chirauki
chirauki / keybase.md
Created July 31, 2019 10:39
keybase.md

Keybase proof

I hereby claim:

  • I am chirauki on github.
  • I am chirauki (https://keybase.io/chirauki) on keybase.
  • I have a public key ASB1_OyLjztH6lt7MRRc92V6XMP3_1p8Uru2YTh7jhXWawo

To claim this, I am signing this object:

@chirauki
chirauki / capture.rb
Last active January 21, 2019 11:09
Capture script
#!/usr/bin/env ruby
require 'csv'
require 'trollop'
require 'rubygems'
require 'abiquo-api'
opts = Trollop::options do
opt :endpoint, "API endpoint", :type => :string
opt :username, "API username", :type => :string, :default => "admin"
@chirauki
chirauki / test.yml
Last active November 2, 2018 11:45
---
- hosts: localhost
tasks:
- name: Gather all available locations
abiquo_location_facts:
api_url: https://chirauki-master.bcn.abiquo.com/api
api_user: admin
api_pass: xabiquo
verify: no
has: AWS
#!/bin/bash -xe
if [ -f /etc/redhat-release ] && grep -qi centos /etc/redhat-release; then
## CENTOS
# PHP 7.2
curl 'https://setup.ius.io/' -o setup-ius.sh
sudo bash setup-ius.sh
sudo yum -y update
sudo yum -y install ntp curl vim htop ccze wget git yum-utils unzip \