Skip to content

Instantly share code, notes, and snippets.

@geekmuse
geekmuse / install_k8s_master_conf.sh
Created March 9, 2019 16:51
Install k8s - master config
#!/bin/bash
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml
@geekmuse
geekmuse / install_k8s.sh
Created March 9, 2019 16:47
Install k8s
#!/bin/bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
@geekmuse
geekmuse / build_nginx.sh
Last active July 12, 2019 00:37 — forked from MattWilcox/build_nginx.sh
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi with optional TLS1.3 support
#!/usr/bin/env bash
## names of latest versions of each package
VERSION_PCRE=pcre-8.43
VERSION_OPENSSL=OpenSSL_1_1_1c
VERSION_NGINX=nginx-1.17.1
SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
SOURCE_OPENSSL=https://www.openssl.org/source/
SOURCE_NGINX=http://nginx.org/download/
@geekmuse
geekmuse / index.py
Last active May 9, 2019 00:48
cross account lambda
# Steps to use:
# - For each account, create a cross-account role in the target account(s) -
# in this case I called my role "bsi_lambda_full". Make sure the target account
# roles grant sufficient IAM privs for the operations in the Lambda fxn.
# - The role that the Lambda account executes under in the master account only needs
# to grant "sts:AssumeRole" to the "lambda.amazonaws.com" AWS principal.
# - On each of the target account roles, specify the principal as the *ARN
# of the role* that the Lambda executes under in the master account.
# - Create an env var for the Lambda called "acct_nums", whose value is a
# pipe-delimited ("|") list of account numbers, e.g. 000000000000|111111111111|222222222222
@geekmuse
geekmuse / logstash.conf
Created April 25, 2017 03:23
Logstash 5.3.1 Upstart init Script for Amazon Linux
# File: /etc/init/logstash.conf
# O:G: root:root
# Perms: 0644
description "logstash"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
respawn
umask 022
nice 19
@geekmuse
geekmuse / keybase.md
Created November 8, 2016 20:57
Keybase.io identity proving file

Keybase proof

I hereby claim:

  • I am geekmuse on github.
  • I am geekmuse (https://keybase.io/geekmuse) on keybase.
  • I have a public key whose fingerprint is C67F A91A 2451 0ABF 7162 A111 CD41 D423 211C 8A36

To claim this, I am signing this object:

@geekmuse
geekmuse / sierra-get-site-fixes.pl
Last active December 19, 2015 18:38
A Perl script that logs in to the CSDirect website using supplied CSDirect credentials and scrapes the appropriate Sierra fixes webpages and compiles an Excel workbook containing those fixes. Individual users of this file will want to edit the $csDirectUsername and $csDirectPass variables to the values supplied when logging in to the CSDirect pa…
#!/usr/bin/perl -w
use URI;
use Web::Scraper;
use Excel::Writer::XLSX;
use Time::Piece;
# Your CSDirect login credentials. These need to be provided in order to pass the HTTP
# authentication on the CSDirect pages.
my $csDirectUsername = 'ABCDE';
@geekmuse
geekmuse / sierra-get-fines.pl
Created May 31, 2013 12:21
A simple Perl script that queries the Sierra database for current patrons with fines. The script gets the patron info, their associated fine info, and puts all of the information into an Excel spreadsheet.
#!/usr/bin/perl
# load modules
use DBI;
use Excel::Writer::XLSX;
use DateTime;
use DateTime::Format::Pg;
# the hostname of your Sierra database server
my $dbhost = "sierradb.myschool.edu";