Skip to content

Instantly share code, notes, and snippets.

View kism's full-sized avatar

Kieran Gee kism

View GitHub Profile
@kism
kism / gumtreeredirect.js
Last active February 24, 2022 08:21
Gumtree Australia Redirect
// ==UserScript==
// @name GumtreeAURedirect
// @match *://*.gumtree.com/*
// @grant none
// @version 1.0
// @author KiSM
// @description 2/2/2022, 11:44:23 AM
// ==/UserScript==
if (location.hostname.startsWith('gumtree.com')) {
@kism
kism / 00_integerscale.glsl
Last active July 16, 2022 09:49
Dolphin Emulator Integer Scale
void main()
{
//Make sure internal resolution is set to 1x
float2 pos = floor(GetCoordinates() * GetResolution()) * GetInvResolution();
float4 c0 = SampleLocation(pos);
SetOutput(float4(c0.r, c0.g, c0.b, c0.a));
}
function main()
-- Settings
local saveinterval = 7200
local path = "C:\\Temp\\" -- Use double backslash \\ instead of backslash \
-- Dont touch
local frame = 0
local filename = ""
local gamename = gameinfo.getromname()
console.log("Starting auto savestate script")
@kism
kism / So you broke sudo.md
Created September 11, 2023 07:03
So you broke sudo

So, on a vm that has polkit

Open two ssh sessions Session one, echo $$ to get the pid of your shell Session two, pkttyagent --process <pid> Session one, visudo /etc/sudoers.d/rsync or what ever other command you want as root Session two, authenticate as the user

You will notice the prompt is the same as the one when you try start/stop/restart/reload a systemd service

#!/usr/bin/env python3
import subprocess
import sys
from datetime import datetime
# Define the command
command = "git log --format='%at'"
# Run the command
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)