Skip to content

Instantly share code, notes, and snippets.

View trepidity's full-sized avatar

Jared Jennings trepidity

View GitHub Profile
$dig
$i=1
while $i < 100000 do
if $dig == 1
print "\\"
else
print "/"
end
$i+=1
require_relative "simple_number"
require "test/unit"
class TestSimpleNumber < Test::Unit::TestCase
def test_simple
assert_equal(4, SimpleNumber.new(2).add(2) )
assert_equal(6, SimpleNumber.new(2).multiply(3) )
assert_equal(3, SimpleNumber.new(6).devide(2) )
end
@trepidity
trepidity / ldap-helloWorld.rb
Created November 18, 2013 18:28
Example of connecting to eDirectory with a Ruby LDAP script
require 'rubygems'
require 'net/ldap' #gem install --no-rdoc --no-ri net-ldap
ldap = Net::LDAP.new :host => "172.16.138.142",
:port => 389,
:auth => {
:method => :simple,
:username => "cn=admin,o=novell",
:password => "n0v3ll"
}
#sample_query.rb
require 'autotask_api'
client = AutotaskAPI::Client.new do |c|
c.basic_auth = ['user@example.com','mypassword']
c.wsdl = 'https://webservices.autotask.net/atservices/1.5/atws.wsdl'
end
query = AutotaskAPI::QueryXML.new do |query|
query.entity = 'contact'
@trepidity
trepidity / idp_redirect.sh
Last active July 13, 2017 23:01
NetIQ NAM iptables redirect to redirect 80 and 443 to 8080 and 8443 for NetIQ Access Manager
#!/bin/sh
# Copyright (c) 2010 Novell, Inc.
# All rights reserved.
#
#! /bin/sh
#! /etc/init.d/idp_8443_redirect
# ### BEGIN INIT INFO
# Provides: idp_8443_redirect
# Required-Start: $network $syslog $novell-jcc
# Required-Stop: $network $syslog $novell-jcc
@trepidity
trepidity / htcacheclean.init
Created May 8, 2014 17:05
This init script runs htcacheclean on NetIQ Access Manager servers. Original file located at https://github.com/fastly/httpd-2.4/blob/master/build/rpm/htcacheclean.init
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Testing Frameworks
#group :test do
gem 'rspec-rails', '>= 3.0'
gem 'factory_girl_rails'
gem 'capybara'
gem 'capybara-webkit'
gem 'capybara-screenshot'
gem 'cucumber-rails', :require => false
gem 'database_cleaner'
gem 'selenium-webdriver'
@trepidity
trepidity / gist:4ed9c149af8354d28073
Created September 2, 2014 04:54
jbuilder for projects
json.timeline do
json.headline "SoldierUP Projects"
json.type "default"
json.text "Stuff People Say"
json.startDate "2012,1,26"
json.date @projects do |project|
json.headline project.title
json.text project.description
json.startDate project.created_at
json.endDate project.due_date
#!/bin/bash
# bash generate random alphanumeric string
#
if [[ "$OSTYPE" == "linux-gnu" ]]; then
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@trepidity
trepidity / reCaptchaCustomAuthentication
Created February 12, 2015 21:23
NetIQ Access Manager Authentication Class using reCaptcha
package com.novell.nam.authentication;
/*
* Copyright (c) 2015 Jared Jennings <jared@jaredjennings.org>. All Rights Reserved.
* don't forget to set the class property recaptcha_private_key
*/
import java.util.*;
import javax.servlet.http.*;