Skip to content

Instantly share code, notes, and snippets.

View ianmariano's full-sized avatar

Ian Mariano ianmariano

View GitHub Profile
@ianmariano
ianmariano / solrcloud.md
Last active August 20, 2018 08:23
Setting up SolrCloud (Solr 4.6.0)

Setup SolrCloud

These instructions are for Ubuntu 13.10 x64. Each server should have a proper resolvable hostname!

Environment Setup

Java 7

sudo aptitude install openjdk-7-jre-headless java7-runtime-headless

@ianmariano
ianmariano / aws-fingerprint
Created August 26, 2013 14:24
Get the AWS EC2 format fingerprint for an SSH private key, copy to somewhere on your path and chmod a+x it.
#!/bin/bash
usage() {
echo "$0 usage:"
echo " $0 file"
exit 1
}
if [ -z "$1" ]; then
@ianmariano
ianmariano / git-fork-sync
Last active April 21, 2020 12:03
Syncs your repo fork with the upstream master and then pushes the synced master to origin. Presumes you have an 'upstream' remote which is from whence your fork was created. Put on your path and chmod a+x it then do: git fork-sync. Use -h for usage help.
#!/usr/bin/env bash
set -Eeuo pipefail
VERSION="20200421.1"
_usage() {
cat << __EOF
$0 usage:
@ianmariano
ianmariano / git-close-branch
Last active December 18, 2015 21:59
Quick Git plugin to close a branch (return you to master and clean up your remote and local topic branches) when merged in a pull request. Place on your path and chmod a+x it. Use: git close-branch branchname
#!/bin/bash
usage() {
echo "Usage $0 branchname"
exit 1
}
if [ -z "$1" ]; then
usage
fi
@ianmariano
ianmariano / git-remote-prune-all
Last active December 18, 2015 15:49
Tired of pruning all your git remotes by hand? Put this on your path and chmod a+x it. Then, in your repo: $ git remote-prune-all
#!/bin/bash
all=`git remote`
echo "Pruning all remotes"
for r in $all; do
echo -n "$r... "
git remote prune $r && echo "done."
done
@ianmariano
ianmariano / git-svnauthors
Created June 6, 2013 14:48
Git plugin to list svn authors. Place in your path and chmod a+x it. Will output to the console.
#!/bin/bash
usage() {
echo "$0 usage:"
echo " $0 repo-url"
exit 1
}
if [ -z "$1" ]; then
@ianmariano
ianmariano / openssl-encrypt-snippets.md
Created March 29, 2013 14:47
openssl encryption snippet

Encrypt a file using AES-256-CBC

$ openssl enc -aes-256-cbc -e < *source-path* > *encrypted-file-path*

Decrypt a file using AES-256-CBC

$ openssl enc -aes-256-cbc -d &lt; *encrypted-source-path* &gt; *decrypted-file-path*
@ianmariano
ianmariano / ruby_noexec_wrapper
Created March 6, 2013 18:19
Missing ruby_noexec_wrapper? Put this script on your path and chmod a+x it.
#!/usr/bin/env ruby
original_file=ARGV[0]
ARGV.shift
$PROGRAM_NAME=original_file
require 'rubygems'
begin
require 'rubygems-bundler/noexec'
@ianmariano
ianmariano / chef-server
Last active December 14, 2015 13:29
/etc/init.d script for chef-server
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: chef-server
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Control the Chef Server
# Description: Control the Chef Server
@ianmariano
ianmariano / ec2-set-host-info
Created February 4, 2013 15:04
Autogenerate host information on ec2 on instance startup. Run from /etc/rc.local
#!/bin/bash
#
# Save somewhere and chmod o+x it and Run it from /etc/rc.local
# Modify and re-arrange as you see fit
#
# Change as appropriate
DOMAIN=local
USER_DATA=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/hostname`