Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Wakka: A package manager wrapper.
# Provides a consistent interface across multiple package managers.
# Currently supports: apt (Debian/Ubuntu), yum (Red Hat/CentOS),
# dnf (Fedora), apk (Alpine), and brew (macOS).
WAKKA_VERSION="1.0.0"
print_help() {
@udkyo
udkyo / mkgo
Last active August 11, 2023 23:56
mkgo
# mkgo: A handy shell function to create directories and cd/popd to them
# immediately, supports optional permissions and owner adjustments.
#
# Usage: mkgo [-p] [-m mode] [-o owner] [-s] [-f] directory
# See --help for more details.
#
# (source this or pop it in your profile)
mkgo() {
VERSION="mkgo 2.0.0"

Github action for creating the release from a tag

Create file .github/workflows/create-release-from-a-tag.yml with the content:

on:
  push:
    # Sequence of patterns matched against refs/tags
    tags:
      - 'release*' # Push events to matching release*, i.e. release-1.0, release-20.15.10, release-2020-10-28-10-26-15

name: Create Release
@udkyo
udkyo / gist:82c250a2f937e8ff58b52f49db14e5ad
Created May 19, 2021 08:39 — forked from Aricg/gist:56f1a769cbdcbb93b459
Enable gerrit replication to github
Gerrit version 2.8
Replication plugin extracted from gerrit.war and installed over ssh
Installation method ->
a) Relevant configs:
/var/lib/gerrit/etc/replication.config
[remote "aricg-compliance"]
url = git@github.com:somerepo/${name}.git
@udkyo
udkyo / .zshrc
Created June 2, 2020 08:06
VSCode terminal history persistence helper
function hist {
[ ! -d ~/.history ] && mkdir ~/.history
chmod 700 ~/.history
name="history$(pwd | sed 's/\//-/g')"
echo "Using history file $name"
HISTFILE=~/.history/$name
HISTSIZE=4096
SAVEHIST=4096
setopt appendhistory
fc -R
@udkyo
udkyo / make_catalina_iso.sh
Last active March 5, 2020 16:46 — forked from davertay/make_catalina_iso.sh
Catalina ISO for Virtualbox
hdiutil create -o /tmp/Catalina -size 8000m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Catalina.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --nointeraction --volume /Volumes/install_build
hdiutil convert /tmp/Catalina.dmg -format UDTO -o ~/Downloads/Catalina
mv ~/Downloads/Catalina.cdr ~/Downloads/Catalina.iso
@udkyo
udkyo / make_mojave_iso.sh
Last active March 4, 2020 09:57 — forked from lamlion/make_mojave_iso.sh
Create OSX Mojave ISO
#!/bin/bash
# Install OSX Mojave through App Store. After downloading, the "InstallESD" is automatically mounted, which causes this script to fail.
# Therefore, "/Volumes/InstallESD" should be unmounted before running this script!
# Summary of instructions
#1 Download Mojave from App Store
#2 open terminal and run "umount /Volumes/InstallESD"
#3 make script executable: "chmod +x make_mojave_iso.sh"
#4 Run "./make_mojave_iso.sh"
@udkyo
udkyo / delete_all_awslogs.sh
Created August 11, 2019 09:28 — forked from pahud/delete_all_awslogs.sh.md
delete all aws log groups
aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | awk '{print $2}' | grep -v ^$ | while read x; do aws logs delete-log-group --log-group-name $x; done
# I use this for quickly getting SSH pub keys from one host to another in the lab
# when I've provisioned them an awkward way, running this and then something along the lines of
# mkdir ~/.ssh && chmod 755 ~/.ssh && curl [host_with_key] >> ~/.ssh/authorized_keys
while true; do nc -l -p 1500 -c 'echo -e "HTTP/1.1 200 OK\n\n$(cat ~/.ssh/id_rsa.pub)"'; done
@udkyo
udkyo / channel.go
Created August 12, 2018 20:51
Goroutine & channel simple example
// I read some needlessly confusing explanations of channels when I was
// learning go, so I figured I'd post a very straightforward example and
// describe it to death with comments
//
// If anyone ever stumbles across it, I hope it helps :)
package main
import (
"fmt"
"time"