Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View DevoKun's full-sized avatar

Devon Hubner DevoKun

View GitHub Profile
@DevoKun
DevoKun / change_github_master_branch_name.sh
Last active June 28, 2022 20:38
Change GitHub Master branch name to Main
git pull # Pull first or lose ANY commits upstream
git branch -m master main # Rename branch locally
echo
echo "Change GitHub default branch to 'main'."
echo
echo "Is GitHub Default Branch 'main'?"
echo
read -p "Press ENTER to continue"
echo
@DevoKun
DevoKun / aws_iam_secret_to_smtp_password.md
Created January 30, 2020 23:04 — forked from damusix/aws_iam_secret_to_smtp_password.md
Convert AWS IAM credentials to AWS SMTP credentials

Convert AWS IAM credentials to AWS SMTP credentials

If you do, or want to, use AWS to deploy your apps, you will end up using AWS SES via SMTP when you're launching an app that sends out emails of any kind (user registrations, email notifications, etc). For example, I have used this configuration on various Ruby on Rails apps, however, it is just basic SMTP configurations and crosses over to any framework that supports SMTP sendmail.

There are two ways to go about this:

Luckily, you found this MD file and the NOT SO EASY WAY is suddenly copy-pasta... sudo yum....

@DevoKun
DevoKun / deploy_gitlab_using_docker.md
Created July 9, 2019 21:16
Deploy GitLab using Docker

PostgreSQL and Redis

  • Gitlab CE uses Redis to store user sessions and a task queue.
  • GitLab CE uses PostgreSQL as its database back end.

Start PostgreSQL Docker Container

docker run -d --name postgresql \
@DevoKun
DevoKun / redis_notes.rb
Created July 9, 2019 19:34
Using Redis with Ruby
#!/usr/bin/env ruby
require 'redis'
# gem install redis
##
## Connect to DB
##
redis = Redis.new(host: "localhost")

Neo4j

Install Java

Neo4j requires at least OpenJDK 8.

apt update ; apt install -y default-jre default-jre-headless
@DevoKun
DevoKun / terraform_logging.md
Created May 7, 2019 11:10
Configure Terraform Logging

Terraform Logging

Terraform Logging is configured using the TF_LOG environment variable.

Valid logs levels

DEBUG, INFO, WARN, ERROR, TRACE

Enable the logs

@DevoKun
DevoKun / get_azure_region_codes.sh
Created April 24, 2019 22:53
Get list of Azure Region Codes and their Friendly Names
#!/bin/bash
# az login
az account list-locations > azure_locations.json
cat azure_locations.json | jq '.[] | "\(.name): \(.displayName)"'
@DevoKun
DevoKun / reinstall_homebrew.sh
Created April 22, 2019 15:13
Reinstall Homebrew
##
## Remove homebrew
##
cd `brew --prefix`
rm -rf Cellar
brew prune
rm -rf Library .git .gitignore bin/brew README.md share/man/man1/brew
rm -rf ~/Library/Caches/Homebrew
@DevoKun
DevoKun / gather_facts_from_azure_vm_metadata.yaml
Last active September 21, 2022 06:02
Ansible Gather Facts from Azure VM Metadata
---
- hosts: localhost
pre_tasks:
- name: "apt install curl"
apt:
name: curl
state: latest
@DevoKun
DevoKun / clock.sh
Created March 14, 2019 20:27
Display date+time that auto-increments in shell
#!/bin/bash
reset
while sleep 1; do
tput sc
echo -e " \e[36m $(hostname)\e[97m: \e[1m\e[93m`gdate +%T.%N`\e[39m"
tput rc
done