Skip to content

Instantly share code, notes, and snippets.

View eiximenis's full-sized avatar

Eduard Tomàs eiximenis

View GitHub Profile
@eiximenis
eiximenis / 01_1Scope.js
Created November 27, 2014 10:04
Ejemplos de la charla Una tapa de EcmaScript. PPT http://www.slideshare.net/eduardtomas/una-tapa-de-ecmascript-6
(function() {
const a=10;
a=20;
let b=10;
b=20;
console.log("a-->" + a);
console.log("b-->" + b);
var s = true;
while (s) {
const ic = 10;
@eiximenis
eiximenis / Dockerfile
Created November 2, 2017 00:42
Create image with netcore2.0 + Nodejs (multi-stage build)
FROM microsoft/aspnetcore:2.0 AS base
WORKDIR /app
EXPOSE 80
FROM base as withnode
RUN apt-get update && apt-get install -my wget gnupg
RUN apt-get -qq update && apt-get -qqy --no-install-recommends install \
git \
unzip
@eiximenis
eiximenis / token-replace.ps1
Last active July 16, 2018 12:59
Powershell: Replace tokens in content (or file) allowing pipe for input and/or output
Param(
[parameter(Mandatory=$false,ValueFromPipeline=$true)][string]$content="",
[parameter(Mandatory=$false)][string]$inputFile="",
[parameter(Mandatory=$false)][string]$outputFile="",
[parameter(Mandatory=$true)][hashtable]$tokens
)
if ([string]::IsNullOrEmpty($content)) {
if ([string]::IsNullOrEmpty($inputFile)) {
@eiximenis
eiximenis / keybase.md
Created July 18, 2019 16:06
My keybase verification (eiximenis)

Keybase proof

I hereby claim:

  • I am eiximenis on github.
  • I am eiximenis (https://keybase.io/eiximenis) on keybase.
  • I have a public key ASAXTBjrbVTaTv0pMbY3PbykDT4n_MlNN4WM2bbv9gaWOgo

To claim this, I am signing this object:

@eiximenis
eiximenis / Dockerfile
Created March 13, 2020 11:46
Dockerfile & Compose file to run operator-sdk on Windows environments (where is not supported) using a container
ARG RELEASE_VERSION=v0.15.2
FROM golang:1.14.0-buster
ARG RELEASE_VERSION
ENV GOROOT=/usr/local/go
# Download and install operator sdk
WORKDIR /usr/local/bin
RUN curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && \
chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && \
ln -s operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu operator-sdk
# Download and install Docker CLI (no daemon)
@eiximenis
eiximenis / Perform-Pvc-Backup.ps1
Created January 29, 2021 17:58
Powershell script to create snapshots of the PVCs used by an AKS
#Parameter section
Param
(
[Parameter(Mandatory = $false, HelpMessage = 'Subscription id to use')][String] $subscriptionId = "",
[Parameter(Mandatory = $true, HelpMessage = 'AKS Resource group')][String] $rg,
[Parameter(Mandatory = $false, HelpMessage = 'Resource group to store the snapshots (default: AKS nodes RG)')][String] $destinationRg="",
[Parameter(Mandatory = $false, HelpMessage = 'AKS name (in the RG)')][String] $aksName,
[Parameter(Mandatory = $false, HelpMessage = 'PVCs to backup')][String[]] $pvcsToBackup= [string []]"",
[Parameter(Mandatory = $false, HelpMessage = 'Tag used to identify if disk is AKS managed')][String] $tagCreatedBy="created-by",
[Parameter(Mandatory = $false, HelpMessage = 'Tag used to identify if disk is AKS managed')][String] $tagCreatedByValue="kubernetes-azure-dd",