Skip to content

Instantly share code, notes, and snippets.

@ril3y
ril3y / installer.ps1
Last active October 31, 2024 02:16
installer.ps1
# Step 1: Check if Python is installed
function Ensure-Python {
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
Write-Host "Python not found. Installing Python..." -ForegroundColor Yellow
$pythonInstaller = "$env:TEMP\python-installer.exe"
Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.x.x/python-3.x.x-amd64.exe" -OutFile $pythonInstaller
Start-Process -FilePath $pythonInstaller -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1' -Wait
Remove-Item $pythonInstaller
} else {
Write-Host "Python is already installed." -ForegroundColor Green
@ril3y
ril3y / work_profile.ps1
Last active October 30, 2024 21:16
work_profile.ps1
function sha256 {
param (
[string]$FilePath
)
# Resolve the full path if the path is relative
$resolvedPath = Resolve-Path $FilePath -ErrorAction Stop
# Check if the file exists
if (-not (Test-Path $resolvedPath)) {
@ril3y
ril3y / personal_profile.ps1
Last active October 31, 2024 02:19
This is my personal ps1 profile
$env:VIRTUAL_ENV_DISABLE_PROMPT = "1"
& "C:\Users\riley\myvenv\Scripts\Activate.ps1"
try {
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression
} catch {
Write-Host "Failed to initialize Oh-My-Posh: $_" -ForegroundColor Red
}
function Disable-NewsAndInterests {
@ril3y
ril3y / gridfinity
Created January 8, 2024 01:56
gridfinity drawer generator
import svgwrite
import argparse
# Constants
top_unit_size_mm = 42 # The top size of the grid unit in mm (for spacing)
base_unit_size_mm = 37.1 # The base size of the grid unit in mm (for drawing)
corner_radius_mm = 1.6 # Radius of the rounded corners in mm
mm_per_inch = 25.4 # Millimeters per inch
dpi = 96 # DPI (standard for many systems)
hairline_stroke_mm = .01 # Hairline stroke width in mm for laser cutting
@ril3y
ril3y / wisecoco.py
Created April 25, 2023 03:43
Python script (work in progress) to communicate with the wisecoco lcd rotation module
import struct
import sys
import serial
import argparse
from enum import Enum
import time
DISPLAY_ON = 1
DISPLAY_OFF = 0
@ril3y
ril3y / m4b-sorter.py
Created January 21, 2023 17:24
A script to sort a directory full of m4b files into their proper folder/album directories that the audiobookshelf application wants.
import os
import re
import sys
import argparse
import mutagen
import logging
parser = argparse.ArgumentParser(description='Process m4b files.')
parser.add_argument('-s', '--source', dest='source_folder', required=True, help='Source folder containing m4b files')
parser.add_argument('-d', '--destination', dest='destination_folder', required=True, help='Destination folder for new directories')

Keybase proof

I hereby claim:

  • I am ril3y on github.
  • I am ril3y (https://keybase.io/ril3y) on keybase.
  • I have a public key ASDLiPH1ZPy9EXXB851e7C0xKCQIb_Q7W3Uwkb4RTYejvgo

To claim this, I am signing this object:

@ril3y
ril3y / Dockerfile
Last active February 14, 2021 17:27
Rainbow Miner
FROM nvidia/cuda:10.2-base
RUN apt-get update && apt-get install -y systemd liblttng-ust0 vim iputils-ping
RUN apt-get -y install git software-properties-common wget dkms build-essential
RUN git clone https://github.com/rainbowminer/RainbowMiner
WORKDIR RainbowMiner
#ADD RainbowMiner /RainbowMiner/
RUN chmod +x *.sh && ./install.sh
@ril3y
ril3y / ifttt_nginx_proxy.Dockerfile
Last active March 7, 2020 15:48
iftt_nginx.Dockerfile
FROM tiangolo/uwsgi-nginx-flask:python3.7
RUN pip install requests
@ril3y
ril3y / Grafana - DockerFile
Last active February 22, 2020 00:15
my-grafana Dockerfile
FROM grafana/grafana
RUN grafana-cli plugins install andig-darksky-datasource