Skip to content

Instantly share code, notes, and snippets.

View shoesCodeFor's full-sized avatar

Schuyler Ankele shoesCodeFor

View GitHub Profile
@shoesCodeFor
shoesCodeFor / Runbook_Guidelines.md
Created April 4, 2024 18:31
WTF is a Runbook? Effective guide to runbook radness!

Runbook Radness

What the French toast is a runbook? A good runbook is a comprehensive, clear, and actionable guide that enables IT and operations teams to manage and troubleshoot systems efficiently. It serves as a critical resource for both experienced professionals and those new to a system, ensuring consistent and effective handling of routine tasks, incidents, and procedures. Here are the key characteristics that make a runbook effective:

1. Actionable

A runbook must provide step-by-step instructions that are straightforward and easy to follow. Each step should build towards achieving a specific outcome, with unnecessary details omitted to keep the document concise and focused on the task at hand[1][6][8].

2. Accessible

The runbook should be easily accessible to all relevant team members. This includes being stored in a location that team members are aware of and can easily retrieve when needed. The runbook should support alerts and be searchable, with metadata such as type, creation

@shoesCodeFor
shoesCodeFor / redis_unaliver.sh
Created March 8, 2024 19:21
Redis pods backup/killer
#!/bin/bash
# Set the namespace variable
namespace="tools"
# Get the list of pods
pods=$(kubectl get pods -n "${namespace}" -o custom-columns=:metadata.name | grep "redis-cluster")
# Check if we got the pods
if [ -z "$pods" ]; then
@shoesCodeFor
shoesCodeFor / dnyes.sh
Last active December 12, 2023 23:31
dnyes.sh
#!/bin/bash
# Define the network service. Replace "Wi-Fi" with your actual network service name, e.g., "Ethernet", if needed.
NETWORK_SERVICE="Wi-Fi"
# Safe DNS list
GOOGLE_DNS="8.8.8.8"
GOOGLE_DNS_ALT="8.8.4.4"
CLOUDFLARE_DNS="1.1.1.1"
CLOUDFLARE_DNS_ALT="1.0.0.1"
@shoesCodeFor
shoesCodeFor / cleanUpDocker.sh
Last active November 20, 2021 00:06
Clean up docker - stop containers, remove containers and purge/delete images
function clean_up_docker {
echo "Stopping all running containers"
docker stop $(docker ps -aq)
echo "Removing all containers"
docker rm $(docker ps -aq)
echo "Remove all images"
docker rmi $(docker images -q)
echo "Doesn't that feel better?! Have a lovely day"
}
@shoesCodeFor
shoesCodeFor / simple_firefox_login.rb
Created April 24, 2019 16:21
Simple Firefox/Selenium Login
require "selenium-webdriver"
# Not quite sure where Selenium think the Firefox binary is by default
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://duckduckgo.com"
element = driver.find_element(name: 'q')
element.send_keys "Selenium Firefox Ruby Bindings"
element.submit
@shoesCodeFor
shoesCodeFor / simple_login.rb
Last active April 24, 2019 16:14
Basic Chrome/Selenium login with Ruby
require "selenium-webdriver"
driver = Selenium::WebDriver.for :chrome
wait = Selenium::WebDriver::Wait.new(:timeout => 18)
driver.navigate.to "https://someloginsite.web"
sleep 2
element = driver.find_element(:class, "username")
element.send_keys "SOMEUSER@TEST.COM"
pwd = driver.find_element(:class, "password")
pwd.send_keys "MyPasswords"
@shoesCodeFor
shoesCodeFor / aggregate_view_categories.sql
Created November 13, 2018 20:09
GoSpotCheck Coding Exercise
-- Step 6
create view category_aggregate (category, total_places, total_chairs) as
select
category,
count(cafe),
sum(number_of_chairs)
from street_cafes group by category;
@shoesCodeFor
shoesCodeFor / 1.png
Created August 29, 2018 20:23 — forked from jeffkreeftmeijer/1.png
Delta-E image diff
1.png
@shoesCodeFor
shoesCodeFor / selenium-webdriver-cheatsheet.md
Last active February 13, 2024 21:43 — forked from huangzhichong/selenium-webdriver-cheatsheet.md
Ruby Selenium Webdriver CheatSheet

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
@shoesCodeFor
shoesCodeFor / getOS.rb
Created July 20, 2018 21:08
Simple method to find host OS versioning in Ruby
#!/usr/bin/env ruby
# Ruby code snippets to determine MacOS versioning with more to come
# Inspired by AJ Acevedo's Gist: https://gist.github.com/AJ-Acevedo/5421660
##############################################################
# RbConfig to determine host OS and exit if not mac or linux #
##############################################################