Skip to content

Instantly share code, notes, and snippets.

View peterver's full-sized avatar
🎯
Focusing

Peter Vermeulen peterver

🎯
Focusing
View GitHub Profile
@peterver
peterver / mongo-atlas-whitelist-entrypoint.md
Created July 8, 2022 08:42 — forked from the-vampiire/mongo-atlas-whitelist-entrypoint.md
docker entrypoint to automatically whitelist mongo atlas IP

why

mongo atlas provides a reasonably priced access to a managed mongo DB. CSPs where containers are hosted charge too much for their managed mongo DB. they all suggest setting an insecure CIDR (0.0.0.0/0) to allow the container to access the cluster. this is obviously ridiculous.

this entrypoint script is surgical to maintain least privileged access. only the current hosted IP address of the service is whitelisted.

related searches, hope this shows up for you

  • "How to connect to mongodb atlas cluster to container app service EKS ECS cloudrun compute engine"
  • "mongodb atlas cluster access without using whitelist 0.0.0.0"
@peterver
peterver / example.test.js
Created July 29, 2018 14:35
Karma Setup with Chrome Headless + Jasmine + Webpack
import { guid } from '../../src/hash';
describe("Hash - Guid", () => {
it ('should output a string value', () => {
let g = guid();
expect(g).toEqual(jasmine.any(String));
});
});
// Based on the tests for @valkyriestudios/utils (github.com/valkyriestudios/utils)
@peterver
peterver / valkyrie_rsa.pub
Created March 28, 2018 07:00
valkyrie_pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPfXhxTLH/A0oJUx8aczDZUVwrfyiUFNNTnc5GujAMCdzlDfpcJBwbRKSQtA6hkH/qMbZCWedwliKRat9Oy7Aonun43i4qgEADOpOIwHrUVY59myZDOtf5C5pjhRK706Giwzl1xZcDv48ru4usM1JdGF0yZVx2QMz8+otJ4FL1RKDxoWblIzMasAdfIEi/43Xo4eMEzHyTlFPiVoth+P7heuHAz2dzIK+F3x1duQ2NhNjpCZoaNM7rhWRZ+ExArEHZj4Fkar2ePBUr/8DzyUmUk13YglMbIZBzG6/SC1C600mxmx0fs/8kPH89kMXw2ONdvlnUOrV5tNnnBTvgjOoun2zoBFohWXUrTKHZt3OM3OdOjF+TXRUkKQz0p2quox8To5aPqaryc7qi1tGYnLgiCMJbtZ1zbrkMHTIo6hApqNkAEQzKm4NoVTpvlxlhq1vcU0Pg0Wa0gK7D42ljA6OhrAdMKG1y4cBUwPkgjDdyMswaxF1J5+5lmT0E8aAtAwxU7p2Qjq7BMZJheIX8QT6Nax2heiQYXJtsv1eaTXwDTPQYw3GKmo8ijHTBAnNHs6k+29RD6WOedhFHeX+yZSBbxWl+QI69zG7mmnmE1ud4EQXkSjpjHLgqkVh3VYtX0JalhbDJApF0EE1zM6nrKeADxsow6qt6TrKBncSPGOPIOQ== contact@valkyriestudios.be

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@peterver
peterver / exitstatus.sh
Last active November 12, 2017 14:05
Supress all output but still retrieve the exit code of a command
#!/bin/bash
rep=$(...INSERT_COMMAND_HERE... 2>&1 >/dev/null)
status=$?
echo "$status"
@peterver
peterver / isdockerlive.sh
Created November 11, 2017 16:58
A shell script that uses curl to see if docker is up and running
#!/bin/bash
rep=$(curl -s --unix-socket /var/run/docker.sock http://ping > /dev/null)
status=$?
if [ "$status" == "7" ]; then
echo 'not connected'
exit 1
fi
@peterver
peterver / tslint.json
Last active November 17, 2016 23:57
Standard TSLint Configuration
{
"rulesDirectory": "node_modules/tslint-eslint-rules/dist/rules",
"rules" : {
"align" : ["parameters", "arguments", "statements"],
"array-bracket-spacing" : [true, "never"],
"arrow-parens" : true,
"brace-style" : true,
"comment-format": [true, "check-space", "check-uppercase"],
"curly" : true,
"cyclomatic-complexity": [true, 15],
@peterver
peterver / .vimrc
Created September 27, 2016 09:38
Standard .vimrc
set nocompatible
""""""""""""""""""""""""""""""""""""""""
" VUNDLE
""""""""""""""""""""""""""""""""""""""""
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@peterver
peterver / config
Created September 19, 2016 08:23
Default MOCP setup
ReadTags = yes
Sort = FileName
ShowStreamErrors = no
MP3IgnoreCRCErrors = yes
Repeat = no
Shuffle = no
AutoNext = yes
@peterver
peterver / Detector.js
Created September 16, 2016 10:54
Detector of browser functions
// Detect canvas support
const DETECTOR = Object.freeze({
CANVAS : (function () {
if (window.CanvasRenderingContext2D) {
return 'canvas';
}
return false;
})(),
CLASSLIST : (function () {
return ('classList' in document.createElement('a'));