Skip to content

Instantly share code, notes, and snippets.

@anumber8
anumber8 / keycloak.ts
Created Oct 10, 2021 — forked from alvistar/keycloak.ts
Nuxtjs Logout Fix for Keycloak
View keycloak.ts
import Oauth2Scheme from '@nuxtjs/auth-next/dist/schemes/oauth2'
import { encodeQuery } from '@nuxtjs/auth-next/dist/utils'
export default class KeycloakScheme extends Oauth2Scheme {
logout () {
if (this.options.endpoints.logout) {
const opts = {
client_id: this.options.clientId,
post_logout_redirect_uri: this._logoutRedirectURI
}
@anumber8
anumber8 / nginxproxy.md
Created Sep 30, 2020 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@anumber8
anumber8 / mdb2postgres.sh
Created Sep 24, 2020 — forked from mutolisp/mdb2postgres.sh
Convert Microsoft Access *.mdb file into PostgreSQL database
View mdb2postgres.sh
#!/usr/bin/env bash
# install mdbtools first!
# mdbtools: https://github.com/brianb/mdbtools
# ref: https://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL
DBMS=postgres
for MDB in `ls | grep .mdb$`
@anumber8
anumber8 / wildfly-9.0.2.Final-standalone-full-ha.cli
Created Aug 19, 2020 — forked from cheinema/wildfly-9.0.2.Final-standalone-full-ha.cli
WildFly CLI scripts to build the default configurations
View wildfly-9.0.2.Final-standalone-full-ha.cli
embed-server --server-config=custom-full-ha.xml --empty-config --remove-existing
# Extensions first
batch
/extension=org.jboss.as.clustering.infinispan:add
/extension=org.jboss.as.clustering.jgroups:add
/extension=org.jboss.as.connector:add
/extension=org.jboss.as.deployment-scanner:add
/extension=org.jboss.as.ee:add
/extension=org.jboss.as.ejb3:add
/extension=org.jboss.as.jaxrs:add
@anumber8
anumber8 / script.sh
Created May 19, 2020 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
View script.sh
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@anumber8
anumber8 / localhost-ssl.sh
Created Feb 8, 2020 — forked from jonsamp/localhost-ssl.sh
Create https key and cert on localhost
View localhost-ssl.sh
cd ~/
mkdir .localhost-ssl
sudo openssl genrsa -out ~/.localhost-ssl/localhost.key 2048
sudo openssl req -new -x509 -key ~/.localhost-ssl/localhost.key -out ~/.localhost-ssl/localhost.crt -days 3650 -subj /CN=localhost
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.localhost-ssl/localhost.crt
npm install -g http-server
echo "
function https-server() {
@anumber8
anumber8 / .babelrc
Created Nov 10, 2019 — forked from federicofazzeri/.babelrc
Node Express-based REST API (CRUD) using Firebase cloud Functions and FireStore cloud database + Babel config (The current Node version running in Cloud Functions is 6.10)
View .babelrc
{
"presets": [
["env", {
"targets": {
"node": "6.10"
}
}]
]
}
@anumber8
anumber8 / .babelrc
Created Nov 10, 2019 — forked from federicofazzeri/.babelrc
Node Express-based REST API (CRUD) using Firebase cloud Functions and FireStore cloud database + Babel config (The current Node version running in Cloud Functions is 6.10)
View .babelrc
{
"presets": [
["env", {
"targets": {
"node": "6.10"
}
}]
]
}
@anumber8
anumber8 / gen_cert.sh
Created Aug 29, 2019 — forked from adamrunner/gen_cert.sh
bash script to generate a self signed certificate for development use
View gen_cert.sh
#!/bin/bash
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
@anumber8
anumber8 / keycloak-defaults
Created Aug 16, 2019 — forked from markusleh/keycloak-defaults
Keycloak service script and default file for init.d
View keycloak-defaults
# General configuration for the init.d scripts,
# not necessarily for JBoss AS itself.
# default location: /etc/default/keycloak
## Location of JDK
# JAVA_HOME="/usr/lib/jvm/default-java"
## Location of WildFly
# JBOSS_HOME="/opt/keycloak"