Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Hoshor russianryebread

View GitHub Profile
@russianryebread
russianryebread / exec.sh
Created Apr 18, 2020
Quick way to exec into a pod in K8s
View exec.sh
#!/bin/bash
# Usage:
# ./exec.sh api
NAMESPACE="qa"
CONTAINER_NAME=$(kubectl get pods -n $NAMESPACE | awk -v pattern="$1" '$0 ~ pattern { print $1 }')
kubectl -n $NAMESPACE exec -it $CONTAINER_NAME /bin/bash
@russianryebread
russianryebread / index.html
Last active Jul 15, 2020
Random string generator written in Vue.js https://hoshor.me/rand/
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Random String Generator</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/dark.min.css">
<style type="text/css">
.randomString {
@russianryebread
russianryebread / 500.html
Last active Apr 17, 2019
Clean Error Page
View 500.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Internal Server Error</title>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
View ask_the_duck.md

Ask the Duck

January 6th, 2012
https://hwrnmnbsol.livejournal.com/148664.html

When I was a younger person, my first full-time adult-type job was designing automatic fire sprinkler systems. It was an eye-opening and educational experience, and even though the job basically sucked, I learned all kinds of crazy stuff in that job that I use daily in my present-day non-sucky job, so I can't complain.

One interesting lesson was learned at the hand of the Chief Superintendant, Bob. Bob was in charge of installing the systems that me and my group designed. People who put things in, I quickly learned, have a wealth of knowledge and experience about things that people who only design never gain. As a result, when I first started in that job, I wound up going and bugging Bob for answers on a regular basis.

This annoyed Bob. Bob liked to sit in his office and shoot the shit with his buddies on the topics of fishing or hunting. He did not like fielding questions from young designers. This was especially true becaus

@russianryebread
russianryebread / easing.js
Created Jan 24, 2019 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@russianryebread
russianryebread / conn_count.sql
Created Dec 24, 2018
Get connection counts by user in MySQL
View conn_count.sql
SELECT USER, count(*) AS connection_count
FROM information_schema.processlist
GROUP BY USER
ORDER BY connection_count DESC;
View cursor.png
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABgWlDQ1BzUkdCIElFQzYxOTY2LTIuMQAAKJF1kc8rRFEUxz8zQ8RMiIWFxUtYDflRExtlJJSkMcpgM/PMDzVv5vXemyRbZTtFiY1fC/4CtspaKSIlCytrYoOe8zw1kjm3c8/nfu89p3vPBW80q2pmRTdoOcuIjIaV2dicUvWInwYq6SUQV019aGpqgrL2doPHiVedTq3y5/612sWkqYKnWnhQ1Q1LeEx4YtnSHd4UblIz8UXhY+GgIRcUvnb0hMtPDqdd/nDYiEaGwVsvrKR/ceIXqxlDE5aX06ZlC+rPfZyX+JO5mWmJreItmEQYJYzCOCMME6KHAZlDdEp/umRFmfzu7/xJ8pKryqyzgsESaTJYBEUtSPWkxJToSRlZVpz+/+2rmerrdav7w1D5YNsv7VC1AZ9F237ft+3PA/Ddw1mulJ/fg/5X0YslrW0X6tbg5LykJbbgdB2a7/S4Ef+WfOLeVAqejyAQg8ZLqJl3e/azz+EtRFflqy5gewc65HzdwhdEiWfWzqHdKwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAA3NJREFUWIW11m9MG2UcwPHvtde7Ky1MMuMLQtFXiwuMwVJRNzWD4Mb/UWKMiW81vvOFL4ElvhBQ3/lib0xm4htjohulGGPc4gZjpWywfyYmEg3/shfTOFeEPr1b2/NFr10LbVlp+yT36rnc5/t77ppUMk2TSi+nqjiBr4FW4B2hG0vpTdM0K3ppiqNKUxyXuryN5sjQG6amOB5qiuNYal+u8ORVwPTJ5kMd377bgmqTkG1S7WeB4GWnqnQK3bglVeoVpPC3Tx7uONd7BBkpvTcxu8Hn08F/gc6KBFj4D68fe759clhH2TxM/J/nsu75+MoaX/wY+sNWIXz6tdaG9slhnSqXjuPFEHLd3+l7wkaC+T8fANwr6wlk4B3+EYMql450IAqSCY8dGM
View keybase.md

Keybase proof

I hereby claim:

  • I am russianryebread on github.
  • I am russianryebread (https://keybase.io/russianryebread) on keybase.
  • I have a public key ASC4FhSiTzX7QH7KPHz0N9L-qEBfxpQs0X10F4ItgI65MAo

To claim this, I am signing this object:

@russianryebread
russianryebread / phptags.php
Created Jul 14, 2017
PHP Whitespace Detector (phptags) [Requires PHP 5]
View phptags.php
#!/usr/bin/php -qCdshort_open_tag=1
<?php
/**
* api: cli
* type: application
* title: PHP tag tidier
* description: Rewrites PHP scripts' short/long open tags, close tags, apply whitespace fixes
* version: 1.1
* license: Public Domain
* author: mario <mario#include-once:org>
@russianryebread
russianryebread / docker_1.13.0.md
Last active Feb 10, 2021
Docker Disk Management
View docker_1.13.0.md

See Used Space

docker system df         # Show docker disk usage, including space reclaimable by pruning

Reclaim Disk Space

docker container prune   # Remove all stopped containers
docker volume prune      # Remove all unused volumes

docker image prune # Remove unused images