Skip to content

Instantly share code, notes, and snippets.

View shide1989's full-sized avatar

Sebastien Hx. shide1989

View GitHub Profile
@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@cterrykenzan
cterrykenzan / ec2-startup-and-dns
Last active August 9, 2022 21:03
AWS EC2 - Start up a single instance and update its DNS record
#!/bin/bash
#In early development, sometimes you've got a hand-built instance, but you also don't want to leave it up all the time
# We've got an m4xl instance running Spinnaker (http://spinnaker.io) but we only really need it during the day
# As a cost-saving measure, we shut it down overnight. However, we want it to be consistently accessible
# So this script is in a Jenkins job that runs every morning,
# starting up the instance then updating its DNS record to the new IP.
#If you have multiple DNS records for a single instance,
# you can safely run a second copy of the script with the ZONEID and RECORDSET updated appropriately.
@chusiang
chusiang / cloudfront_create_invalidation_policy.json
Last active January 30, 2024 13:15
AWS IAM policy of CloudFront Create Invalidation
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::MyBucketName"
},
{
"Action": [
@aertmann
aertmann / mount.md
Last active August 22, 2019 09:07
Problem: NFS mount not working in Finder, but works in Terminal – OS X El Capitan (10.11)

Solution

Add vers=4 to the mount command.

sudo mount -o vers=4,resvport,rw -t nfs x.x.x.x:/home mount
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 18, 2024 16:07
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@reu
reu / pub-sub.js
Created April 9, 2013 01:51
node.js redis pub-sub example
var redis = require("redis")
, subscriber = redis.createClient()
, publisher = redis.createClient();
subscriber.on("message", function(channel, message) {
console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
});
subscriber.subscribe("test");