Skip to content

Instantly share code, notes, and snippets.

View dasgoll's full-sized avatar

dasgoll

  • Amman, Jordan
View GitHub Profile
@dasgoll
dasgoll / gist:3c66cebc76d9d6af539c0db9c9ea7d50
Created March 8, 2023 09:22
Install sshpass.exe on Windows
You can install QtdSync for Windows [http://qtdtools.doering-thomas.de/page.php?tool=QtdSync&page=QtdSync&lang=en]
This will contain the sshpass.exe
@dasgoll
dasgoll / gist:5782985251db6e406febc56433c203f8
Created March 6, 2023 11:10
aws ses commandline verify mail send email identity
aws ses send-email --from omar@foo.com --to jayz@foo.com --text "This is for those who cannot read HTML." --html "<h1>Hello World</h1><p>This is a pretty mail with HTML formatting</p>" --subject "Hello Kaman marrah"
aws ses verify-email-identity --email-address ahmed@dasarabbank.com --profile digi
FROM adoptopenjdk/openjdk11:jdk-11.0.11_9-debian AS build-env
ENV KEYCLOAK_VERSION 17.0.1
ARG KEYCLOAK_DIST=https://github.com/keycloak/keycloak/releases/download/$KEYCLOAK_VERSION/keycloak-$KEYCLOAK_VERSION.tar.gz
RUN apt-get install -y tar gzip
ADD $KEYCLOAK_DIST /tmp/keycloak/
RUN (cd /tmp/keycloak && \
@dasgoll
dasgoll / docker-compose-keycloak.yaml
Created February 9, 2023 13:51
docker-compose keycloak yaml file
version: '3'
services:
keycloak:
image: quay.io/keycloak/keycloak:20.0.3
ports:
- 8080:8080
command:
- start-dev
environment:
KEYCLOAK_ADMIN: admin
@dasgoll
dasgoll / gist:2fc0122f122bd4e64660c3ef490c2f75
Created February 7, 2023 12:13
Run redis-commander using Docker
docker run --rm --name redis-commander -d -p 8081:8081 --env REDIS_HOSTS=172.17.0.1 ghcr.io/joeferner/redis-commander:latest
@dasgoll
dasgoll / fetch.js
Created November 9, 2022 13:32
Javascript fetch send header authorization token access
fetch('https://reddit.com/v3.1/consents', {
method: 'GET',
headers: {
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJQUzFzWmYyM3BHaVlaZ2dQSnZFQjlhRjJTS3NOWmdXNFNmSVRkVDRyRXg4In0.eyJleHAiOjE2NjcxMzIwMTQsImlhdCI6MTY2NzEzMTk1NCwianRpIjoiODgxOTZlMTQtMGJkZS00ZjJiLTlhOTEtYWFkOTJlNmU5NzE0IiwiaXNzIjoiaHR0cHM6Ly9rYy5kaWdpdGluYXJ5LmNvbS9hdXRoL3JlYWxtcy9tYXN0ZXIiLCJhdWQiOlsib2ItY2xpZW50MSIsImFjY291bnQiXSwic3ViIjoiZjNhMGJmOTQtMmY4MS00NTVlLThhY2UtN2M5NmU2OTJmYjZlIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoib2ItY2xpZW50MSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiIiwiaHR0cDovL2VicC1zcGEtd2ViLWRldi5zMy13ZWJzaXRlLmV1LWNlbnRyYWwtMS5hbWF6b25hd3MuY29tIiwiaHR0cHM6Ly90ZXN0LXBsYXRmb3JtLmNsaWNrIl0sInJlYWxtX2FjY2VzcyIasdasdayI6WyJkZWZhdWx0LXJvbGVzLW1hc3RlciIsIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJvYi1jbGllbnQxIjp7InJvbGVzIjpbInVtYV9wcm90ZWN0aW9uIl19LCJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6ImVtYW
@dasgoll
dasgoll / gist:306c6b9a617a5a142874b7023e46cc82
Created November 9, 2022 12:04
egrep ip address from log using regex
egrep 'from ([0-9]{,3}.[0-9]{,3}.[0-9]{,3}.[0-9]{,3})' /var/log/secure -o |sed 's/from //g' | sort | uniq
@dasgoll
dasgoll / gist:ec6de3d26355809837076017311e42ea
Created October 27, 2022 08:21
kubectl patch change service type from nodeport to clusterip
kubectl patch svc dbp-transaction-microservice --type='json' -p '[{"op":"replace","path":"/spec/type","value":"ClusterIP"}]'
kubectl patch svc dbp-transaction-microservice -p '{"spec": {"type": "ClusterIP"}}'
@dasgoll
dasgoll / gist:dca01da5f17f452200e883eca3097cfd
Last active October 28, 2022 01:55
Ingress resources are not getting deleted even though the alb ingress controller deployment is deleted
Reference: [https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/1629#issuecomment-726872539]
I deleted the AWS Load Balancer Controller (alb) before deleting the ingress, and I couldn't delete the ingress.
Solution:
-> % k get ingress echoserver -o yaml | grep -A 5 finalizers
finalizers:
- group.ingress.k8s.aws/mygroup
generation: 19
name: echoserver
@dasgoll
dasgoll / gist:81048813f0348d318f926c9092173cc3
Created October 21, 2022 09:57
Concatenate fields in json using jq
docker image ls --format '{{json .}}' | jq '.Repository + ":" + .Tag'