Skip to content

Instantly share code, notes, and snippets.

View jonDowdle's full-sized avatar

Jon Dowdle jonDowdle

View GitHub Profile
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@benkehoe
benkehoe / aws-profile-for-bashrc.sh
Last active April 2, 2024 10:41
AWS_PROFILE env var management
# MIT No Attribution
#
# Copyright 2022 Ben Kehoe
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
@Hakky54
Hakky54 / openssl_commands.md
Last active May 3, 2024 03:14 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@lukeplausin
lukeplausin / bash_aws_jq_cheatsheet.sh
Last active January 29, 2024 10:00
AWS, JQ and bash command cheat sheet. How to query, cut and munge things in JSON generally.
# Count total EBS based storage in AWS
aws ec2 describe-volumes | jq "[.Volumes[].Size] | add"
# Count total EBS storage with a tag filter
aws ec2 describe-volumes --filters "Name=tag:Name,Values=CloudEndure Volume qjenc" | jq "[.Volumes[].Size] | add"
# Describe instances concisely
aws ec2 describe-instances | jq '[.Reservations | .[] | .Instances | .[] | {InstanceId: .InstanceId, State: .State, SubnetId: .SubnetId, VpcId: .VpcId, Name: (.Tags[]|select(.Key=="Name")|.Value)}]'
# Wait until $instance_id is running and then immediately stop it again
aws ec2 wait instance-running --instance-id $instance_id && aws ec2 stop-instances --instance-id $instance_id
# Get 10th instance in the account
@taylorludwig
taylorludwig / taylorludwig.pub
Last active November 29, 2021 18:55
Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDFoKe9Fm8nD+K+VcrvEp+Zpkqaz+KacGgXuUO5delooqq/ynaZt3uzD6FgPGJhAAPn2ZjSRQIGlaqeapux6xRp9BRkWFdFQJKrztv4sLMenU5vo/KQzNnCxsIrfqNDHbsLphwB26tarRWKpf9MnscQduhHCVQz6J4uxCdirty5XTV1UXKWWgn1/8jcQaJbcK8NEHvNkBFgA1V35SpGErU5YOQZ4GXQZagqyls7nM003nbRVu7EyDvE9gE54Hlnnd23k28a547WqF23pjI9zl6Jl3SzsZ6gE5NSNzeA6qfqV0yHqgq7kIZ+OiAOwCM5xjdhYzPZ9EpgFx3Sw0/RDIb+M4jE/57OGIqaJnyW6tt+EU3u9RySo67dZn1Xavs+ri+FyM5WiZjblH7IM77eKO1e1x76WbZB7prvWP+0UE9AiS9xP29VC58OQKKBdgNDCzAM8m2WPnyQrisQ1JzbIjrsbx45NN0QL1raeVBwzXg1g8DK0w9hoc3e3QluTyyVTIEEo9w38G/sfxFexlooO/NxsfncjsT+Q5Q5JGuqg6cpMmFXVmMn4uAJmbRCveEvfUOxRnJiXrwLd036ygZmSQ+u2MIKI18fjknEIJt/fz37WrEo1HDcg9qdAezLcJrCXYyXF3Fg+a6qTcA9Umai99On0nevU59ibfYDjcxMnnlCpw== Taylor Ludwig
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@abramadams
abramadams / jvm.config
Created July 11, 2014 19:40
Generic JVM config for CF9 on Linux
#
# VM configuration
#
# Where to find JVM, if {java.home}/jre exists then that JVM is used
# if not then it must be the path to the JRE itself
java.home=/opt/coldfusion9/runtime/jre/
#
# If no java.home is specified a VM is located by looking in these places in this
# order:
#
@dixson3
dixson3 / workspace.sh
Created January 10, 2014 19:11
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
@ThomasBurleson
ThomasBurleson / DownloadRatioRule.js
Last active October 31, 2018 19:54
Demonstration of refactor of DownloadRatioRules.js > transform deep nesting of promise chains to an easily-maintained, flattened, sequential chain.
if (downloadRatio < 1.0) {
self.debug.log("Download ratio is poor.");
if (current > 0) {
self.debug.log("We are not at the lowest bitrate, so switch down.");
self.manifestExt.getRepresentationFor(current - 1, data).then(
function (representation1) {
self.manifestExt.getBandwidth(representation1).then(
function (oneDownBandwidth) {
self.manifestExt.getRepresentationFor(current, data).then(
function (representation2) {
@jasoncodes
jasoncodes / vim_tips.markdown
Last active December 21, 2015 00:08
Vim Tips

Vim Tips

fresh

Build your dotfiles (shell, Vim config) from multiple sources with fresh.

Both of our dotfiles are built using fresh. We source Vim and other config from each other: