Skip to content

Instantly share code, notes, and snippets.

Ian Mariano ianmariano

Block or report user

Report or block ianmariano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ianmariano
ianmariano / git-change-committer
Created Jun 19, 2014
Rewrite an author/committer in your git history. Place on your path and do: git change-committer name new_name new_email
View git-change-committer
#!/bin/bash
usage() {
echo "$0 usage:"
echo " $0 name new_name new_email"
exit 1
}
if [ "$#" -ne 3 ]; then
usage
@ianmariano
ianmariano / install-oracle-java-8-ubuntu
Created Oct 26, 2014
Install Oracle Java 8 Ubuntu
View install-oracle-java-8-ubuntu
sudo add-apt-repository ppa:webupd8team/java
sudo aptitude update
sudo aptitude install oracle-java8-installer oracle-java8-set-default
@ianmariano
ianmariano / cassandra-service
Last active Aug 29, 2015
Firing up Cassandra, OpsCenter and a DataAgent locally on OS X for development. This has some presumptions like the install locations (change to suit your purposes). This also presumes these services have already been configured and run properly without resorting to this script. Add to your path and chmod a+x it.
View cassandra-service
#!/bin/bash
CASSANDRA_HOME=/opt/apache/cassandra
OPSCENTER_HOME=/opt/apache/opscenter
CASS_LOG_DIR=$CASSANDRA_HOME/logs
CASS_LOGFILE=$CASS_LOG_DIR/system.log
CASS_PIDFILE=$CASSANDRA_HOME/cassandra.pid
OPSCENTER_LOGFILE=$CASS_LOG_DIR/opscenter.log
@ianmariano
ianmariano / ec2-set-host-info
Created Feb 4, 2013
Autogenerate host information on ec2 on instance startup. Run from /etc/rc.local
View ec2-set-host-info
#!/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`
@ianmariano
ianmariano / chef-server
Last active Dec 14, 2015
/etc/init.d script for chef-server
View 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 / ruby_noexec_wrapper
Created Mar 6, 2013
Missing ruby_noexec_wrapper? Put this script on your path and chmod a+x it.
View ruby_noexec_wrapper
#!/usr/bin/env ruby
original_file=ARGV[0]
ARGV.shift
$PROGRAM_NAME=original_file
require 'rubygems'
begin
require 'rubygems-bundler/noexec'
View openssl-encrypt-snippets.md

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 < *encrypted-source-path* > *decrypted-file-path*
@ianmariano
ianmariano / git-svnauthors
Created Jun 6, 2013
Git plugin to list svn authors. Place in your path and chmod a+x it. Will output to the console.
View git-svnauthors
#!/bin/bash
usage() {
echo "$0 usage:"
echo " $0 repo-url"
exit 1
}
if [ -z "$1" ]; then
@ianmariano
ianmariano / git-remote-prune-all
Last active Dec 18, 2015
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
View 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-close-branch
Last active Dec 18, 2015
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
View git-close-branch
#!/bin/bash
usage() {
echo "Usage $0 branchname"
exit 1
}
if [ -z "$1" ]; then
usage
fi
You can’t perform that action at this time.