Skip to content

Instantly share code, notes, and snippets.

View andrewspiers's full-sized avatar

Andrew Spiers andrewspiers

  • Melbourne, Australia
View GitHub Profile
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
@hardbyte
hardbyte / Automated TLS certificates on k8s.md
Last active September 17, 2018 22:00
Free automated TLS certificates on k8s

Cross posted from blog.n1analytics.com

At N1 Analytics we use Kubernetes for running experiments, continuous integration testing and deployment. In this post I document setting up a Kubernetes cluster to automatically provision TLS certificates from Let's Encrypt using Jetstack's Certificate Manager, the helm package manager and the nginx-ingress controller.

I wrote this after migrating our cluster from traefik to use cert manager and nginx-ingress. The end state will be one where we can create Kubernetes ingress with a TLS certificate with only a set of annotations in the respective helm template.

I'm going to assume some background knowlege for this post, if you haven't heard of [Let's Encrypt](https://letsencrypt.org/abou

@dutchiechris
dutchiechris / s3cmd_setup_sgws
Created June 20, 2017 12:44
setup s3cmd with netapp storageGRID Webscale (SGWS)
1) Install s3cmd
# pip install s3cmd
2) setup s3 (file on windows is C:\Users\<USER>\AppData\Roaming\s3cmd.ini)
access_key = <KEY_HERE>
secret_key = <SECRET_HERE>
check_ssl_certificate = False
check_ssl_hostname = False
host_base = <host>:8082
host_bucket = <host>:8082/%(bucket)
3) Run commands!
@d0ugal
d0ugal / references.txt
Last active March 25, 2017 13:07
Effective Code Review References
Code Complete by Steve McConnell
Jeff Atwood (Coding Horror)
https://blog.codinghorror.com/code-reviews-just-do-it/
Measuring Defect Potentials and Defect Removal Efficiency
http://rbcs-us.com/site/assets/files/1337/measuring-defect-potentials-and-defect-removal-efficiency.pdf
Expectations, Outcomes, and Challenges Of Modern Code Review
https://www.microsoft.com/en-us/research/publication/expectations-outcomes-and-challenges-of-modern-code-review/
@copperlight
copperlight / .bashrc
Created August 11, 2016 16:27
Window Subsystem for Linux ssh-agent Configuraton
# ... more above ...
# wsfl bash is not a login shell
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
------------------------------------------------------------
___
____ _ _____ _.-| | |\__/,| (`\
__ __/ ___| / \|_ _| { | | |x x |__ _) )
\ \/ / | / _ \ | | "-.|___| _.( T ) ` /
> <| |___ / ___ \| | .--'-`-. _((_ `^--' /_< \
/_/\_\\____/_/ \_\_| .+|______|__.-||__)`-'(((/ (((/
------------------------------------------------------------
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@drmalex07
drmalex07 / README-reverse-proxy-in-haproxy.md
Last active February 7, 2023 14:55
Perform simple reverse-proxying in HAProxy. #reverse-proxy #proxy #haproxy #proxypass

A more complete example (with rewriting cookie domains/paths) can be found at http://blog.haproxy.com/2014/04/28/howto-write-apache-proxypass-rules-in-haproxy/

We will try something roughly equivalent to the following ProxyPass directives in Apache2:

ServerName www.example.com
...
ProxyPass        /foo/  http://foo.local
ProxyPassReverse /foo/  http://foo.local

In haproxy.cfg we define a backend, say foo, to reverse-proxy to foo.local backend server.

@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins