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
@bitmvr
bitmvr / example--parse-semver-with-bash.sh
Last active May 24, 2024 08:29
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=""
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
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 June 27, 2024 00:50
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)
@roachhd
roachhd / README.md
Last active June 27, 2024 23:38
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

package main
import (
"github.com/kr/beanstalk"
)
func main() {
var id uint64
c, err := beanstalk.Dial("tcp", "127.0.0.1:11300")
if err != nil {