Skip to content

Instantly share code, notes, and snippets.

---
- job:
name: ops/cloudflare-abuse
description: 'Checks Cloudflare for domains that have abuse reports and alerts @ops '
defaults: global
properties:
- build-discarder:
num-to-keep: 100
artifact-num-to-keep: 1
triggers:
@pysysops
pysysops / evil_orgs.txt
Created February 20, 2020 20:02
A list of evil organisations that I will never consider working for.
Barclays
BBC
Caterpillar
LGV
IBM
Oracle
Northrup Grumman
Boeing
Boston Dynamics
British Aerospace
@pysysops
pysysops / bash-template.sh
Last active November 20, 2019 09:33
Template for a bash script that has simple logging and color / formatting presets
#!/usr/bin/env bash
# Surrounding in brackets ensures that the whole script gets loaded to memory
# before running which allows us to update the script from the script without
# issue.
{
set -eu -o pipefail
# Let's make some pretty stuff
COLOR_RESET="$(tput sgr0)"
@pysysops
pysysops / open
Last active October 14, 2019 07:44
Override the open command on Mac to open isolated, minimal browsers in incognito and cleanup
#!/usr/bin/env bash
# Add $HOME/.bin to the beginning of your PATH
# Save this file in $HOME/.bin/open and make it executable
if ! echo "$@" | grep -q http; then
/usr/bin/open $@
exit $?
fi
@pysysops
pysysops / package.json
Last active October 17, 2019 12:37
Tag / Version control any git repo with yarn
{
"name": "MyCoolApp",
"description": "Does a really cool thing",
"version": "0.0.0",
"private": true,
"scripts": {
"test": "true",
"gitbranch": "BRANCH=$(git rev-parse --abbrev-ref HEAD); if [[ \"$BRANCH\" != \"master\" ]]; then echo \"you must be on master branch to release\"; exit 1 ; fi",
"gitstatus": "STATUS=$(git status --porcelain 2>&1); echo $STATUS; if [[ ! -z \"$STATUS\" ]]; then exit 1; fi;",
"gittest": "yarn gitbranch && yarn gitstatus",
@pysysops
pysysops / my-zsh.txt
Created October 8, 2019 12:18
My mac setup (some of it)
brew install minikube spectacles tfenv aws-vault zsh zsh-completions zsh-syntax-highlighting
brew install terragrunt --ignore-dependencies
brew tap devopsmakers/xterrafile && brew install xterrafile
echo "/usr/local/bin/zsh" | sudo tee -a /etc/shells
chsh -s /usr/local/bin/zsh
@pysysops
pysysops / xterrafile4salt
Created September 30, 2019 11:06
xterrafile for Saltstack formulas
# Sometimes you want to package up and deploy your code as an rpm, deb, tar.gz...
# You want to be sure that your Saltstack formulas are version controlled and easily updateable.
# XTerrafile can help you do that.
# Create a "Saltfile" (it's just a YAML file and can be named anything. Example:
salt-formula-linux:
source: "https://github.com/salt-formulas/salt-formula-linux.git"
version: "72507a1b25fce6f7ec0d9532129a1619c3646927"
@pysysops
pysysops / custom_awsvault.p10k.zsh.part
Last active October 26, 2023 09:52
Powerlevel10k custom prompt config for use with aws-vault https://github.com/99designs/aws-vault
##############[ custom_awsvault: current aws account (https://github.com/99designs/aws-vault) ]###############
awsvault_prompt() {
if [ ! -z "${AWS_VAULT-}" ]; then
echo -n " ${AWS_VAULT-} "
fi
}
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT="awsvault_prompt"
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT_FOREGROUND="black"
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT_BACKGROUND="yellow"
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT_VISUAL_IDENTIFIER_EXPANSION=' ☁️'
@pysysops
pysysops / AWSAssumeRole
Last active June 25, 2019 18:12
installing aws-assume-role (https://github.com/scalefactory/aws-assume-role) and functions to ease interaction.
gem install aws_assume_role
echo 'awsassume () { eval `aws-assume-role environment set -p $@`; }' >> ~/.bashrc
echo 'awsconsole () { eval `aws-assume-role console -p $@`; }' >> ~/.bashrc
@pysysops
pysysops / number2roman.sh
Created November 27, 2018 19:02
Convert numbers to Roman numerals
#!/bin/bash
set -eu -o pipefail
number=$1
# Test that it is valid
[[ "${number//[0-9]/}" == "" ]] || \
{ echo Number ${number} contains invalid characters ; \
exit 1 ;}