Skip to content

Instantly share code, notes, and snippets.

View Rooster212's full-sized avatar

Jamie Roos Rooster212

View GitHub Profile
@Rooster212
Rooster212 / ResizeLVM.md
Created July 4, 2023 08:51
Resize Debian LVM

How to expand disk in TrueNAS Scale VM

This is not the only way to do this, however from researching and experimentation, I found that the easiest way to do this is to do these steps below.

  1. Shutdown VM
  2. Resize Disk in TrueNAS (edit the zvol and expand the size to desired)
  3. Add GParted ISO to boot order before HDD
  4. Boot into GParted live ISO and expand disk size to fill available space
  5. Remove ISO from boot order
  6. Boot machine
@Rooster212
Rooster212 / aws_sso.py
Last active March 24, 2022 17:23 — forked from sgtoj/aws_sso.py
AWS SSO Credentials File Updater for AWS SDKs
#!/usr/bin/env python3
import json
import os
import sys
from configparser import ConfigParser
from datetime import datetime
from pathlib import Path
import boto3
@Rooster212
Rooster212 / PetersPetrolPumps.py
Created January 29, 2020 09:56
Peters Petrol pumps. One of my first Python projects. I'll upload this to a proper repo with running instructions at some point.
# Jamie Roos | Peter's Petrol Pump's | Required - petrolpump.png in parent directory for window icon
import sys
from PyQt4 import QtGui,QtCore
class Pump(QtGui.QDialog):
def __init__(self,parent = None):
# private variables
self.amountToPay = 0.0
self.numLitres = 0.0
@Rooster212
Rooster212 / my-404.html
Created November 14, 2017 21:30
The page I am using for a 404 on my server.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<title>Oops.</title>
<link href="https://fonts.googleapis.com/css?family=Quicksand|Raleway" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
@Rooster212
Rooster212 / GridLibraries.md
Last active November 23, 2020 17:05
List of dashboard drag-drop style widgets
@Rooster212
Rooster212 / elementsFromPoint.ts
Created March 22, 2016 15:00
elementsFromPoint method that returns an Element[] so that we can have all the array methods (elementsFromPoint normally returns a NodeList). See my elementsFromPoint.js gist for fork details etc.
export function elementsFromPoint(x, y): Element[] {
var elements = [], previousPointerEvents = [], current, i, d;
// chrome supports this (and future unprefixed IE/Edge hopefully)
if (typeof (<any>document).elementsFromPoint === "function")
return Array.prototype.slice.call((<any>document).elementsFromPoint(x, y));
// IE11/10 should support this
if (typeof document.msElementsFromPoint === "function")
return Array.prototype.slice.call(document.msElementsFromPoint(x, y));
@Rooster212
Rooster212 / elementsFromPoint.js
Last active February 10, 2021 11:51 — forked from oslego/elementsFromPoint.js
Gets all elements below the specified point. Checks to see if browser already has method before using a manual method. Originally found https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/dTYbg4_S2b8/bEtoAnkP0swJ
// returns a list of all elements under the cursor
//
function elementsFromPoint(x,y) {
var elements = [], previousPointerEvents = [], current, i, d;
if(typeof document.elementsFromPoint === "function")
return document.elementsFromPoint(x,y);
if(typeof document.msElementsFromPoint === "function")
return document.msElementsFromPoint(x,y);
@Rooster212
Rooster212 / getGravitarImage.cs
Created August 19, 2015 09:27
Gets a Gravitar image and returns the image as a 64bit string, or null if there is no image available
void Main()
{
Console.WriteLine(getGravitarImage("jamieroos1@googlemail.com"));
}
string getGravitarImage(string email)
{
MD5 md5hasher = MD5.Create();
byte[] data = md5hasher.ComputeHash(Encoding.Default.GetBytes(email.Trim().ToLower()));