Skip to content

Instantly share code, notes, and snippets.

View metcalfc's full-sized avatar

Chad Metcalf metcalfc

View GitHub Profile
@pahud
pahud / bootstrap.sh
Last active May 25, 2023 14:04
My AWS SSO setup script for Gitpod workspaces
# watch the demo at https://youtu.be/cGUNf1FMNvI
#
# customize these variables
#
DEFAULT_PROFILE='default'
DEFAULT_REGION='us-east-1'
DEFAULT_OUTPUT='json'
SSO_START_URL='https://your-sso.awsapps.com/start'
SSO_REGION='us-east-1'
SSO_ACCOUNT_ID='123456789012'
@robvanderleek
robvanderleek / README.md
Last active March 11, 2024 19:56
AWS SSO command-line login script (that also updates .aws/credentials)

AWS SSO command-line login script (that also updates .aws/credentials)

The AWS Command Line Interface tool from Amazon (for macOS available here on Homebrew) makes it possible to login to AWS through a SSO (Single Sign-On) identity provider such as Okta. However, if you login via "aws sso login" the AWS credentials file (located at ~/.aws/credentials) is not updated, this is a problem for tools/libraries that rely on that file.

This script is a wrapper around aws sso login that also updates the .aws/credentials file. It only requires AWS CLI and Python 3 to run.

Configuration

Make sure your .aws/config file has a section (or multiple sections) that have SSO configuation options. For example:

@ynott
ynott / multipass-on-bridged-network.md
Last active May 6, 2024 23:07
Instructions for running multipass on a bridge network

1. Environmental information

  • OS: Ubuntu 20.04.2 LTS (GNU/Linux 5.8.0-59-generic x86_64)
  • Network: 192.168.xxx.0/24
  • Ubuntu multipass host machine IP: 192.168.xxx.yyy(static IP)
  • NIC: enp2s0(bridge host NIC)
  • Bridge NIC:br0

2. Prerequisites

@TimJDFletcher
TimJDFletcher / GNUPG_agent_forwarding.md
Last active April 29, 2024 12:48 — forked from surhudm/GNUPG_agent_forwarding.md
GnuPG agent forwarding

Forward GnuPG agent from macOS to Linux

On the remote machine

Run gpg once as your to create the directory structure

gpg --list-keys

For headless systemd based hosts

@dentechy
dentechy / WSL-ssh-server.md
Last active March 30, 2024 16:16
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@tkhduracell
tkhduracell / fix.sh
Last active February 19, 2023 13:09
Fix locale on raspberry pi (raspbian) "Setting locale failed."
#
# How to get rid of the locale warning on raspberry pi
#
sudo sed -i "s/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g" -i /etc/locale.gen
sudo locale-gen en_US.UTF-8
sudo update-locale en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)