Skip to content

Instantly share code, notes, and snippets.

View jsamuel1's full-sized avatar

Josh Samuel jsamuel1

  • Melbourne, Australia
View GitHub Profile
@cam8001
cam8001 / service-regions.sh
Last active December 20, 2023 19:41
One liner to get list of services keyed to AWS region
#!/bin/bash
curl -s 'https://api.regional-table.region-services.aws.a2z.com/index.json' \
| jq '.prices[] | .attributes | .["aws:region"], .["aws:serviceName"]' \
| sed '$!N;s/\n/,/'
@benkehoe
benkehoe / aws-profile-for-bashrc.sh
Last active September 20, 2024 17:38
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.
#
@jsamuel1
jsamuel1 / clean_code.md
Created July 29, 2019 22:39 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

git checkout -b upstream
git remote add upstream [email protected]/upstream1/blah.git
git fetch upstream # or use -f in git remote add
git merge -s subtree upstream/master --allow-unrelated-histories -X theirs
@0xdabbad00
0xdabbad00 / gist:5d1d5fd619a20ba2ee899c56f8d6787f
Created March 26, 2019 22:02
WARNING: Only tested in a test account, beware, this could break things.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"apigateway:*",
"autoscaling:*",
"cloudtrail:*",
"cloudwatch:*",
"cloudformation:*",
@0xdabbad00
0xdabbad00 / CloudFormation_resources.txt
Last active May 28, 2019 15:46
CloudFormation resources. Found via: git clone --depth=1 https://github.com/awsdocs/aws-cloudformation-user-guide.git; cd aws-cloudformation-user-guide; grep -h "# AWS::" doc_source/aws-* | sed 's/# //' | sed 's/<.*//' | sort | uniq
AWS::AmazonMQ::Broker
AWS::AmazonMQ::Configuration
AWS::ApiGateway::Account
AWS::ApiGateway::ApiKey
AWS::ApiGateway::Authorizer
AWS::ApiGateway::BasePathMapping
AWS::ApiGateway::ClientCertificate
AWS::ApiGateway::Deployment
AWS::ApiGateway::DocumentationPart
AWS::ApiGateway::DocumentationVersion
@ECHO off
:top
CLS
ECHO Choose a shell:
ECHO [1] cmd
ECHO [2] bash
ECHO [3] PowerShell
ECHO [4] PowerShell Core
ECHO [5] Python
ECHO.
@mcxiaoke
mcxiaoke / git-show-big-files.sh
Created January 5, 2018 07:22 — forked from debreczeni/git-show-big-files.sh
Find large files in git repository
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
@johnpapa
johnpapa / DockerCleanupScripts.md
Created August 3, 2017 01:37 — forked from spboyer/DockerCleanupScripts.md
Docker Cleanup Scripts

Docker - How to cleanup (unused) resources

Cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@0xjac
0xjac / private_fork.md
Last active November 16, 2024 18:10
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git