Skip to content

Instantly share code, notes, and snippets.

View abdennour's full-sized avatar
🌴
On vacation

abdennour abdennour

🌴
On vacation
View GitHub Profile
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 / 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
@abdennour
abdennour / parallel_tars.sh
Created January 6, 2023 05:12
In Parallel TAR Archive Subfolders - Bash
src=$1
dest=$2
cd ${src}
for i in *
do
(
if [ -d "$i" ];then
tar czvf "${dest}/$i.tar.gz" -C "$i" .
else
echo skiping $i as it is not folder
@abdennour
abdennour / README.md
Created July 2, 2022 21:58
Load Vault Keys / Fields into Filesystem Dynamically

usage

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

@abdennour
abdennour / install.sh
Created June 26, 2022 07:00
PDF merge on WSL
sudo apt-get install poppler-utils -y
@abdennour
abdennour / README.md
Created May 27, 2022 10:46
Redirect all HTTP to HTTPS - Ingress Traefik k3s
@abdennour
abdennour / tmux-cheat-sheet.md
Created May 27, 2022 08:15
tmux cheat sheet
  • 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 February 21, 2022 15:31
Get Cluster CIDR Range - Kubernetes
# 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 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 / Dockerfile
Created October 11, 2021 10:06
Dockerize VSCode codr-server
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 \