Skip to content

Instantly share code, notes, and snippets.

View Lngramos's full-sized avatar

Luis Ramos Lngramos

  • Amazon Web Services
  • London, United Kingdom
  • 04:06 (UTC)
  • LinkedIn in/lngramos
View GitHub Profile
@Lngramos
Lngramos / gist:d9ce9bc87cd74599cb474ae97445812e
Created November 20, 2019 10:03
AWS-owned NAT instance AMIs
aws ec2 describe-images --filter Name="owner-alias",Values="amazon" --filter Name="name",Values="amzn-ami-vpc-nat*"
@Lngramos
Lngramos / gist:a1d739a9fbd22fa38d06327ac81c1702
Created November 19, 2019 11:10
Re-create DaemonSet object without deleting existing pods
kubectl get -o yaml ds kube2iam > kube2iam.yml
kubectl delete --cascade=false ds kube2iam
kubectl apply -f kube2iam.yml
@Lngramos
Lngramos / bar.js
Last active January 9, 2021 01:41
test
(function () {
const app = window.app;
console.log('The sum is: ',app.sum(2, 5));
console.log("The word is: " + app.word);
})();
@Lngramos
Lngramos / configure_efs_mount.sh
Created January 4, 2019 18:35
Automatically discover EFS filesystem, configure and mount as EC2 instance boot
#!/bin/bash
set -e
AWS_REGION=$(curl -s -f http://169.254.169.254/latest/dynamic/instance-identity/document | jq .region -r)
echo "Detected AWS Region: $AWS_REGION"
INSTANCE_ID=$(curl -s -f http://169.254.169.254/latest/meta-data/instance-id)
echo "Retrieved instance ID: $INSTANCE_ID"

Keybase proof

I hereby claim:

  • I am lngramos on github.
  • I am luisramos (https://keybase.io/luisramos) on keybase.
  • I have a public key ASChyzVYBGOWJsJCVQVjdCPpQg-kYqseyg8DjY9THWq02Qo

To claim this, I am signing this object:

@Lngramos
Lngramos / webhop-runscope-service-discovery-proposal.md
Last active January 9, 2021 01:34
Runscope Service Discovery Proposal for WEBHOP Ops

Runscope Service Discovery Proposal for WEBHOP Ops

Introduction

A unified approach is required as to how Runscope determines the health of services running inside the ‘ops’ VPC to ensure that all platforms are consistent.

This document describes a proposal for implementing an ELB-based service discovery for components within the ‘ops’ VPC, but also highlights other approaches and explains why an ELB-based solution might be the most practical and simplest solution.

Problems

  1. Our services aren’t accessible over the Internet, making it impossible for Runscope to be able to monitor them.

    Note: this is no longer a problem, as we have setup a Runscope Agent within our ops infrastructure to allow Runscope access to our private service APIs.

@Lngramos
Lngramos / Installation.md
Created April 4, 2017 15:55 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@Lngramos
Lngramos / SassMeister-input-HTML.html
Last active February 16, 2016 18:00
Generated by SassMeister.com.
<div class="background background--animate"></div>
@Lngramos
Lngramos / SassMeister-input-HTML.html
Created February 16, 2016 14:25
Generated by SassMeister.com.
<div>
<ul>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
<li>e</li>
<li>f</li>
<li>g</li>
<li>h</li>
@Lngramos
Lngramos / decode-base64-to-images.py
Last active August 29, 2015 14:19
Decode list of base64 encoded assets into PNG images (line format: "name data")
with open('assets.txt') as f:
for line in f:
lineVals = line.split()
assetName = lineVals[0]
assetData = lineVals[1]
fh = open(assetName + '.png', "wb")
fh.write(assetData.decode('base64'))
fh.close()