Skip to content

Instantly share code, notes, and snippets.

View douglas-larocca's full-sized avatar

Douglas La Rocca douglas-larocca

View GitHub Profile
import os
import json
import pandas as pd
import sqlalchemy
from datetime import datetime
from sqlalchemy.schema import MetaData
from sqlalchemy.orm import sessionmaker
from sqlacodegen.codegen import CodeGenerator
import os
import fnmatch
import re
import json
import sys
import subprocess
import inspect
from datetime import datetime
import operator as op
@douglas-larocca
douglas-larocca / client.go
Created August 2, 2016 06:29 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@douglas-larocca
douglas-larocca / fmxdbc-restart
Created August 5, 2016 21:10
fmxdbc_listener.exe restart
#!/usr/bin/env python3
import sys
from winrm.protocol import Protocol
def xdbc_restart(host, user, password):
p = Protocol(
endpoint=('https://%s:5986/wsman' % host),
transport='ntlm',
username=user,
password=password,
@douglas-larocca
douglas-larocca / AES.c
Last active December 16, 2016 01:36 — forked from bricef/AES.c
A simple example of using AES encryption in Java and C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mcrypt.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
int encrypt(void *buffer, int buffer_len, char *IV, char *key, int key_len) {
@douglas-larocca
douglas-larocca / spectre.c
Created January 4, 2018 23:10 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@douglas-larocca
douglas-larocca / setupnewuser.ps1
Created January 15, 2018 17:42 — forked from theagreeablecow/setupnewuser.ps1
Setup New User in AD, Exchange and Lync
# This script will set up AD, User Directories, Exchange and Lync, using basic data retrived from a CSV file
# Requires the Active Directory module for Windows Powershell and appropriate credentials
# CSV file with corresponding header and user(s) info:
# Office,UserName,FirstName,LastName,Initial,Department,Role,Title,SetupSameAs,Manager,MailboxAccess,Extension,Mobile
#LOAD POWERSHELL SESSIONS
#------------------------
$exchangeserver = "exchange1.domain.com"
$Lyncserver = "lync1.domain.com.au"
#!/bin/bash
if (( $# < 1 ))
then
echo "Usage: $0 username"
exit 1
fi
username="$1"
json_left='{"input01":{"Input":"GmailAddress","GmailAddress":"'
%%file _chi2.c
#include <Python.h>
#include <numpy/arrayobject.h>
#include "chi2.h"
static char module_docstring[] =
"This module provides an interface for calculating chi-squared using C.";
static char chi2_docstring[] =
"Calculate the chi-squared of some data given a model.";
000(023Rb|001Rb)
001(017La|002Rb)
002(021La|003Rb)
003(021La|004La)
004(009Rb|005Lb)
005(004Ra|005La)
006(008La|007La)
007(009Rb|007La)
008(009Ra|008La)
009(010Ra|026Ra)