Skip to content

Instantly share code, notes, and snippets.

@aclud
aclud / DB_mySQL_SOAP_call.ps1
Created February 29, 2024 21:52
Tool to query mySQL and connect to thousands of remote nodes to gather information
<#########################################################################
PowerShell tool to query mySQL, obtain node info, verify/bring VPN up, and connect via SOAP to pull config/license/version data
Data used for license true ups, program management/recalls, configuration item record validation, and problem management activities
***REMOVED*** Sweep Utilty
Author: Al Ludwig - al.ludwig at ***REMOVED***
Usage: Verify ***REMOVED*** vars and SQL are correct
Run using PowerShell
@aclud
aclud / GarageMonitor.py
Last active February 29, 2024 21:27
Garage Monitor python script
#!/usr/bin/python
# uses python, raspberry pi, disassembled garage remote, and sensors
# to control garage door w/ alexa script or IFTTT to open/close/provide temp and humidity
# amount of light, time, and motion sensors used
import RPi.GPIO as io
import time
# from datetime
import datetime
@aclud
aclud / something_large.vbs
Last active February 29, 2024 21:20
Large vbscript to compare disparate databases and provide actionable output or automatically repair
'sample large script comparing data from two disparate databases (MSSQL and Sybase) where no data warehouse is available to identify anomalies
'auto-selects database if only one, UI provides input to select if multiple valid databases
'queries pulled into arrays and compared then logged for categorization and action to be taken on like data, continues running/pause mode if DB connection severed
'non-compiled code provides UI via browser, encrypted config file to run/resume/perform incremental, and licensing for traceability
'tool provides method to read input from file or crawl databases for anomalies
Dim strScriptVer, strScriptNamePath, strScriptPath, strLogDirectory, strLogFile, strErrorImageLogFile, strErrorStudyLogFile
Dim strInCkeys, LogKeepSize, ConfigFile, strNoConfSave, strRunFromTxtFile
' ******************* options ********************************
@aclud
aclud / vol.sh
Created February 29, 2024 20:53
SQL volume report shell script
#!/bin/bash
#
#
# this script is not for you, it's not validated.
#
# "tried" on ***REMOVED***
#
# written in a hurry to solve a problem. lots of IO's exist.
#
# note script takes ~15 minutes to pull data for one month
@aclud
aclud / blah_exists.sh
Created February 29, 2024 20:47
File Exists shell script
#!/bin/ksh
#sample of shell script to query db for file information and verify that files exist where expected
#########################################################################
#
# ***REMOVED*** "File Exists" Utility
#
# Author: ***REMOVED***
# Version: 0.1
@aclud
aclud / repair-log-route.js
Created February 29, 2024 20:41
Javascript DICOM UID append and route
// Rule::Evaluate()
function Rule::Evaluate()
{
//note - UID length not validated for conformance to standards, use case specific and short-term
//change these lines to suit your needs
var strLog = "c:\\temp\\data.txt"; //log path must exist
var strDestinationUID = "1.2.528.1.1001.300.17.5477.3229.31222759877014.20110126194948796"; //use GetDestinationUID.vbs to obtain UID to send to
var strAdd = ".1"; // string to add to the end of every UID
@aclud
aclud / alexa_interaction_model.txt
Created February 29, 2024 20:09
Alexa garage control skill + raspberry pi script
Intent schema:
{
"intents": [
{
"intent": "GetGarageState"
},
{
"intent": "GetTemp"
},
@aclud
aclud / glwach_repair.js
Last active July 19, 2023 14:30
DICOM QC repair javascript
// Reading Site = IACH
// Default QC Repair Script for GLWACH Modality Origins on QC Workstations
<empty>
// Rule::Evaluate
function Rule::Evaluate()
{
log.info("***************** Repair Script Start ******************");
var strDefault_DOB = "19000101"; // Default DOB - set to "" to disable
var iAccNumLength = 8; // number of digits in the Accno e.g. "03972309" = 8
var iPadTo = iAccNumLength; // Set to 0 to disable padding Accno with zeros
@aclud
aclud / youtubeup.sh
Last active April 25, 2018 04:18
Script to take videos FTP'ed from my D-Link DCS-5010L, compile the 15 second clips into one video, upload it to YouTube and email the URL to me.Requires: mencoder mailx youtube-upload (https://code.google.com/p/youtube-upload/)Run via cron
#!/bin/bash
#setup variables
x="/share/cam" #base dir to search
age="1" #minimum age in minutes of file to include in processing
date=$(date +"%Y%m%d%H%M") #date used throughout script
fileprefix="YT-5010L-" #output file name prefix
ytemail="youremail" #your youtube email account
ytpassword="password" #your youtube password
emailfrom="youremail(Your Name)" #your email address and from name
emailuser="youremail" #your gmail address