Skip to content

Instantly share code, notes, and snippets.

View trepidity's full-sized avatar

Jared Jennings trepidity

View GitHub Profile
@trepidity
trepidity / gist:5821244c6a8a2c4d97a6a0d94b5269dd
Last active December 26, 2022 05:15
Create User in LDAP
using System;
using System.DirectoryServices;
using System.DirectoryServices.Protocols;
using System.Security.Cryptography.X509Certificates;
using System.Net;
using System.Collections;
namespace BulkCreate
{
public class CreateUsers
@trepidity
trepidity / HullMovingAvg
Created February 7, 2021 00:08
Thinkorswim HullMovingAvg
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#TD Ameritrade IP Company, Inc. (c) 2008-2019
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#Input desired parameters using the input statements below
input price = close;
input length = 20;
input WithinBars = 1;
def hma = HullMovingAvg(price,length);
@trepidity
trepidity / .zshrc
Last active November 9, 2020 12:44
my zsh RC file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/jjennings/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#ZSH_THEME="robbyrussell"
<?php
$delimiter=",";
$src_file = $argv[1];
$tmpl_file = $argv[2];
if (file_exists($src_file)) {
if (file_exists($tmpl_file)) {
$src_handle = fopen($src_file,"r");
$tmpl_handle = fopen($tmpl_file,"r");
@trepidity
trepidity / positions.py
Created July 19, 2020 02:21
Pull the current TD Positions for all accounts
# Import the client
from td.client import TDClient
import pprint
from datetime import datetime
from datetime import timedelta
pp = pprint.PrettyPrinter(indent=4)
# Create a new session, credentials path is optional.
TDSession = TDClient(
@trepidity
trepidity / setHostname.sh
Created May 27, 2020 21:52
set machine hostname (FOR NAM)
echo "Creating host entry..." | tee -a $LOG_OUTPUT
HOST_NAME=`hostname`
IP_ADDR=`ip addr | grep -Po '(?!(inet 127.\d.\d.1))(inet \K(\d{1,3}\.){3}\d{1,3})' | head -n 1`
HOST_PRESENT=`grep $HOST_NAME /etc/hosts`
if [ -z "$HOST_PRESENT" ]
then
echo -e "$IP_ADDR\t$HOST_NAME\t$HOST_NAME" >> /etc/hosts
fi
@trepidity
trepidity / JSONAuthentication.java
Created April 6, 2020 18:43
JSONAuthentication
package com.novacoast.nam.authentication;
import com.novell.nidp.NIDPConstants;
import com.novell.nidp.NIDPContext;
import com.novell.nidp.authentication.AuthnConstants;
import com.novell.nidp.authentication.local.LocalAuthenticationClass;
import com.novell.nidp.common.authority.PasswordExpiredException;
import com.novell.nidp.common.authority.PasswordExpiringException;
import com.novell.nidp.common.authority.UserAuthority;
import com.novell.nidp.logging.NIDPLog;
from __future__ import print_function
import logging
import boto3
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# print(response['Reservations'][0]['Instances'][0]['InstanceId'])
@trepidity
trepidity / nam-build-cli.py
Created February 11, 2020 17:34
A script to install NetIQ Access Manager
from __future__ import print_function
import boto3
import botocore
import os
import shutil
import tarfile
import subprocess
import sys
import argparse
import io
@trepidity
trepidity / headersDiag.jsp
Last active July 29, 2019 16:03
Prints headers that NAM injects
<%@ page import="java.util.*" %>
<html>
<head>
<title>NAM Diag Headers</title>
</head>
<body>
<h1>HTTP Request Headers Received</h1>
<table border="1" cellpadding="4" cellspacing="0">
<%
Enumeration eNames = request.getHeaderNames();