Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Bolinger ericbisme

View GitHub Profile
View gist:9c81d327c5227cc539b365b300977c67
awk -v t=2592000 '$1 < t { exit 0 ; } $1 >= t { exit 1 ; }' /proc/uptime
View k8s-snippets
k cordon $(k get nodes --no-headers | awk 'BEGIN { ORS=" " }; $5 == "v1.15.11-eks-14f01f" {print $1}' )
kubectl cordon $(kubectl get no --no-headers -o go-template --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' | awk 'BEGIN { ORS=" " }; $2 <= "'$(date -u -v -10d +%Y-%m-%dT%H:%M:%SZ)'" { print $1 }')
aws autoscaling describe-auto-scaling-groups --output table --query "AutoScalingGroups[? Tags[? (Key=='k8s.io/cluster/XXXX') && Value=='owned']]".'[AutoScalingGroupName,DesiredCapacity]'
@ericbisme
ericbisme / gitlab-runner-job.yaml
Last active Jan 27, 2020
Kubernetes Job to deploy gitlab-runner from a helm chart
View gitlab-runner-job.yaml
# Initialize a gitlab-runner in a utility namespace dedicated to customer namespace
# Designed to faciliate customer self-service to their namespace(s) via GitLab
---
apiVersion: batch/v1
kind: Job
metadata:
name: deploy-gitlab-runner-<customer>-<namespace>
spec:
ttlSecondsAfterFinished: 100
template:
@ericbisme
ericbisme / es_bootstrap_passwords.sh
Last active Jan 7, 2019
ES bootstrap password script
View es_bootstrap_passwords.sh
#!/bin/bash
# https://discuss.elastic.co/t/how-to-set-passwords-for-built-in-users-in-batch-mode/119655/7
# Passwords:
BOOTSTRAP="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)"
ELASTIC=""
KIBANA=""
LOGSTASH_SYSTEM=""
BEATS_SYSTEM=""
@ericbisme
ericbisme / 10-thepit.conf
Last active Jan 21, 2019
dnsmasq supplementary config for local DNS
View 10-thepit.conf
echo 'address=/ericbisme.net/192.168.10.128 # K8s Ingress' > /etc/dnsmasq.d/10-thepit.conf && \
echo 'address=/pi.hole/192.168.10.128 # pi-hole address' >> /etc/dnsmasq.d/10-thepit.conf && \
echo 'server=/thepit.ericbisme.net/1.1.1.1 # Resolve externally' >> /etc/dnsmasq.d/10-thepit.conf && \
service dnsmasq restart
address=/ericbisme.net/192.168.10.128 # K8s Ingress
address=/pi.hole/192.168.10.128 # pi-hole address
server=/thepit.ericbisme.net/1.1.1.1
{
View web.pp
# Install Grey Heller ERP Firewall Web files
class greyheller::erpfirewall::web (
$archive_location = hiera('erp_firewall_basedir'),
$psft_install_user_name = hiera('psft_install_user_name'),
$psft_runtime_user_name = hiera('psft_runtime_user_name'),
$ps_home_location = hiera('ps_home_location'),
$ps_config_home = hiera('ps_config_home'),
$pia_domain_name = hiera('pia_domain_name'),
$failopen = false,
$enabled = true,
View ps_weblogic_setenv.pp
#Set Heapsize in WebLogic setEnv.sh
class cu_ps_weblogic::ps_weblogic_setenv (
$ps_config_home = hiera('ps_config_home'),
$pia_domain_name = hiera('pia_domain_name'),
$wl_heapsize = hiera('wl_heapsize'),
$wl_threadpool = hiera('wl_threadpool'),
){
Ini_Subsetting {
path => "${ps_config_home}/webserv/${pia_domain_name}/bin/setEnv.sh",
@ericbisme
ericbisme / module_differences.txt
Created Jun 29, 2017
Notes on Differences between PT 8.55 and 8.56 Puppet Modules
View module_differences.txt
bashrc template. hardcodes different Tuxedo version.
View hiera.yaml
# managed by puppet
---
:backends:
- eyaml
- yaml
:logger: console
:hierarchy:
- "nodes/%{::clientcert}"
You can’t perform that action at this time.