Skip to content

Instantly share code, notes, and snippets.

View scottjbarr's full-sized avatar

Scott Barr scottjbarr

View GitHub Profile
#!/bin/bash
#
# Install common Go tools.
#
# Author : Scott Barr
# Date. : 12 Dec 2023
#
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/gopls@latest
@scottjbarr
scottjbarr / Makefile
Created March 19, 2023 13:02 — forked from ryu1kn/Makefile
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
KEY_ID=alias/my-key
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
encrypt-text:
@scottjbarr
scottjbarr / journalctl.md
Created January 9, 2021 23:32 — forked from tyagiakhilesh/journalctl.md
Using JournalCtl to view system logs
// To display utc timestamp in logs
journalctl --utc

// Displaying Logs from the Current Boot
journalctl -b

// Listing boots
journalctl --list-boots
@scottjbarr
scottjbarr / gnome-customization.sh
Last active May 23, 2023 00:11
Shell script to set up Gnome config.
#!/bin/bash
#
# Collection of custom Gnome settings.
#
# Author : Scott Barr
# Date : 9 Jul 2018
#
# alt-tab only cycles current workspace
gsettings set org.gnome.shell.app-switcher current-workspace-only true
@scottjbarr
scottjbarr / gnome-customization.sh
Created February 11, 2019 06:16
Shell script to set up Gnome config.
#!/bin/bash
#
# Collection of custom Gnome settings.
#
# Author : Scott Barr
# Date : 9 Jul 2018
#
# alt-tab only cycles current workspace
gsettings set org.gnome.shell.app-switcher current-workspace-only true
@scottjbarr
scottjbarr / compiler-music.sh
Created December 7, 2018 06:29
Generate music from code, and gcc
#!/bin/bash
#
# Generate music from code and gcc.
#
# This actually sounds pretty good!
#
# I am not the original author of this code, it was tweeted by
# @kr094_ . See https://twitter.com/kr094_/status/928038531125207040
#
# Author : Scott Barr
@scottjbarr
scottjbarr / sv_nodes_2.js
Created November 17, 2018 05:28
List of Bitcoin SV node addresses out blockchain API data
// Return a list of Bitcoin SV nodes.
//
// Usage:
//
// node ./nodes.js nodes.json
//
// where "nodes.js" is the name of this file, and "nodes.json" was
// created from the following command.
//
// curl https://api.blockchair.com/bitcoin-cash/nodes > nodes.json
@scottjbarr
scottjbarr / output.txt
Last active November 21, 2018 03:35
Show the Bitcoin SV nodes from JSON returned from getpeerinfo
/Bitcoin SV:0.1.0(EB128.0; bitcoin-abc)/ 3.120.248.245:8333
/Bitcoin SV:0.1.0(EB128.0)/ 47.92.157.192:8333
/Bitcoin SV:0.1.0(EB128.0)/ 77.72.125.206:8333
/Bitcoin SV:0.1.0(EB128.0)/ 138.201.221.79:8333
@scottjbarr
scottjbarr / rds-tunnel.md
Last active September 20, 2017 23:09
Setup a tunnel to an RDS instance and install PostgreSQL tools from source

SSH Tunnel To RDS

Setup a tunnel

This sets up a tunnel from localhost:6432, to rds-instance:5432, via the host at ec2-instance

ssh -N -L 6432:rds-instance:5432 ec2-instance
@scottjbarr
scottjbarr / emacs-editor.desktop
Created August 22, 2017 02:11
Emacs terminal/editor launcher for Gnome 3
# put this file at ~/.local/share/applications/emacs-editor.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Emacs Terminal
Icon=/usr/share/icons/gnome/256x256/apps/terminal.png
Type=Application
Categories=Development;
Exec=gnome-terminal --geometry=165x40 --window-with-profile="Solorized Dark"
Terminal=true