Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

abdennour abdennour

🌴
On vacation
View GitHub Profile
@abdennour
abdennour / README.md
Created Jul 2, 2022
Load Vault Keys / Fields into Filesystem Dynamically
View README.md

usage

load-vault-path-into-files.sh secret/keys/tls/example.com

@abdennour
abdennour / install.sh
Created Jun 26, 2022
PDF merge on WSL
View install.sh
sudo apt-get install poppler-utils -y
View tmux-cheat-sheet.md
  • Ctrl+B, then % => split window vertifcally

  • Ctrl+B, then " => split window horiztionally

  • Ctrl+B, then o => Move cursor among panes

@abdennour
abdennour / echo_cluster_cidr_range.sh
Created Feb 21, 2022
Get Cluster CIDR Range - Kubernetes
View echo_cluster_cidr_range.sh
# Credit: https://stackoverflow.com/a/61685899/747579
SVCRANGE=$(echo '{"apiVersion":"v1","kind":"Service","metadata":{"name":"tst"},"spec":{"clusterIP":"1.1.1.1","ports":[{"port":443}]}}' | kubectl apply -f - 2>&1 | sed 's/.*valid IPs is //')
echo $SVCRANGE
@abdennour
abdennour / Docerfile
Created Nov 10, 2021
Using Nginx Templates for building custom container images
View Docerfile
FROM nginx:1.19-alpine-perl
ENV NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
COPY my-nginx.conf.template /etc/nginx/templates/
@abdennour
abdennour / Dockerfile
Created Oct 11, 2021
Dockerize VSCode codr-server
View Dockerfile
FROM centos:latest
# 初始化文件夹
RUN mkdir /www /www/server /www/wwwroot /www/env /www/bak /www/server/php74 /www/server/php56 /www/wwwroot/myapp \
&& yum update -y \
&& yum install -y nodejs zip unzip wget zsh vim make cmake gcc gcc-c++ libxml2 libxml2-devel git \
nodejs zip unzip sqlite-devel m4 autoconf nginx tree \
krb5-devel openssl openssl-devel curl curl-devel libjpeg \
libjpeg-devel libpng libpng-devel freetype freetype-devel \
pcre pcre-devel libxslt libxslt-devel bzip2 bzip2-devel \
View codepipeline-cloudformation-gitops.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Pipeline env setup
Parameters:
OperatorEmail:
Description: "Email address to notify."
Type: String
Default: tsh-devops@xyz.com
ClusterSettingsArtifactFile:
Type: String
Default: cloudformation.zip
View example--parse-semver-with-bash.sh
#!/usr/bin/env bash
VERSION="$1"
VERSION="${VERSION#[vV]}"
VERSION_MAJOR="${VERSION%%\.*}"
VERSION_MINOR="${VERSION#*.}"
VERSION_MINOR="${VERSION_MINOR%.*}"
VERSION_PATCH="${VERSION##*.}"
echo "Version: ${VERSION}"
@abdennour
abdennour / README.md
Last active Jul 16, 2021
Rolling Update EKS Worker Nodes
View README.md

Pre usage

export AWS_PROFILE=xxx
export AWS_REGION=xxx
export KUBECONFIG=xxx
kubectl config use-context xxx 

Usage