Skip to content

Instantly share code, notes, and snippets.


K8sCat k8scat

View GitHub Profile
k8scat / github.js
Last active Feb 24, 2022 — forked from ye11ow/github.js
Add a "Copy link" button to Github issue and pull requests
View github.js
// ==UserScript==
// @name Copy Link for GitHub Issues and PRs
// @namespace
// @version 0.2
// @description Add a "Copy link" button to Github issue and pull requests
// @author ye11ow, K8sCat <>
// @match*
// @include*/issues/*
// @include*/pull/*
// @icon
k8scat / gist:213820c0204f452d5c67295c406b78fd
Created Jan 9, 2022 — forked from cdown/gist:1163649
Bash urlencode and urldecode
View gist:213820c0204f452d5c67295c406b78fd
urlencode() {
# urlencode <string>
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
k8scat / openresty.service
Created Jun 9, 2021 — forked from HauptJ/openresty.service
OpenResty Systemd service file
View openresty.service
# Stop dance for OpenResty
# A modification of the Nginx systemd script
# Source:
# =======================
# ExecStop sends SIGSTOP (graceful stop) to the Nginx process.
# If, after 5s (--retry QUIT/5) OpenResty is still running, systemd takes control
# and sends SIGTERM (fast shutdown) to the main process.
# After another 5s (TimeoutStopSec=5), and if OpenResty is alive, systemd sends
# SIGKILL to all the remaining processes in the process group (KillMode=mixed).
k8scat / gh-dl-release
Created Jun 6, 2021 — forked from maxim/gh-dl-release
Download assets from private Github releases
View gh-dl-release
#!/usr/bin/env bash
# gh-dl-release! It works!
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
# bash generate random alphanumeric string
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
k8scat / ssl_smtp_example.go
Created May 19, 2021 — forked from chrisgillis/ssl_smtp_example.go
Golang SSL SMTP Example
View ssl_smtp_example.go
package main
import (
k8scat /
Created May 17, 2021 — forked from vitorbritto/
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
k8scat /
Created May 11, 2021 — forked from myusuf3/
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
k8scat / extract-credentials.groovy
Created Apr 13, 2021 — forked from pedrohdz/extract-credentials.groovy
Export credentials for Jenkins Configuration as Code (JCasC)
View extract-credentials.groovy
// This Jenkins Groovy script extracts credentials in Jenkins and outputs them
// in a JSON format that can be digested by "Jenkins Configuration as Code".
// Just pass the output into a JSON to YAML converter. You can run this
// through the Jenkins Script Console or similar.
// Thank you:
// -
// To conver to YAML `json2yaml | sed '/^[[:space:]]*$/d'`