Skip to content

Instantly share code, notes, and snippets.

View matthewcosgrove's full-sized avatar

Matthew Cosgrove matthewcosgrove

View GitHub Profile
@matthewcosgrove
matthewcosgrove / gist:3ce949f0f95c7da47b718ca4ae416ada
Created December 29, 2018 12:41 — forked from gin1314/gist:3697341
bash: redirection cheat sheet
.---------------------------------------------------------------------------.
| |
| Bash Redirections Cheat Sheet |
| |
+---------------------------------------------------------------------------+
| |
| Created by Peteris Krumins ([email protected]) |
| www.catonmat.net -- good coders code, great coders reuse |
| |
+-----------------------------.---------------------------------------------+
@matthewcosgrove
matthewcosgrove / cloudflare-update-record.sh
Created December 26, 2018 20:40 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="[email protected]"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
#!/usr/bin/env bash
: "${DROPBOX_FOLDER_TO_KEEP:? DROPBOX_FOLDER_TO_KEEP must be set e.g. DROPBOX_FOLDER_TO_KEEP=CapoeiraSubsonicLibrary ./dropbox_cli_selective_sync.sh }"
# TODO: avoid ls ---> http://mywiki.wooledge.org/ParsingLs
dropbox(){
/usr/local/bin/dropbox.py "$@"
}
pushd ~/Dropbox > /dev/null
while [ "$(ls -1 | grep -v $DROPBOX_FOLDER_TO_KEEP | wc -l)" -ne "0" ]
#!/usr/bin/env bash
df -hT
sudo debugfs -R features /dev/xvda1
cat /etc/fstab
echo "Checking pre-requisites..."
sudo apt-get -qq update
sudo apt -yqq install python
@matthewcosgrove
matthewcosgrove / aws_ubuntu_dropbox_up.sh
Last active December 18, 2018 09:10
Dropbox wrapper bootstrapping for ext4 issues
#!/usr/bin/env bash
sudo apt-get update
sudo apt install git build-essential python
pushd ~ > /dev/null
git clone https://github.com/dark/dropbox-filesystem-fix.git
pushd ~/dropbox-filesystem-fix > /dev/null
make
popd > /dev/null
wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
@matthewcosgrove
matthewcosgrove / install_virtualbox5_centos7.sh
Created November 13, 2018 19:56
Install VirtualBox 5.0.x in CentOS 7
#!/bin/sh
echo ">>>> System update and get minimal required modules to use vboxdrv kernel <<<<"
yum update -y
yum install -y binutils qt gcc make patch libgomp glibc-headers glibc-devel
echo ">>>> Getting kernel headers and DKMS to favour future VirtualBox kernel Updates <<<<"
yum install -y kernel-headers kernel-devel dkms
repoFile="/etc/yum.repos.d/virtualbox.repo"
---
resource_types:
- name: pivnet
type: docker-image
source:
repository: pivotalcf/pivnet-resource
tag: latest-final
resources:
platform: linux
image_resource:
type: docker-image
source: {repository: mattcosgrove/wake-me-up-b4u-go-govc, tag: "latest"}
inputs:
- name: pcf-vsphere
- name: pivnet-pcf-opsman
- name: govcwrap
#!/bin/bash
set -eux
export GOPATH=$PWD/../gopath
export PATH=$PWD/../gopath/bin:$PATH
export OPSMAN_OVA=$GOPATH/$OPSMAN_OVA
go version
@matthewcosgrove
matthewcosgrove / osx-for-hackers.sh
Created November 30, 2016 12:55 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx