Skip to content

Instantly share code, notes, and snippets.

View ictus4u's full-sized avatar
🚀

Walter Gomez ictus4u

🚀
View GitHub Profile
@ictus4u
ictus4u / README.md
Created September 20, 2022 03:48 — forked from dims/README.md
Kubernetes Resources
@ictus4u
ictus4u / Jenkinsfile
Created September 20, 2022 03:45 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
@ictus4u
ictus4u / gist:1f00eb4bb6808e6682e2bbf04f2b106c
Created September 19, 2022 17:16 — forked from rkuzsma/gist:b9a0e342c56479f5e58d654b1341f01e
Example Kubernetes yaml to pull a private DockerHub image
Step by step how to pull a private DockerHub hosted image in a Kubernetes YML.
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/
export DOCKER_USER=Type your dockerhub username, same as when you `docker login`
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login`
kubectl create secret docker-registry myregistrykey \
--docker-server=$DOCKER_REGISTRY_SERVER \
--docker-username=$DOCKER_USER \
pipeline {
agent any
parameters {
string(defaultValue: '', description: 'The name of the organization working on this repository.', name: 'orgName')
}
stages{
stage("Create Repo Piplines") {
steps {
@ictus4u
ictus4u / 01nginx-tls-sni.md
Created September 12, 2022 04:56 — forked from kekru/01nginx-tls-sni.md
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@ictus4u
ictus4u / devops_best_practices.md
Created September 11, 2022 19:21 — forked from jpswade/devops_best_practices.md
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". In that same year, Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing issues around involving more of the comp

@ictus4u
ictus4u / web-servers.md
Created September 2, 2022 15:34 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ictus4u
ictus4u / upgrade-ubuntu
Created August 22, 2022 14:28
Upgrade ubuntu distro taking temporally out PPA for avoiding conflicts
#!/usr/bin/env bash
set -euo pipefail
readonly SELF="$(readlink -f "$0")"
## Run as root
[ $UID == 0 ] || exec sudo -E "$SELF" "$@"
die() { echo "[ERROR] $*" >&2 ; exit 1 ; }
cmd() { echo "[#] $*" >&2; "$@" ; }
@ictus4u
ictus4u / gist:83431f1a0861d758fb43bcf5b0cb4673
Created August 18, 2022 04:21 — forked from ekoontz/gist:5130762
working with ldap admin tools
[root@centos1 ~]# ldapsearch -h localhost -D "cn=Manager,dc=openiam,dc=org" -w foobar -s sub "(&(objectClass=posixGroup)(cn=hdfs))"
# extended LDIF
#
# LDAPv3
# base <dc=openiam,dc=org> (default) with scope subtree
# filter: (&(objectClass=posixGroup)(cn=hdfs))
# requesting: ALL
#
# hdfs, Group, openiam.org
#!/bin/sh
## Fonction pour générer un password.
## "randpw" pour générer un mot de passe aléatoire de 32 caractères
## "randpw <n>" pour générer un mot de passe aléatoire de <n> caractères
randpw(){ < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;}
## Définir les mots de passe et les exporter pour qu'ils soient visibles des scripts.
cat > passwords << EOF
DATA_CONFIG_PASSWORD=`randpw`
DATA_ADMIN_PASSWORD=`randpw`
DATA_SERVICE_PASSWORD=`randpw`