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 / 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 / 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 / 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 / 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 / scsslint-strict
Last active December 20, 2016 03:18
Default SCSS Lint - Pretty strict
linters:
BorderZero:
enabled: true
CapitalizationInSelector:
enabled: false
ColorKeyword:
enabled: true
@peterver
peterver / .eslintrc
Last active December 12, 2016 23:36
Standard eslintrc
{
"env": {
"browser": true
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
@peterver
peterver / .editorconfig
Last active December 4, 2016 20:07
Standard editor config
root = true
[*.scss]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
[*.json]
@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],