Skip to content

Instantly share code, notes, and snippets.

@k8scat
k8scat / rm_mysql.md
Created May 17, 2021 14:31 — forked from vitorbritto/rm_mysql.md
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
k8scat / ssl_smtp_example.go
Created May 19, 2021 07:54 — forked from chrisgillis/ssl_smtp_example.go
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
#!/bin/bash
# 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
k8scat / gh-dl-release
Created June 6, 2021 18:27 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/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.
#
# PREREQUISITES
#
@k8scat
k8scat / openresty.service
Created June 9, 2021 02:52 — forked from HauptJ/openresty.service
OpenResty Systemd service file
# Stop dance for OpenResty
# A modification of the Nginx systemd script
# Source: https://www.digitalocean.com/community/tutorials/how-to-use-the-openresty-web-framework-for-nginx-on-ubuntu-16-04
# =======================
#
# 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
k8scat / install_openresty.sh
Last active March 12, 2024 04:48
Install OpenResty on Ubuntu from source code.
#!/bin/bash
set -e
rm -rf openresty-1.19.3.2 openresty-1.19.3.2.tar.gz
apt-get update -y
apt-get install -y libpcre3-dev \
libssl-dev \
perl \
make \
build-essential \
@k8scat
k8scat / git-fetch.sh
Last active August 4, 2021 05:43
git-fetch
# Delete local tags
git tag -l | xargs git tag -d && git fetch origin
# Prune local branches
git fetch origin --prune -q
# Prune local branches/tags
git fetch origin --prune --prune-tags -q
@k8scat
k8scat / git-template.sh
Created August 4, 2021 17:10
git-template
# centos: cd /usr/share/git-core/templates/
# https://stackoverflow.com/questions/2293498/applying-a-git-post-commit-hook-to-all-current-and-future-repos
git config --global init.templatedir '~/.git_template'
@k8scat
k8scat / unprotect_gitlab_branches.py
Last active August 21, 2021 07:14
Batch Unprotect GitLab protected_branches via python
import requests
import json
import logging
class GitLab:
token = ''
auth_headers = None
base_api = 'https://gitlab.com/api/v4'
client = None
### Keybase proof
I hereby claim:
* I am k8scat on github.
* I am k8scat (https://keybase.io/k8scat) on keybase.
* I have a public key whose fingerprint is 9136 F38B 2DC8 7ABB 204B D0D6 CFB6 A936 4A3D 8FF5
To claim this, I am signing this object: