Skip to content

Instantly share code, notes, and snippets.

View rosshiga's full-sized avatar

Ross Higa rosshiga

View GitHub Profile
@rosshiga
rosshiga / app.py
Created November 22, 2023 23:20
Vusion Delete for Whole Store
import urllib.request, json
import tkinter as tk
from tkinter import simpledialog, messagebox
import tkinter as tk
from tkinter import simpledialog
from tkinter import messagebox
# Function to show warning popup
@rosshiga
rosshiga / ViewRestartReason.ps1
Created March 14, 2023 17:48
Powershell Event Viewer Restart Events
Get-EventLog System -Newest 10000 | `
Where EventId -in 41,1074,1076,6005,6006,6008,6009,6013,1001,1003 | `
Format-Table TimeGenerated,EventId,UserName,Message -AutoSize -wrap
@rosshiga
rosshiga / remove_tilde_files.ps1
Created January 16, 2023 00:12
Remove Ms Office Temporary Owner Files ~$
$SourceDir = "C:\"
foreach ($file in Get-ChildItem -Force $SourceDir -Recurse)
{
if ((($file.Extension -match ".doc") -or ($file.Extension -match ".xls"))-and ($file.Name -like "~$*"))
{
Remove-Item $file.FullName -Force
}
@rosshiga
rosshiga / dataframe2xlsx.py
Last active September 6, 2022 00:23
Pretty Pandas to Excel Autofit and AutoFilter
import pandas as pd
import xlsxwriter
def dataframes2xls(dfs,fname, path=''):
with pd.ExcelWriter(path + fname + '.xlsx', engine='xlsxwriter') as writer:
for name,df in dfs.items():
df.to_excel(writer, index=False, header=True, sheet_name=name)
# Get the xlsxwriter workbook and worksheet objects.
workbook = writer.book
worksheet = writer.sheets[name]
@rosshiga
rosshiga / keyinfo.ahk
Created November 16, 2021 02:32
Excel to Window Autohotkey
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
;SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetKeyDelay, 20
^j::
Loop, 10
{
@rosshiga
rosshiga / radio.sh
Last active May 20, 2025 00:18
Radio-Pi: Bash Script to Stream Internet Radio Automatically
#!/bin/bash
# Wait for LDXE to load
sleep 5
# Stream URL
url='https://stream.revma.ihrhls.com/zc829'
# Start VLC once in the background if not already running
start_vlc_once() {
@rosshiga
rosshiga / SpeedLabel.ps1
Created August 4, 2021 23:58
Bartender Speed Label Program Replacement
<#
.Description
A program to interface Br Data with Bartender manually
#>
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$form = New-Object System.Windows.Forms.Form
$form.Text = 'Select a Computer'
@rosshiga
rosshiga / watch,ps1
Created July 6, 2021 03:27
Powershell Watch Folder Trigger
# Waits for CSOR App to push a text file to directory then runs BR Data SQL export
while( $true )
{
if( (Get-ChildItem C:\Brdata\CSHOST\auto\*.txt | Measure-Object).Count -eq 1){
Start-Process -FilePath "C:\Brdata\plbwin.exe" -ArgumentList "brsqlexp autocmd numdays=5 DSDDET DSDHDR"
}
Remove-Item 'C:\Brdata\CSHOST\auto\*' -Include *.txt
@rosshiga
rosshiga / back.sql
Created April 25, 2020 01:01
MS SQL Backup Script
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
-- specify database backup directory
SET @path = 'F:\ACSSQL\'
-- specify filename format
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) + '_' + REPLACE(CONVERT(VARCHAR(20),GETDATE(),108),':','')
@rosshiga
rosshiga / picount.py
Created April 14, 2020 02:23
Tally Counter for Pi
from email.message import EmailMessage
import smtplib
import urllib.request
import subprocess
import smtplib
import socket
from email.mime.text import MIMEText
import datetime
import time