Skip to content

Instantly share code, notes, and snippets.

@jrod9k1
jrod9k1 / checkGeneticData.ps1
Last active November 23, 2023 17:46
Quick PowerShell thing to look at genetic data from 23andme and functional genomics
$23andme = Get-Content ./genome_Gerard_Russell_v5_Full_20230325103743.txt | ConvertFrom-Csv -Delimiter "`t" -Header @("Rsid", "Chromosome", "Position", "Genotype")
$functional = Get-Content ./Raw_Gene_File.txt | ConvertFrom-Csv -Delimiter "`t" -Header @("Rsid", "Chromosome", "Position", "Genotype")
$compare = Compare-Object -ReferenceObject $23andme -DifferenceObject $functional -Property Rsid -IncludeEqual
$compare | ? {$_.SideIndicator -eq "=="} | Measure-Object
# Count : 38405
# ...
$compare | ? {$_.SideIndicator -eq "=>"} | Measure-Object
# Count : 113493
@jrod9k1
jrod9k1 / process_nmap_xml.ps1
Created September 7, 2022 04:16
WIP thing to flatten nmap xmls to a readable CSV in PSv7
$xmlLocation = "C:\path\to\*.xml"
$files = Get-ChildItem -Path $xmlLocation -Filter *.xml
$allHosts = @()
foreach($f in $files){
$xmlContent = [Xml](Get-Content $f)
$xmlHosts = $xmlContent.nmaprun.host
$allHosts += $xmlHosts
@jrod9k1
jrod9k1 / shell.lua
Created June 10, 2022 16:23
Thing to get the "best" available shell in wezterm
-- find the "best" shell sorted by user preference
-- expects a table input like
-- get_shell_by_pref({"pwsh", "powershell"})
-- TODO: ordered?
function get_shell_by_pref(shell_tbl)
shell_prefs = {
'pwsh',
'powershell',
'cmd' -- don't know why you wouldn't have powershell on a windows host but :shrug:
}
@jrod9k1
jrod9k1 / multitail_mc.conf
Created March 17, 2022 23:59
Multitail Minecraft Config
colorscheme:mc
cs_re:white,red,bold:\[[A-Za-z0-9_]{3,16}: Given.*]
cs_re:red:\[[\#A-Za-z0-9 \-]*\/ERROR\]
cs_re:cyan:\[[\#A-Za-z0-9 \-]*\/INFO\]
cs_re:yellow:\[[\#A-Za-z0-9 \-]*\/WARN\]
cs_re:magenta:\[[0-9:]{8}\]
cs_re:green:Player [A-Za-z0-9_]{3,16} is (now|not) AFK.*
cs_re:green:[A-Za-z0-9_]{3,16} lost connection:.*
cs_re:green:[A-Za-z0-9_]{3,16} left the game.*
cs_re:green:[A-Za-z0-9_]{3,16} joined the game.*
@jrod9k1
jrod9k1 / meme.php
Last active March 17, 2022 23:50
globius.org header nonsense
# Cancer Headers -jrod
$bruh = array(
'Crack money',
'Duct tape and prayer',
'Chewing gum and optimistic thoughts',
'Micromely',
'Macromely',
'dreams(tm)',
'GFuel(tm)',
'The tears of GMod players',
# hacky af script to pull gmod server info from master servers
# NOTE: Currently the most time consuming part of this script is PTR collection, need to find more efficient way
# TODO: The parrallel execution could introduce some issues w/ duplicates (edge case)
# TODO: Redo GeoIP handling to not use API so we can do 5 min interval runs of this
# FIX: Timestamp
# TODO: Clean this abhorrent shit up
from gevent.pool import Pool
from gevent import monkey # override/"patch" existing functions
from gevent import joinall
@jrod9k1
jrod9k1 / gmod_query.py
Last active June 10, 2018 04:22
WIP query for populated DarkRP servers and their associated host
# requires python-valve, and unicodecsv (only because python27 sucks at unicode CSVs)
import sys
import valve.source
import valve.source.a2s
import valve.source.master_server
import unicodecsv as csv
from pprint import pprint
import json
import urllib
import re
@jrod9k1
jrod9k1 / spinboye.sh
Created September 10, 2017 01:56
Script to check if hurricane Irma has claimed Miguel's internet connection.
dead=0
while [ $dead -ne 2 ]; do
sleep 1
ping -c 1 -t 1 MIGUEL_ADDR_HERE > /dev/null
if [ $? -eq 2 ]; then
echo "shit boi he ded"
say "shit boi he ded"
dead=2
read -p "Press F to pay respects: " respects
if [[ $respects =~ ^[Ff]$ ]]; then
@jrod9k1
jrod9k1 / powerCalc.py
Last active March 9, 2017 14:59
Random script to calculate residential power cost of running a device.
kWh = input("Enter price per kWh in dollars: ")
idle = input("Enter idle/expected average power consumption of device in watts: ")
hrsPerDay = input("How many hours per day do you expect this device to be on: ")
# Some sanity checking here in a wee bit, only 24 hrs in day etc
monthlyCost = (((idle * hrsPerDay) / 1000) * 30) * kWh
print "\n"
print "Assuming average month of 30 days this device will cost $" + str(monthlyCost) + " per month."
@jrod9k1
jrod9k1 / studentChooch.sh
Last active March 9, 2017 14:57
*Really* hacky script to import new students into Open Directory at CHS via a CSV file
#!/bin/bash
# Chooch to import students into OD via a generated CSV
# The hackiest shell script you ever dun seen't this side of the Mississippi
# Some DSCL stuff stolen from here: https://gist.github.com/yesdevnull/7908795
# ./studentChooch [csvFile.csv]
# TODO: Work on crypt password issue w/ Filemaker Pro
# Config Junk (Make sure all of this is correct