Skip to content

Instantly share code, notes, and snippets.

View bdashrad's full-sized avatar
😎

Brad Clark bdashrad

😎
View GitHub Profile
#!/bin/bash
TIMESTAMP=$(date +"%Y%m%d")
FS_FILENAME=ha-file-system-backup-$TIMESTAMP.tar.gz
SQL_FILENAME=ha-database-backup-$TIMESTAMP.sql.gz
# Removed influxdb since it's getting huge and I don't really
# think I have much benefit in backng it up
cd /local
@bdashrad
bdashrad / conventional_commits.md
Last active March 28, 2022 21:10
Conventional Commits and Changelogs
@bdashrad
bdashrad / management_questions.md
Last active June 21, 2023 17:16
Team Management Questions

Be a good manager

Know your team

  • Do you feel like you’re part of a team?
  • Are you comfortable expressing your opinions?
  • When you speak up, are your opinions valued?
  • Do you feel confident you can be your authentic self at work?
  • What, if anything, would make you feel more comfortable?

Feedback

@bdashrad
bdashrad / pihole-sync.sh
Created April 18, 2020 16:55
pihole sync example
#!/usr/bin/env bash
# Perform maintenance on secondary Pi if online
pi=$(timeout 0.2 ping -c1 10.0.0.3 &> /dev/null && echo "0" || echo "1")
if [ "$jd" -eq 0 ]; then
cd /etc/pihole/
ssh -i /root/.ssh/id.pi "pi@10.0.0.3" "[ ! -f '~/pihole' ] && mkdir ~/pihole"
scp -i /root/.ssh/id.pi adlists.list *list.txt setupVars.conf *.domains pi@10.0.0.3:~/pihole
scp -i /root/.ssh/id.pi /etc/dnsmasq.d/03-pihole-wildcard.conf pi@10.0.0.3:~/pihole/03-pihole-wildcard.conf
ssh -i /root/.ssh/id.pi "pi@10.0.0.3" "sudo mv ~/pihole/03-pihole-wildcard.conf /etc/dnsmasq.d; sudo mv ~/pihole/* /etc/pihole"
@bdashrad
bdashrad / k8s_service_role.tf
Created December 20, 2019 21:04
k8s assume role
variable "environment" {
type = string
description = "A name identifying a type of resource i.e., qa, staging, release"
}
variable "name" {
type = string
description = "Name of service"
}
@bdashrad
bdashrad / interviewer_questions.md
Last active September 3, 2023 13:28
Interviewer Questions

Questions to ask your interviewer

Management

  • What problem do you solve and why would I give you money to solve it?
  • When’s the last time someone went above and beyond the call of duty at the company/on the team? What did they do?
  • What are the current goals that the company is focused on, and how does this team/role work to support hitting those goals?
  • What are the projects in this company you think are really key to its future and how would a motivated person go about getting on them?
  • What do you see as your largest technical challenge currently?
  • Pain Points beyond headcount
  • What is a project you wish a new member of the team could take on?
#!/usr/bin/env ruby
require 'netaddr'
regexfile = ARGV[0]
testfile = ARGV[1]
regex = Regexp.new(File.read(regexfile)).freeze
File.foreach(testfile) do |test|
#!/usr/bin/env ruby
require 'json'
require 'open-uri'
phones = {
'64 gb silver att' => 'MG4X2LL%2FA',
'64 gb gray att' => 'MG4W2LL%2FA',
'64 gb gold att' => 'MG502LL%2FA'
}
#!/usr/bin/python
import sys
def cidr_to_regex(cidr):
ip, prefix = cidr.split('/')
base = 0
for val in map(int, ip.split('.')):
base = (base << 8) | val