Skip to content

Instantly share code, notes, and snippets.

View johnny68's full-sized avatar
🏠
Working from home

Altair johnny68

🏠
Working from home
View GitHub Profile
@onhate
onhate / pre-signup.ts
Last active May 21, 2024 13:00
Merge AWS Cognito External Provider User with Cognito User on Pre SignUp
import { PreSignUpTriggerEvent, PreSignUpTriggerHandler } from 'aws-lambda';
import { CognitoIdentityServiceProvider } from 'aws-sdk';
const cognito = new CognitoIdentityServiceProvider();
const knownProviderNames = {
google: 'Google',
facebook: 'Facebook'
};
@johnestima
johnestima / cognito-delete-all-users.sh
Created August 21, 2020 17:21
Cognito delete all users from user pool
#!/bin/bash
USER_POOL_ID=POOL_ID
RUN=1
until [ $RUN -eq 0 ] ; do
echo "Listing users"
USERS=`aws cognito-idp list-users --user-pool-id ${USER_POOL_ID} | grep Username | awk -F: '{print $2}' | sed -e 's/\"//g' | sed -e 's/,//g'`
if [ ! "x$USERS" = "x" ] ; then
for user in $USERS; do
@killa-kyle
killa-kyle / professionalCertifications.json
Created June 8, 2017 16:33
List of professional Certifications in json format
[
{
"name": "Certificate in Investment Performance Measurement",
"post_nominal": "CIPM",
"agency": "CFA Institute"
},
{
"name": "Chartered Financial Analyst",
"post_nominal": "CFA",
"agency": ""
@nrollr
nrollr / Commands.sh
Last active January 10, 2023 11:55
Install PHP and NGINX on Amazon Linux AMI
## Install NGINX
## when installing on Amazon Linux AMI, use:
$ sudo yum install nginx -y
## when installing on Amazon Linux 2 AMI, use
$ sudo amazon-linux-extras install nginx1.12 -y
## Install PHP and PHP-FPM
# for PHP version 7.1 use php71 and php71-fpm instead
$ sudo yum install php -y
$ sudo yum install php-fpm -y
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 28, 2024 08:52
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@mjdorma
mjdorma / pyvbox: How to copy a file from a VM.py
Last active September 16, 2019 11:40
pyvbox: How to copy a file from a VM
"""pyvbox: How to copy a file from a VM.
"""
import os
import virtualbox
# Assume machine is already running.
vbox = virtualbox.VirtualBox()
machine = vbox.find_machine("win7")
session = machine.create_session()