This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client"; | |
import { useEffect } from 'react'; | |
// Note: Logout works with a direct link to NextAuth's unbranded /api/auth/signout | |
// however signOut does not appear to work consistently (e.g. doesn't clear session) and may cause redirect loops | |
async function fetchCsrfToken() { | |
const response = await fetch('/api/auth/csrf'); | |
const data = await response.json(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is used to set environment variables for a Heroku application. | |
# It reads variables from a provided .env file and sets them for the specified Heroku application. | |
# The script ignores HOST and PORT variables. | |
# Usage: ./set_heroku_env.sh path_to_env_file heroku_app_name | |
# Check if the .env file and app name are provided as arguments | |
if [ -z "$1" ] || [ -z "$2" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Module::ExtractUse; | |
use Data::Dump; | |
use Pod::Usage; | |
my $p = Module::ExtractUse->new; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Generates configurations for Apache and Nginx in use with CloudFlare for capturing end-user's real IP address using the CF-Connecting-IP header | |
LATEST_CLOUDFLARE_IPV4_IPS='https://www.cloudflare.com/ips-v4'; | |
LATEST_CLOUDFLARE_IPV6_IPS='https://www.cloudflare.com/ips-v6'; | |
function usage() { | |
echo "Usage: $0 <apache|nginx>"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Loads environments variables from files contained in .env located in the CWD' | |
// See: https://stackoverflow.com/questions/36322536/how-to-set-an-environment-variable-from-a-gradle-build | |
run.doFirst { | |
if (project.file('.env').exists()) { | |
file('.env').readLines().each() { | |
if (!it.isEmpty() && !it.startsWith("#")) { | |
def (key, value) = it.tokenize('=') | |
if (System.getenv(key) == null) { | |
println "Setting environment variable for ${key}" | |
environment key, value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Supports using environment variables from direnv in both CLI and IntelliJ | |
# CLI uses direnv .envrc (https://direnv.net/) | |
# IntelliJ uses .env files using the following plugin https://plugins.jetbrains.com/plugin/7861-envfile | |
# | |
# The master env config file is the .env file. Any edits using this script will export to an updated .envrc file | |
# Edit source .env file | |
pico .env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate a new Key | |
openssl genrsa -out cert-domain.key 2048 | |
# Generate a new Certificate Request | |
openssl req -new -sha256 -key cert-domain.key -out cert-domain.csr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# launch_screens.sh - https://gist.github.com/ericblue/5bad210e113c56ade8766506fc99e611 | |
# Launch script using screens to automatically create named sessions and launch executed commands while detaching immediately | |
# Useful as a startup helper script to create multiple screen sessions you can later reattach to (e.g. screen -r screen1) | |
# Key name = the screen session name | |
# Key value = command to execute | |
declare -A screens=( | |
["screen1"]="/usr/bin/top" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Deploys new authorized key from id_rsa.pub via SSH so new SSH connections will not require password authentication | |
# Example: cd ~/user; ./deploy_ssh_key.sh [email protected] | |
if [ $# -lt 1 ] | |
then | |
echo "Usage: $0 <user@hostname>"; | |
exit 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +ericblue is my blockchain ID. https://onename.com/ericblue |
NewerOlder