Skip to content

Instantly share code, notes, and snippets.

View if6was9's full-sized avatar

Rob Schoening if6was9

  • Lacework
  • Bay Area, CA
View GitHub Profile
@if6was9
if6was9 / test.java
Created February 25, 2011 21:59
just a test
for (int i=0; i<10; i++) {
System.out.println(i);
}
@if6was9
if6was9 / rabbitmq-server-start
Created March 5, 2011 09:29
Starting rabbitmq broker
[rob@macbook ~]$ rabbitmq-server -detach
Activating RabbitMQ plugins ...
0 plugins activated:
+---+ +---+
| | | |
| | | |
| | | |
| +---+ +-------+
[rob@macbook ~]$ hostname
rsmbp.local
[rob@macbook ~]$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
[rob@macbook ~]$ rabbitmq-server -detach
Activating RabbitMQ plugins ...
0 plugins activated:
ERROR: unexpected epmd error: address
@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">
@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 / 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: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 / 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 / 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