Skip to content

Instantly share code, notes, and snippets.

View paflopes's full-sized avatar

Phillipe Lopes paflopes

View GitHub Profile
@vsomayaji
vsomayaji / template.yaml
Created September 14, 2018 18:22
Using a CFN custom resource to generate a random password
Resources:
PasswordGeneratorLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}-PasswordGenerator
RetentionInDays: 1
PasswordGeneratorRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
@RadValentin
RadValentin / yarn.unlock.md
Last active December 5, 2024 07:42
Solve `yarn.lock` or `package.json` conflicts without losing your mind

NOTE: This guide is ONLY for devs who don't want to edit their yarn.lock file by hand. If you don't care about that please carry on.


So you've pulled the latest master

git checkout master
git pull
@adambom
adambom / README.md
Last active May 27, 2024 07:51
Backup Kubernetes Cluster State

Run this in order to backup all you k8s cluster data. It will be saved in a folder bkp. To restore the cluster, you can run kubectl apply -f bkp.

Please note: this recovers all resources correctly, including dynamically generated PV's. However, it will not recover ELB endpoints. You will need to update any DNS entries manually, and manually remove the old ELB's.

Please note: This has not been tested with all resource types. Supported resource types include:

  • services
  • replicationcontrollers
  • secrets
  • deployments
  • horizontal pod autoscalers
# initialization file (not found)
@subfuzion
subfuzion / README.md
Last active December 9, 2017 15:59
Bootstrapping a local Docker 1.12 swarm with multiple virtualbox machines

Overview

It's easy enough to set up your machine as a swarm manager for local development on a single node swarm. But how about setting up multiple local nodes using Docker Machine in case you want to simulate a multiple node environment (maybe to test HA features)?

The following script demonstrates a simple way to specify the number of manager and worker nodes you want and then bootstrap a swarm.

You can also check out the sample as a Github project here.

@jonathantneal
jonathantneal / Demo
Created April 18, 2012 17:13
addEventListener for IE8
http://jsfiddle.net/GuQaV/show/
@solenoid
solenoid / gist:1372386
Created November 17, 2011 04:49
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};