Skip to content

Instantly share code, notes, and snippets.

@pandorasNox
pandorasNox / sh_arg_iteration.sh
Created October 10, 2017 00:41
iterate over sh arguments and concat them (sh !!! not bash)
#!/bin/sh
# exit code
E_BADARGS=85
ARG_LIST=""
index=0 # Reset count.
for arg in "$@"
do
#skipp first argument
@pandorasNox
pandorasNox / nginxproxy.md
Created January 31, 2018 17:24 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@pandorasNox
pandorasNox / README.md
Created March 28, 2018 15:46 — forked from barneycarroll/README.md
Lock and unlock a page's scroll position.

jquery.scrollLock.js

Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.

// Locks the page if it's currently unlocked
$.scrollLock();

// ...or vice versa
@pandorasNox
pandorasNox / git-origins.md
Created June 15, 2018 14:15 — forked from benschw/git-origins.md
fork a repo manually (set source as upstream origin) rather than with the "fork" button. e.g. for in github when you want to fork a project twice.

Ripped off from adrianshort.org

List curent remotes

$ git remote -v

origin  https://github.com/hakimel/reveal.js.git (fetch)
origin  https://github.com/hakimel/reveal.js.git (push)

Rename origin to upstream and add our new empty repo as the origin.

@pandorasNox
pandorasNox / kubectl.md
Created August 21, 2018 12:47 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no

kubernetes update strategy

  • have a test clsuter in place
  • only update the kubernetes version
    • when required update additional components (e.g. etcd, but when not neccessary do that in a seperated update move)
  • make a list with all (third party) tools which are talking to the kubernetes API
    • e.g.
      • CI/CD kubectl tools
      • bash scripte
  • golang cli tools
```
curl http://localhost:9200
```
docker rmi $(docker images -q -f dangling=true)

docker run --rm -e MINIO_ACCESS_KEY=admin -e MINIO_SECRET_KEY=password -p 9083:9083 minio/minio server /data --address :9083