Skip to content

Instantly share code, notes, and snippets.

View flavianmissi's full-sized avatar

Flavian Missi flavianmissi

View GitHub Profile
@sanchezl
sanchezl / imagebuilder
Created October 8, 2021 14:27
imagebuilder adapter for buildah
#!/usr/bin/env bash
for arg in "$@"; do
shift
case "$arg" in
--version) echo 1.2.1 ; exit ;;
--allow-pull) ;;
*) set -- "$@" "$arg" ;;
esac
done
buildah bud "$@"
@nickboldt
nickboldt / iib-check.adoc
Last active March 4, 2022 14:43
querying for IIB versions based on CRW tags
@pichuang
pichuang / check_etcd.sh
Last active November 15, 2023 09:12
Check etcd status on OCP 4.6.1
#!/bin/bash
# Ref: https://docs.openshift.com/container-platform/4.6/backup_and_restore/backing-up-etcd.html
etcd_node=`oc get pods -n openshift-etcd -l app=etcd -o=jsonpath='{.items[0].spec.nodeName}'`
ssh -i ~/.ssh/dmz-ocp4-rsa core@$etcd_node
id=$(sudo crictl ps --name etcdctl | awk 'FNR==2{ print $1}') && sudo crictl exec -it $id /bin/bash
etcdctl member list -w table
etcdctl endpoint health --cluster
@sjenning
sjenning / oc-nuke
Last active April 15, 2025 07:38
Remove Kubernetes namespaces with prejudice
#!/bin/bash
# This script is a kubectl/oc plugin that will start namespace deletion,
# watch the namespace conditions for resources blocking on finalizers,
# and remove those finalizers from the blocking resources
# TODO: Does not yet work against core resource types. The regex doesn't get them.
NAMESPACE=$1
if ! oc get ns ${NAMESPACE} &>/dev/null; then
@bitmvr
bitmvr / example--parse-semver-with-bash.sh
Last active October 24, 2024 08:48
A POSIX Compliant SemVer Parser in Pure Bash
#!/usr/bin/env bash
VERSION="${1#[vV]}"
VERSION_MAJOR="${VERSION%%.*}"
VERSION_MINOR_PATCH="${VERSION#*.}"
VERSION_MINOR="${VERSION_MINOR_PATCH%%.*}"
VERSION_PATCH_PRE_RELEASE="${VERSION_MINOR_PATCH#*.}"
VERSION_PATCH="${VERSION_PATCH_PRE_RELEASE%%[-+]*}"
VERSION_PRE_RELEASE=""
DATA AND METADATA COHERENCE
Some modern cluster file systems provide perfect cache coherence among their clients. Perfect cache coherence among disparate NFS clients is expensive to achieve, especially on wide area networks. As such, NFS settles for weaker cache coherence that satisfies the requirements of most file sharing types.
Close-to-open cache consistency
Typically file sharing is completely sequential. First client A opens a file, writes something to it, then closes it. Then client B opens the same file, and reads the changes.
When an application opens a file stored on an NFS version 3 server, the NFS client checks that the file exists on the server and is permitted to the opener by sending a GETATTR or ACCESS request. The NFS client sends these requests regardless of the freshness of the file's cached attributes.
When the application closes the file, the NFS client writes back any pending changes to the file so that the next opener can view the changes. This al
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active December 3, 2024 21:48
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created

= Time & Versioning in Graphs

== Time as Attributes

  • Long (Seconds or Milliseconds since Epoch)
  • String ISO-XXX -> comparable
  • Simple String yyyy-mm-dd

Issues:

@dnephin
dnephin / compose-hooks.sh
Last active October 21, 2022 20:44
Execute a hook in './hooks/<service>/<action>' when that event is received
#!/bin/bash
set -e
function handle_event() {
local entry="$1"
local action=$(echo $entry | jq -r '.action')
local service=$(echo $entry | jq -r '.service')
local hook="./hooks/$service/$action"
if [ -x "$hook" ]; then
"$hook" "$entry"
@squarism
squarism / iterm2.md
Last active April 16, 2025 05:42
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)