Skip to content

Instantly share code, notes, and snippets.

View trepidity's full-sized avatar

Jared Jennings trepidity

View GitHub Profile
@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.*;
@trepidity
trepidity / appointment_spec.rb
Last active August 29, 2015 14:15
Example AutoTask Appointment
require 'spec_helper'
describe AutotaskAPI::Appointment do
xml = '
<id>76</id>
<UserDefinedFields/>
<ResourceID xsi:type="xsd:int">29684244</ResourceID>
<Title xsi:type="xsd:string">Example Appointment</Title>
<StartDateTime xsi:type="xsd:dateTime">2015-02-07T05:21:00</StartDateTime>
<EndDateTime xsi:type="xsd:dateTime">2015-02-07T05:22:00</EndDateTime>
@trepidity
trepidity / entity.rb
Last active August 29, 2015 14:16
has_one example
require 'byebug'
module AutotaskAPI
class Entity
class_attribute :fields, :client, :find_cache
attr_accessor :attributes, :raw_xml
def initialize(xml)
self.raw_xml = xml
self.attributes = {}
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@trepidity
trepidity / viewInfo.jsp
Created October 26, 2015 17:03
Access Manager Troubleshooting Tool This sample web page is for troubleshooting purposes only
<%@ page
import="java.io.*"
import="java.util.*"
%>
<%
//Do not allow page to be cached
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
@trepidity
trepidity / actions.rb
Created December 1, 2015 02:57
Love Actions
Action.create([{ id: 1, name: 'gift', language: 'gift'},
{ id: 2, name: 'note', language: 'affirmation'},
{ id: 3, name: 'text', language: 'affirmation'},
{ id: 4, name: 'i love you', language: 'affirmation'},
{ id: 5, name: 'picture', language: 'affirmation'},
{ id: 6, name: 'expressed concern for me', language: 'affirmation'},
{ id: 7, name: 'expressed understanding for me', language: 'affirmation'},
{ id: 8, name: 'kindness'},
{ id: 9, name: 'counseling'},
{ id: 10, name: 'period'},