Skip to content

Instantly share code, notes, and snippets.

View arulrajnet's full-sized avatar

Arul arulrajnet

View GitHub Profile
@dasniko
dasniko / _keycloak-cluster-config.md
Last active April 16, 2024 17:29
How to configure a keycloak cluster properly (legacy Wildfly edition)

Keycloak Cluster Configuration (How to) - Legacy Wildfly Distribution!!!

This is a short and simple example on how to build a proper Keycloak cluster, using JDBC_PING as discovery protocol and an NGINX server as reverse proxy.

As this is for legacy Keycloak version (Wildfly based, up until version 17), you can find an example for more current and uptodate versions at this gist here: https://gist.github.com/dasniko/3a57913047af3ca1b6b0a83b294dc1a1


Please see also my video about Keycloak Clustering: http://www.youtube.com/watch?v=P96VQkBBNxU

@mkfares
mkfares / docker-swarm-configs.md
Created August 16, 2020 12:37
Docker Swarm - Managing Configurations

Docker Swarm - Managing Configurations

Docker allows storing configurations outside docker images and running containers. This feature, named configs, eliminates the need to use volumes, bind-mount, or environment variables to pass configurations to containers.

The configs have the following characteristics:

  • Configs are not encrypted (secrets are encrypted)
  • Config values can be strings or binary data
  • Config values have maximum size of 500 kB
  • Configs are mounted as a file in the container filesystem. The default location is /<config-name> in the container
  • Configs can be added or removed from a service at any time
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Thomas Davis",
"label": "Web Developer",
"image": "https://avatars0.githubusercontent.com/u/416209?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4",
"summary": "I'm a full stack web developer who can build apps from the ground up. I've worked mostly at startups so I am used to wearing many hats. I am a very product focused developer who prioritizes user feedback first and foremost. I'm generally very flexible when investigating new roles. ",
"website": "https://lordajax.com",
@bmaupin
bmaupin / install-adobe-reader-9-ubuntu.sh
Last active December 23, 2023 09:47
Install Adobe Reader 9 on Ubuntu
# Cache sudo password
sudo -v
# Enable installation of 32-bit packages
sudo dpkg --add-architecture i386
# Enable the Ubuntu partner repository (this doesn't seem to be necessary for 20.04)
if [ $(lsb_release -r | awk '{print $2}') == '18.04' ]; then
sudo sed -i 's/^# deb http:\/\/archive.canonical.com\/ubuntu/deb http:\/\/archive.canonical.com\/ubuntu/' /etc/apt/sources.list
sudo apt update
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 19, 2024 06:11
set -e, -u, -o, -x pipefail explanation
@FelikZ
FelikZ / accept_known_hosts.sh
Created August 16, 2018 13:39
Fix known_hosts file "Jenkins Host key verification failed"
#!/bin/bash
for domain in "github.com" "bitbucket.org"; do
echo $domain
sed -i "/$domain/d" ~/.ssh/known_hosts
line=$(ssh-keyscan $domain,`nslookup $domain | awk '/^Address: / { print $2 ; exit }'`)
echo $line >> ~/.ssh/known_hosts
done
// ==UserScript==
// @name Google Bookmarks fix
// @match https://www.google.com/bookmarks/*
// @grant none
// @require https://code.jquery.com/jquery-1.12.4.min.js
// @require https://code.jquery.com/ui/1.12.1/jquery-ui.js
// ==/UserScript==
$(function() {
try {
@cweinberger
cweinberger / mysql-drop-all-tables.sh
Created June 6, 2018 12:44
drops all tables of a specific db
#!/bin/bash
#usage: mysql-drop-all-tables -d database -u dbuser -p dbpass
TEMP_FILE_PATH='./drop_all_tables.sql'
while getopts d:u:p: option
do
case "${option}"
in
@nguyenkims
nguyenkims / log.py
Last active February 13, 2024 07:59
Basic example on how setup a Python logger
import logging
import sys
from logging.handlers import TimedRotatingFileHandler
FORMATTER = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
LOG_FILE = "my_app.log"
def get_console_handler():
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setFormatter(FORMATTER)
@mrw34
mrw34 / postgres.sh
Last active March 26, 2024 00:24
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
test $(uname -s) = Linux && chown 70 server.key
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key