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
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 / 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 / 00-vault-up.sh
Last active January 17, 2022 15:18
Vault up and Operations
cat vault.hcl
# create data container which holds the hcl file
docker create -v /config --name config busybox; docker cp vault.hcl config:/config/;
docker exec -it config cat /config/vault.hcl
docker run -d --name consul -p 8500:8500 consul:v0.6.4 agent -dev -client=0.0.0.0
docker run -d --name vault-dev --link consul:consul -p 8200:8200 --volumes-from config cgswong/vault:0.5.3 server -config=/config/vault.hcl
# docker run -d --name vault-dev --volumes-from config --cap-add=IPC_LOCK -e 'VAULT_LOCAL_CONFIG={"backend": {"file": {"path": "/config/vault.hcl"}}, "default_lease_ttl": "168h", "max_lease_ttl": "720h"}' --link consul:consul vault server
@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 \
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
#!/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}"