Skip to content

Instantly share code, notes, and snippets.

@vindir
vindir / parse_dotenv.bash
Created November 24, 2020 07:06 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@vindir
vindir / devops_best_practices.md
Created September 7, 2020 07:59 — forked from jpswade/devops_best_practices.md
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.

In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.

Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud

@vindir
vindir / devops_best_practices.md
Created September 7, 2020 07:59 — forked from jpswade/devops_best_practices.md
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.

In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.

Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud

@vindir
vindir / s3_client.py
Created January 22, 2020 17:39 — forked from tamouse/s3_client.py
Example: An S3 proxy client written in Python
"""
The server application uses AWS S3 in various places.
This utility provides a common place for interacting
with S3 and handles the authentication in a unified manner.
"""
import os.path
import logging
@vindir
vindir / Makefile
Created April 4, 2018 18:25 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@vindir
vindir / merge_git_repos.md
Created January 29, 2018 18:26 — forked from bxt/merge_git_repos.md
Git: Merge other repository into subfolder

Copy the child repo to your /tmp (Or into another ramdisk, should be faster)

cd into the new repo.

Now lets rewirte stuff.

Move into subdirectory (here called "report"):

git filter-branch --index-filter \

'git ls-files -s | sed "s-$(printf '''\t''')"*-&report/-" |

@vindir
vindir / Docker-find-dependent-child-image.md
Created October 24, 2017 17:16 — forked from Siva-Charan/Docker-find-dependent-child-image.md
Docker: How to find the dependent child images?

Find the dependent child images on Docker

When you try to remove the docker image with the following command

docker rmi 6795374be8c1

Sometimes you might be facing below error:

Error response from daemon: conflict: unable to delete 6795374be8c1 (cannot be forced) - image has dependent child images

Below is the Docker command line used to find the dependent child images

@vindir
vindir / curl.md
Created October 19, 2017 17:57 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@vindir
vindir / simulateSlowMongod.sh
Created June 20, 2017 13:57 — forked from aheckmann/simulateSlowMongod.sh
simulate high latency replica sets (mac)
# first set up a pipe named "2" with bandwidth
# limited to 16kbit/s and latency of 100ms
sudo ipfw pipe 2 config bw 16Kbit/s delay 100ms
# next add rule #1 using the pipe we set up, configured to
# act only on local tcp traffic going to port 27019
sudo ipfw add 1 pipe 2 tcp from me to me 27019 out
# now you should be observing slow ping times for
# mongod on 27019
@vindir
vindir / Mac SSH Autocomplete
Created February 21, 2017 20:28 — forked from aliang/Mac SSH Autocomplete
Add auto complete to your ssh, put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;