Skip to content

Instantly share code, notes, and snippets.

View arulrajnet's full-sized avatar

Arul arulrajnet

View GitHub Profile
@sarath-soman
sarath-soman / docker-compose.yml
Last active May 27, 2024 23:30
Keycloak docker compose with health checks
# Keycloak containers doesn't come with curl or wget in it, this forces the users to use alternative mechanisms to realise
# health check for the keycloak standard containers. This example leverages the capability of modern Java to dynamically
# compile a *.java source file and execute it on the fly using the `java` command. The HealthCheck class uses
# java.net.URL to open a connection to the `health/live` endpoint of keycloak and exits the process with a non-zero status
# if the http status is not `Ok`
version: '3'
services:
############################
# Keycloak service
############################
@dasniko
dasniko / _keycloak-cluster-config.md
Last active June 6, 2024 06:20
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 May 23, 2024 10:27
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 June 6, 2024 15:03
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)