Skip to content

Instantly share code, notes, and snippets.

@huytd
huytd / wordle.md
Last active May 2, 2024 12:13
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@johnsimcall
johnsimcall / 1_Setup_PowerShell_Environment.ps1
Last active April 30, 2024 06:32
PowerShell script to create required vSphere roles/permissions for OpenShift 4 installer
# Commands to install VMware PowerCLI and allow PowerShell to run scripts, if you're using a Desktop version of Windows (e.g. not Windows Server)
PS> Install-Module VMware.PowerCLI -Scope CurrentUser
PS> #Install-Module VMware.PowerCLI -Scope CurrentUser -SkipPublisherCheck -AllowClobber -Force
# The second Install-Module command can be used if you get an error regarding the authenticode signature
# PackageManagement\Install-Package : The module 'VMware.VimAutomation.Sdk' cannot be installed or updated because the
# authenticode signature of the file 'VMware.VimAutomation.Sdk.cat' is not valid.
PS> Get-Module -Name VMware.PowerCLI -ListAvailable
PS> Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
@erikerlandson
erikerlandson / podman-s2i-dir.sh
Created February 19, 2021 23:19
Example of chaining s2i podman image build using --as-dockerfile
#!/bin/bash
set -e
if [ $# -lt 2 ]; then
echo "usage: $0 <src-dir> <img-tag> [ <s2i-args> ... ]"
exit 1
fi
fail() {
echo $1
@sjenning
sjenning / disconnected-operators.md
Last active November 16, 2020 21:37
disconnected-operators
@ryran
ryran / ocp4-chk-upgrade-channel
Last active February 10, 2023 00:47
OCP4: leverage api.openshift.com/api/upgrades_info to inspect OCP versions
#!/bin/bash
# ocp4-chk-upgrade-channel v1.4 last mod 2022/11/16
# https://gist.github.com/ryran/072409b1b7efd5018683a8c45e019652
# Copyright 2020, 2021, 2022 Ryan Sawhill Aroha <rsaw@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@georgegoh
georgegoh / snmp-for-alertmanager.sh
Created December 20, 2019 08:23
One-liner for spinning up snmp-notifer in kube for alertmanager
kubectl run snmp-notifier --image=docker.io/maxwo/snmp-notifier \
--port=9464 --expose \
--env="SNMP_DESTINATION=127.0.0.1:162" \
--env="SNMP_DESCRIPTION_TEMPLATE=/etc/snmp_notifier/description-template.tpl" \
-- '--snmp.trap-description-template=$(SNMP_DESCRIPTION_TEMPLATE)' \
'--snmp.destination=$(SNMP_DESTINATION)'
@sub-mod
sub-mod / crc_remote_laptop.md
Last active July 9, 2022 12:03
Setup CodeReady Containers on Remote Server and connect from Laptop 4.2

Following steps work for F29 for F31 look here

On the remote host

cat /etc/redhat-release
Fedora release 29 (Twenty Nine)

Install packages

@ansemjo
ansemjo / embed_ignition.sh
Created January 3, 2019 15:53
Embed CoreOS ignition configuration in the released OVA for easy deployment of multiple instances on VMware.
#!/usr/bin/env bash
# Copyright (c) 2019 Anton Semjonov
# Licensed under the MIT License
# This script embeds a transpiled ignition (JSON) config in the CoreOS OVA
# as guestinfo parameters, so you can deploy several machines with the
# same configuration easily.
# required arguments / inputs
@guessi
guessi / refresh-ecr-token-for-kubernetes.sh
Last active September 18, 2023 07:11
Refresh ECR Token for Kubernetes - Resolve ECR Token Expired Issue
#!/bin/bash
# prerequisite:
# - ec2 instance should attached proper iam role
# - awscli
# - kubectl
# Usage:
#
# define the following variales in your environment (root account)
@bzub
bzub / test.json
Created October 5, 2017 14:50
CoreOS Ignition + OEM
{
"ignition": {
"config": {},
"timeouts": {},
"version": "2.1.0"
},
"networkd": {},
"passwd": {},
"storage": {
"files": [{