Skip to content

Instantly share code, notes, and snippets.

View if6was9's full-sized avatar

Rob Schoening if6was9

View GitHub Profile
@if6was9
if6was9 / gist:4489143
Created January 8, 2013 23:42
Git pull equivalent of "git push -f"
$ git fetch <remoteref> <branchname>
$ git reset --hard FETCH_HEAD
$ git clean -df
@if6was9
if6was9 / gist:4150314
Created November 26, 2012 20:09
turn on networking for CentOS 6.x minimal Install
dhclient eth0
yum -y install system-config-network-tui
# Run system-config-network-tui
# Make sure that /etc/sysconfig/network/scripts/ifcfg-eth0 has ONBOOT=yes
@if6was9
if6was9 / gist:3453173
Created August 24, 2012 17:27
To create key/cert for use in AWS IAM
To create key/cert for use in AWS IAM
$ openssl genrsa -out iam.key 1024
$ openssl req -new -key iam.key -out iam.csr
$ openssl x509 -req -in iam.csr -signkey iam.key -out iam.pem
@if6was9
if6was9 / FindUserDN.vbs
Created August 2, 2012 21:22
Looks up a user in AD and returns the distinuighed name
set adsi= CREATEOBJECT("ADSystemInfo")
set nt= CREATEOBJECT("NameTranslate")
' Get the domain short name
adDomain= adsi.DomainShortName
' Prompt user for uid
user = INPUTBOX("Please enter username: ")
' Find the user's DN
@if6was9
if6was9 / dotswitch
Last active October 7, 2015 22:59
switch between multiple versions of dotfiles/rcfiles
#!/bin/bash
# This script facilitates switching multiple dotfiles with symbolic links
DOTFILE_NAME=$1
PROFILE_NAME=$2
DOTFILE=~/.${DOTFILE_NAME}
PROFILE=~/.${DOTFILE_NAME}-${PROFILE_NAME}
@if6was9
if6was9 / gist:3219392
Created July 31, 2012 18:42
some simple ruby date epoch math for reference
#!/usr/bin/env ruby
time_now = Time.now.utc
d1 = Time.utc(time_now.year, time_now.month, time_now.day)
d0 = Time.at(d1.to_i - (24 *60 * 60)).utc
puts d1.to_i
puts d0.to_i
@if6was9
if6was9 / gist:1642264
Created January 19, 2012 20:07
Print JavaScript Collection Info In CSV
print ("collection_name,item_count,storage_size")
c = db.getCollectionNames();
for (var i=0; i<c.length; i++) {
stats = db[c[i]].stats();
print(c[i]+","+stats.count+","+stats.storageSize);
}
@if6was9
if6was9 / gist:903177
Created April 5, 2011 07:36
test.properties
encryptedDataSource.password={AES}MPE7vxSgzGsdItYUhk1k7QFJC6s383E+56HGemk0QyY=
encryptedDataSource.username={AES}izkVVx5JGjAduyIT2+/nQol+GjvePbJi1Zx9lYMbkLQ=
unencryptedDataSource.password=mysecret
unencryptedDataSource.username=myuser
@if6was9
if6was9 / applicationContext.xml
Created April 5, 2011 07:24
spring xml config that shows usage of EcryptedPropertyOverrideConfigurer
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
[rob@macbook ~]$ rabbitmq-server -detach
Activating RabbitMQ plugins ...
0 plugins activated:
ERROR: unexpected epmd error: address