Skip to content

Instantly share code, notes, and snippets.

View tuxerrante's full-sized avatar
💭
Have you tried turning it off and on again?

Affinito Alessandro tuxerrante

💭
Have you tried turning it off and on again?
View GitHub Profile
@tuxerrante
tuxerrante / findRepeatingWords.java
Last active June 19, 2018 17:03
java exercise to use regex in order to delete repeated words, case insensitive, in a sentence
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static java.util.regex.Pattern.CASE_INSENSITIVE;
import java.util.ArrayList;
public class DuplicateWords {
public static void main(String[] args) {
/*
#!/bin/bash
function kubectl_version {
kubectl version
kubectl version --output=yaml
}
OS=$(uname -o)
#################
# Only if Linux #
@tuxerrante
tuxerrante / nginx.conf
Created February 8, 2021 15:39
nginx configuration for proxing from a docker image a jenkins server
daemon off;
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
@tuxerrante
tuxerrante / env-var-on-react-deployment-using-cm.sh
Created February 12, 2021 14:43
How to expose an environment variable on a react app running in minikube, using configmaps
Dockerfile
==================
FROM bayesimpact/react-base
ENV REACT_APP_API_ENDPOINT=${REACT_APP_API_ENDPOINT:-"127.0.0.1:8081/atena/"}
==================
# I created a local private registry to sync my host with minikube
# You probably don't need to to this -> docker.local:5000/my-react:0.0.1
docker build -t docker.local:5000/my-react:0.0.1 .
#!/bin/bash
echo "HELLOOOOOOOOO WORLD"
echo
FROM ubuntu
COPY my_app/ /app
RUN set -x &&\
addgroup alex &&\
adduser --home /app --disabled-password --ingroup alex alex
USER alex
WORKDIR /app
apiVersion: v1
kind: Pod
metadata:
labels:
name: staging-webapp
name: staging-webapp
namespace: staging
spec:
containers:
- env:
apiVersion: v1
kind: Pod
metadata:
labels:
name: staging-webapp
name: staging-webapp
namespace: staging
spec:
containers:
- env:
# kubectl create secret -n prod generic prod-db --from-literal=db-user=root --from-literal=db-psw=paswrd --from-literal=db-host=prod-db --from-literal=app-color=red
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "2"
labels:
name: prod-web
name: prod-web
@tuxerrante
tuxerrante / kind-metrics-server.yaml
Last active June 13, 2022 17:52 — forked from hjacobs/kind-metrics-server.yaml
Metrics Server API deployment manifests for Kubernetes kind
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:aggregated-metrics-reader
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["metrics.k8s.io"]