Skip to content

Instantly share code, notes, and snippets.

View jsomara's full-sized avatar

Jordan OMara jsomara

  • Redwood City, CA
View GitHub Profile
@jsomara
jsomara / app.js
Created September 30, 2013 22:06
filters demo
var myApp = angular.module('myApp', []);
function MyCtrl($scope) {
$scope.name = 'Superhero';
$scope.allGroups = [
'Group One',
'Heres a Group', ];
$scope.domainGroups = [];
$scope.addToDomain = function (group) {
@jsomara
jsomara / gist:6337717
Created August 26, 2013 02:43
paper_trail 3.0
gem 'paper_trail', '~> 3.0.0.beta', :git => 'git://github.com/airblade/paper_trail.git'
@jsomara
jsomara / ldap.rb
Created July 3, 2012 20:55
ldap_fluff in katello
require 'ldap_fluff'
class Ldap
def self.valid_ldap_authentication?(uid, password)
ldap = LdapFluff.new
ldap.authenticate? uid, password
end
def self.ldap_groups(uid)
ldap = LdapFluff.new
@jsomara
jsomara / bros.bat
Created June 21, 2012 19:47
make 1000 users in active directory
for /l %%x in (1,1,1000) do (
Dsadd user "cn=bro%%x,ou=bros,dc=jomara,dc=redhat,dc=com", -pwd br01234! -memberof "cn=bros,ou=bropeeps,dc=jomara,dc=redhat,dc=com"
)
@jsomara
jsomara / Fancy Synergy
Created May 22, 2012 16:57
Fun with git addons
https://github.com/jdob/sandbox/blob/master/synergy.conf
@jsomara
jsomara / gist:2645015
Created May 9, 2012 14:44
Registering a consumer against katello
Client Config
scp root@HOSTNAME://etc/candlepin/certs/candlepin-ca.crt /etc/rhsm/ca/headpin.pem
Edit the subscription manager conf file
hostname = HOSTNAME
prefix = /headpin/api
baseurl= https://HOSTNAME:8088
repo_ca_cert = %(ca_cert_dir)sheadpin.pem
@jsomara
jsomara / clonio.sh
Created March 19, 2012 19:41
use virt-clone & virt-edit to clone a qemu vm
#!/bin/sh
# clonio
# replace /home/jsomara/images with where you're copying your image from
# usage sudo sh clonio.sh rhel-6.2-base zoidberg
# rhel-6-2-base.img is in /home/jsomara/images/rhel-6-2-base.img
# zoidberg.img ends up in /home/jsomara/images
# thanks to jeckersb
virt-clone -o $1 -n $2 -f /home/jsomara/images/$2.img
MAC=$(cat /etc/libvirt/qemu/$2.xml | grep 'mac address' | sed -r "s/^[^']+'([^']+)'.*/\1/")