Skip to content

Instantly share code, notes, and snippets.

View kism's full-sized avatar

Kieran Gee kism

View GitHub Profile
#!/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)
@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

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 / 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));
}
@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')) {
#!/usr/bin/env python3
import requests
import socket
import time
import sys
import sqlite3
from ping3 import ping
from sqlite3 import Error
@kism
kism / webindexer.py
Last active September 30, 2021 07:30
#!/usr/bin/env python3
import textwrap
import os
import math
from os import listdir, path
from html.parser import HTMLParser
# Globals
debug = True
rootDir = '/var/www/html' # Make sure there is no forward slash at the end
$Hosts = @(
#("host1"),
#("host2"),
#("host3"),
("dpshub.kg.lan")
)
$hoststatusscript = {
$avstatus = Get-MpComputerStatus
@kism
kism / file
Last active July 20, 2021 09:05
what are you doing microsoft
Computer\HKEY_CURRENT_USER\Control Panel\International\🌎🌏🌍
@kism
kism / gist:0dbebd9686c4a0bbf624a7ea2cd8e774
Last active July 20, 2021 09:05
systemd service netcap fix maybe?
AmbientCapabilities=CAP_NET_BIND_SERVICE