Skip to content

Instantly share code, notes, and snippets.

View arulrajnet's full-sized avatar

Arul arulrajnet

View GitHub Profile
@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
@n0ts
n0ts / get_oracle_jdk_x64.sh
Last active September 16, 2023 12:07
Get latest Oracle JDK package bash shell script for linux/osx/windows
#!/bin/bash
# You must accept the Oracle JDK License Update
# https://www.oracle.com/java/technologies/javase-downloads.html
# usage: get_oracle_jdk_x64.sh <jdk_version> <platform> <ext>
# jdk_version: 14
# platform: linux or osx or windows
# ext: rpm or dmg or tar.gz or exec
jdk_version=${1:-14}
@bl4ck5un
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017 03:20
Responsive helpers (mobile-only etc.) for semantic-ui
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
@calo81
calo81 / LoggerFilter
Created March 18, 2012 12:48
Filter for reading and logging HttpServletRequest body, and resetting the input stream
package com.paddypower.financials.market.management.rest.logging;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@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
@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)
@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
@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
@kizbitz
kizbitz / dockerhub-v2-api-organization.sh
Last active April 3, 2024 08:47
Get the list of images and tags for a Docker Hub organization account
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""
ORG=""
@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