Skip to content

Instantly share code, notes, and snippets.

@drmalex07
drmalex07 / README-apache-balancer-with-stickysession.md
Last active April 19, 2023 11:08
Setup apache as a load balancer with sticky sessions. #apache #balancer #stickysession

Readme

We need to enable at least the following modules: headers, env, proxy, proxy_http, proxy_balancer. If we are proxying over AJP of course we should also enable proxy_ajp.

The following is a sample configuration for a site acting as a balancer to 2 instances of a backend application:

<IfModule mod_ssl.c>
    <VirtualHost 192.168.1.6:443>
version: "3.5"
services:
postgres:
image: library/postgres:10.7
container_name: db
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active April 28, 2024 04:37
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@egetun
egetun / maya2019install.sh
Last active May 5, 2022 14:36 — forked from nrtkbb/maya2018install.sh
Autodesk Maya 2019 Installation Bash Script v1.0 for Ubuntu 18.04 / Tested on KDE Neon 5.14
#!/bin/bash
#Deniz Ege Tunçay, 2019
#nrtkbb, 2018
#Neal Burger, 2017
#Autodesk Maya Installation Bash Script v1.0 for Ubuntu 18.04 based Linux Distributions
#if you have any issues, feel free tweet me // @egetun
#Make sure we’re running with root permissions.
@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@ScriptingSquirrel
ScriptingSquirrel / install-kubernetes-dashboard-ingress-enabled.md
Last active March 4, 2022 08:48
Install Ingress-enabled kubernetes-dashboard using Helm

Problem

$ helm install kubernetes-dashboard stable/kubernetes-dashboard --namespace MY_NAMESPACE --set ingress.enabled=true --set ingress.hosts={MYDASHBOARD.EXAMPLE.COM} --set-string ingress.annotations."nginx\.ingress\.kubernetes\.io/secure-backends"="true"
Error: UPGRADE FAILED: failed to create patch: failed to get versionedObject: unable to convert unstructured object to extensions/v1beta1, Kind=Ingress: unrecognized type: string

NB: A fix for the --set-string flag is on the way: helm/helm#4142

Workaround

@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active May 4, 2023 06:40
Gradient shadow in pure CSS

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
@9bitbear
9bitbear / AMD-Radeon-GPU-Linux-setup.md
Last active March 20, 2021 21:54
AMD RX Series GPU setup for Mining

Running AMD Radeon GPUS on Ubuntu 16.04

Cards tested (so far):

Model Released
Radeon RX 550 April 2017
Radeon RX 560 April 2017
Radeon HD 7800 Series March 2012
@soulmachine
soulmachine / jwt-expiration.md
Last active April 9, 2024 04:12
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC: