Skip to content

Instantly share code, notes, and snippets.

View sh4t's full-sized avatar

Justin Shattuck sh4t

View GitHub Profile
@JamesOBenson
JamesOBenson / Generating a secure SSH Key and commands
Last active January 20, 2026 19:42
SSH Generation and commands.
To find your public SSH key(s) on github, navigate to:
https://github.com/<username>.keys
ssh-keygen
-t ed25519 - for greatest security (bits are a fixed size and -b flag will be ignored)
-t rsa - for greatest portability (key needs to be greater than 4096 bits)
-t ecdsa - faster than RSA or DSA (bits can only be 256, 284, or 521)
-t dsa - DEEMED INSECURE - DSA limted to 1024 bit key as specified by FIPS 186-2, No longer allowed by default in OpenSSH 7.0+
-t rsa1 - DEEMED INSECURE - has weaknesses and shouldn't be used (used in protocol 1)
@sh4t
sh4t / send_emails.sh
Last active May 12, 2017 18:53
Have a file of your users' name and email address laying around that you need to shoot an email to? I did and didn't want to leverage my server's SENDMAIL, etc so I just use mailgun..
#!/bin/bash
#
# Changed a few things up from my original version I am using
# but thought others might want to have an easy way to send
# emails to users using mailgun via bash..
#
# be sure to replace the FROM field, subject, content, etc
# just read the script and follow-along and modify accordingly.
#
# the contents of the file I am reading are email username:
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active July 6, 2026 11:48
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@tranzium
tranzium / autoview-syntax.txt
Last active June 9, 2025 16:42
TradingView can now become automated trading.
---------- Usage
The syntax created by these parameters is placed in an alert's description on TradingView
to be utilized by Autoview, a Chrome Extension.
Autoview: https://chrome.google.com/webstore/detail/autoview/okdhadoplaoehmeldlpakhpekjcpljmb
> Website: https://autoview.with.pink
> Help: https://use.autoview.with.pink
> Discord: https://discordapp.com/invite/BFz8VPn
TradingView: https://tradingview.go2cloud.org/aff_c?offer_id=2&aff_id=1187
@andrewsomething
andrewsomething / cloud_init_runcmd.py
Last active February 10, 2026 08:20
This script takes a cloud-config file as input and returns the 'shellified' script that would be produced by cloudinit from the runcmd stanza.
#!/usr/bin/python
"""
This script take a cloud-config file as input and returns the 'shellified'
script that would be produced by cloudinit from the runcmd stanza.
https://github.com/number5/cloud-init/blob/74e61ab27addbfcceac4eba254f739ef9964b0ed/cloudinit/config/cc_runcmd.py
https://github.com/number5/cloud-init/blob/74e61ab27addbfcceac4eba254f739ef9964b0ed/cloudinit/util.py#L1708
"""
@benkulbertis
benkulbertis / cloudflare-update-record.sh
Last active June 5, 2026 13:42
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@tobert
tobert / diskstats_linux.go
Last active April 15, 2021 15:04
Read /proc/diskstats on Linux with Go with minimum overhead
package main
// Usage: go run diskstats_linux.go
// public domain
import (
"bytes"
"io/ioutil"
"log"
"strconv"
)
@zarmstrong
zarmstrong / ec2tags.rb
Last active July 4, 2016 19:03 — forked from drohr/ec2tags.rb
replaces spaces with pipes to take into account non-word (\w) characters in key or value.
require 'facter'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
tags = Facter::Util::Resolution.exec("ec2dtag --filter \"resource-id=#{instance_id}\" --region #{region} | cut -f 4-|awk 'BEGIN{FS=\" \";OFS=\"|\"} {$1=$1; print $0}'")
tags.scan(/(.*)\|+(.*)/) do |key, value|
fact = "ec2_tag_#{key}"
Facter.add(fact) { setcode { value } }
end
@pdeschen
pdeschen / initd
Created May 12, 2013 18:10
CentOS service initd erb template. Ready to use in Opscode Chef or replace template variables with your own hard-coded value. Takes into account priority/nice, sudo user, and /etc/sysconfig/ Support start, stop, restart, console.
#!/bin/sh
#
# <%=@service%> This shell script takes care of starting and stopping
# the <%=@service%> service.
#
# chkconfig: 2345 65 35
# description: <%=@description%>
#
SERVICE=<%=@service%>
#!/bin/sh
#get GitHub user name if it is not provided
if [ $# -lt 1 ]; then
echo -n "Enter GitHub user name: "
read _githubUsername
else
_githubUsername=$1
fi