Skip to content

Instantly share code, notes, and snippets.

View mcg's full-sized avatar

Matthew Gregg mcg

  • Modern Message
  • Summerville SC
View GitHub Profile
@bmpandrade
bmpandrade / update-linode-lb-ssl-cert.sh
Last active October 4, 2018 20:18
update linode ssl certs on nodebalancer with letsencrypt certs
#! /bin/bash
### ATTENTION : NOT READY FOR PRODUTION YET ###
### LINODE ACCEPTS BUT THEN BROWSERS SHOW ###
### SSL_ERROR_RX_RECORD_TOO_LONG ###
DOMAIN="example.com"
CERT_DIR="/opt/acme/certs/$DOMAIN"
TOKEN="XXXXXXXXXX"
NB_ID=XXXXX
@mcg
mcg / tmux-cheatsheet.markdown
Created October 24, 2017 18:47 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@gilbertw1
gilbertw1 / evil.el
Created October 6, 2017 19:45
disable region limiting in evil-ex
(evil-define-command evil-ex (&optional initial-input)
:keep-visual t
:repeat abort
(interactive
(list
(let ((s (concat
(cond
(current-prefix-arg
(let ((arg (prefix-numeric-value current-prefix-arg)))
(cond ((< arg 0) (setq arg (1+ arg)))
aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | select(.State.Name |contains("running")) | select(.Tags != null) | (.Tags | from_entries) as $tags | [.PrivateIpAddress,$tags.Name,.KeyName] | @tsv'
@JoshTGreenwood
JoshTGreenwood / gist:443253f42fb80455792f
Created December 1, 2015 22:20
Automatically add magit cloned repos to the projectile project list
(defun add-project-to-projectile-known-projects (_ directory)
(projectile-add-known-project directory))
(advice-add 'magit-clone :after 'add-project-to-projectile-known-projects)
#!/bin/bash
# Author: CzBiX
# URL: https://gist.github.com/CzBiX/e64256b23687bb13da02
# Support only Ubuntu 16.04
DEST_PACKAGE="libglib2.0-0"
DEST_VERSION="2.48.1-1~ubuntu16.04.1"
DEST_FILE="/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.1"
PATCH_DATA="f626c: eb"
SUCCESS_MSG="Please quit nautilus with 'nautilus -q' to make sure patch worked."
@gvaughn
gvaughn / copr.md
Last active January 30, 2024 16:11
git copr alias

I'd like to share some git aliases that you might find useful if you handle pull requests from others.

Add these to your ~/.gitconfig in the [alias] section:

copr = "!f() { git fetch -fu origin refs/pull/$1/head:pr-$1; git checkout pr-$1; } ; f"
prunepr = "!git for-each-ref refs/heads/pr-* --format='%(refname:short)' | while read ref ; do git branch -D $ref ; done"

Now you can "git copr #{pr_number}" (check out pull request is the mnemonic) and it will pull down the PR in a local branch of pr-#{pr_number} and check it out for you. To do it right, you must pronounce it "Copper" with a James Cagney gangster accent.

@arpcefxl
arpcefxl / secgroupdelete_ec2classic.py
Created April 14, 2015 04:30
AWS ec2 security group delete scripts. One script is for ec2-classic, the other is for VPC
#!/usr/bin/env python
# Authored by Chad Smith on 3/10/2015
# please feel free to contact me at arpcefxl@gmail.com with comments or questions
# assumes you have already run aws configure or are running in an ec2 role
import boto.ec2, sys
region = sys.argv[1]
secgroup = sys.argv[2]
conn = boto.ec2.connect_to_region(region)
allgroups = conn.get_all_security_groups()