Skip to content

Instantly share code, notes, and snippets.

View abdennour's full-sized avatar
🌴
On vacation

abdennour abdennour

🌴
On vacation
View GitHub Profile
@abdennour
abdennour / ubuntu-vnc-desktop.sh
Created April 8, 2020 18:33
Install Ubuntu Desktop with VNC
#!/bin/bash
sudo apt-get update -y
sudo apt-get install ubuntu-desktop -y
sudo apt-get install tightvncserver -y
sudo apt-get install gnome-panel gnome-settings-daemon -y
sudo apt-get install metacity nautilus gnome-terminal gnome-shell -y
# sudo apt-get install ubuntu-gnome-desktop -y
cat > ~/.vnc/xstartup <<EOF
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
@abdennour
abdennour / README.md
Last active April 1, 2026 08:22
Nginx Reverse Proxy for Nexus Docker Registries

Overview

This is a solution of a common problem with Nexus Docker repositories. The administrator has to expose port for "pull", another port for "push", other ports for each hosted repository. This solution is about leveraging Nginx reverse proxy to avoid using these ports.

How it works ?

Given :

  • Nexus hostname is "nexus.example.com"
  • Nexus web port is 8081
@abdennour
abdennour / ingress-kube-apiserver.yaml
Created April 18, 2021 00:50
expose kube-apiserver thru ingress
kind: Ingress
metadata:
name: kubeapi
namespace: default
annotations:
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
rules:
- host: "api.devops.example.com"
@abdennour
abdennour / Docerfile
Created November 10, 2021 17:36
Using Nginx Templates for building custom container images
FROM nginx:1.19-alpine-perl
ENV NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
COPY my-nginx.conf.template /etc/nginx/templates/
@abdennour
abdennour / 00-infra.yaml
Last active May 9, 2025 13:47
Jenkins declarative Pipeline in Kubernetes with Parallel and Sequential steps
apiVersion: v1
kind: Pod
spec:
# dnsConfig:
# options:
# - name: ndots
# value: "1"
containers:
- name: dind
image: abdennour/docker:19-dind-bash
@abdennour
abdennour / vault-auth-k8s-method.sh
Last active April 7, 2025 17:29
Vault - Enable Kubernetes Auth Method
# $1: vault namespace
# $2: Vault Token Reviewer Service Account
vault_namespace=${1:-"vault"}
token_reviewer_sa=${2:-"vault"}
if [ -z "${VAULT_TOKEN}" ] || [ -z "${VAULT_ADDR}" ]; then
echo "ERROR: VAULT_TOKEN and VAULT_ADDR env vars are required"
exit 404
fi
cat <<EOF | kubectl apply -f -
version: "3.7"
services:
db:
image: mcr.microsoft.com/mssql/server:2017-latest
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
env_file:
@abdennour
abdennour / bitbucket_backup.sh
Created September 17, 2019 03:48
Backup All Git Repos with All branches
#!/bin/bash
team=${1};
repos_list_file=${2};
while read repo; do
if [[ ! -d "$repo" ]]; then
echo $repo clone...
git clone git@bitbucket.org:${team}/${repo}.git;
TIMEOUT=$((5 + RANDOM % 10));
@abdennour
abdennour / README.md
Created May 27, 2022 10:46
Redirect all HTTP to HTTPS - Ingress Traefik k3s
@abdennour
abdennour / acs-clean.sh
Last active January 9, 2024 08:00
Clean ACS Operator from SecuredCluster in Openshift
oc -n stackrox delete securedcluster --all
oc -n stackrox delete pvc --all
oc delete ns stackrox
oc get clusterrole,clusterrolebinding,role,rolebinding -o name | grep stackrox | xargs oc delete --wait
oc delete ValidatingWebhookConfiguration stackrox
oc delete scc -l "app.kubernetes.io/name=stackrox"
oc project rhacs-operator
oc delete sub rhacs-operator