Skip to content

Instantly share code, notes, and snippets.

Kubectl plugin

This plugin adds completion for the Kubernetes cluster manager, as well as some aliases for common kubectl commands.

To use it, add kubectl to the plugins array in your zshrc file:

plugins=(... kubectl)
@softbrada
softbrada / decrypt_dbeaver.py
Created October 31, 2023 12:04 — forked from felipou/decrypt_dbeaver.py
DBeaver password decryption script - for newer versions of DBeaver
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection
# requires pycryptodome lib (pip install pycryptodome)
import sys
import base64
import os
import json
from Crypto.Cipher import AES
@softbrada
softbrada / 2017-11-29_15-08-33.jpg
Created October 30, 2023 13:30 — forked from LuisErnestoZamb/2017-11-29_15-08-33.jpg
How setting up mysql as localhost and using this outside docker on Mac OS (accessing localhost mysql from docker) - The missing guide
2017-11-29_15-08-33.jpg
@softbrada
softbrada / hung.m
Created October 11, 2023 06:19 — forked from kkirby/hung.m
Updated NonResponding
/**
* compile using this:
* gcc -framework Carbon -framework Foundation ./hung.m -o hung
*
* Referenced from https://apple.stackexchange.com/a/424763/260619
* Original source code https://github.com/jksoegaard/NonResponding
* Original Author: jksoegaard
**/
#import <Foundation/Foundation.h>
@softbrada
softbrada / HOWTO.md
Created August 8, 2023 07:00 — forked from ivanvermeyen/HOWTO.md
Multiple MySQL versions on MacOS with Homebrew

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@softbrada
softbrada / rspec_helper.rb
Created July 20, 2023 21:19 — forked from arturictus/rspec_helper.rb
Translating AtiveJob::TestHelper to Rspec
def specific_enqueued_jobs(job)
enqueued_jobs.select{ |j| j if j[:job] == job }
end
require 'active_support/core_ext/class/subclasses'
require 'active_support/core_ext/hash/keys'
module ActiveJob
# Provides helper methods for testing Active Job
module RSpecHelper
extend ActiveSupport::Concern

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty.

Get an ip address for en0:

@softbrada
softbrada / uuid.rb
Created July 18, 2023 08:38 — forked from brandur/uuid.rb
UUID data type in Ruby
# typed: strict
# frozen_string_literal: true
require "base32"
require "securerandom"
require "ulid"
# A type to represent UUIDs. Particularly useful for annotating fields in API
# representations or Sorbet parameters to help prevent accidentally mixing up
# UUIDs and EIDs as they're being passed around as loose strings.
@softbrada
softbrada / 660-init-deb.sh
Created March 10, 2022 09:20 — forked from rschmitty/660-init-deb.sh
Linode script to register nginx after passenger isntall http://library.linode.com/assets/660-init-deb.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon