Skip to content

Instantly share code, notes, and snippets.

View rafaelmagu's full-sized avatar

Rafael Fonseca rafaelmagu

  • @bitsignalnz
  • New Zealand
View GitHub Profile
@rjamestaylor
rjamestaylor / docker-run-away.txt
Last active September 2, 2021 22:37
Replacing Docker Desktop on my MacBook in under an hour
When Darth Docker sent me the email changing the terms of use retroactively (!) I decided to start looking for alternatives.
About 30 minutes later I found Lima (and nerdctl).
Less than an hour later, I no longer use Docker Desktop.
Not even for retrieving container images in corportate repos that require credentials.
I just replaced Docker on my MacBook with Lima.
$ brew install lima
Then set up a default execution environment for nerdctl:
@kellyrmilligan
kellyrmilligan / s3Sync.sh
Created June 8, 2017 13:38
Sync files to s3 and set cache control headers
#!/bin/bash
if [[ "$1" != "" ]]; then
S3BUCKETNAME="$1"
else
echo ERROR: Failed to supply S3 bucket name
exit 1
fi
aws s3 sync build s3://$S3BUCKETNAME --delete --cache-control max-age=31536000,public
@hisnameisjimmy
hisnameisjimmy / le-install.sh
Last active March 14, 2022 22:14
Unifi Controller one-shot install script for Ubuntu 16.04 with Lets Encrypt
#!/bin/sh
#
# This script stands on the shoulders of giants.
#
# You can always find the most recent version here: https://gist.github.com/hisnameisjimmy/56f9414076ca39a79bfa07eefa89759e
#
# It is written and tested for Ubuntu 16.04 on Digital Ocean using a 1GB droplet.
# Anything less than 1GB of memory may cause issues with anything memory intensive
# like imports/exports.
#
@denji
denji / README.md
Last active April 5, 2024 10:03 — forked from Cubixmeister/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@teeli
teeli / codedeploy-to-slack.js
Last active October 13, 2022 13:18
CodeDeploy notifications to Slack (AWS Lambda via SNS)
var https = require('https');
var util = require('util');
exports.handler = function (event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var severity = "good";
var message = event.Records[0].Sns.Message;
var messageJSON = JSON.parse(message);
@vancluever
vancluever / amifind.sh
Created January 26, 2016 08:05
Find the most recent Ubuntu AMI using aws-cli (or any other AMI for that matter)
#!/bin/sh
# Use AWS CLI to get the most recent version of an AMI that
# matches certain criteria. Has obvious uses. Made possible via
# --query, --output text, and the fact that RFC3339 datetime
# fields are easily sortable.
export AWS_DEFAULT_REGION=us-east-1
aws ec2 describe-images \
@grahamc
grahamc / Makefile
Last active September 30, 2015 23:19
AWS Instance Age Report (run `make`)
fresh: clean chart
chart: instance_ages
@echo "AWS EC2 Instance Age Report"
@echo "---------------------------"
@echo "Days\\tCount"
@cat instance_ages | ./chart.py -n
clean:
rm -f instance*
@nzakas
nzakas / alias.md
Created September 11, 2015 17:59
Some simple scripts I use to manage open source branches

Usage:

To create a new branch that is up-to-date with the remote master:

$ ws 123

Creates the branch issue123

@jaredmichaelwilliams
jaredmichaelwilliams / 0.Setup
Last active August 28, 2018 01:28
Setting up a Yubikey for use with SSH
Preparation
Purchase YubiKey NEO
Install X Code and Command Line Tools, if installing anything from source.
X Code can be installed from the App Store.
Command Line Tools are installed from X Code: X Code -> Preferences -> Downloads -> Components -> Command Line Tools.
Install YubiKey reader library libyubikey (aka yubico-c)
Using homebrew:
brew install libyubikey
brew install ykpers