Skip to content

Instantly share code, notes, and snippets.

View andyg2's full-sized avatar
🎯
Focusing

Andy Gee andyg2

🎯
Focusing
View GitHub Profile
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<URI>\{{taskName}}</URI>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<Enabled>true</Enabled>
</LogonTrigger>
</Triggers>
@andyg2
andyg2 / readme.md
Last active July 9, 2024 06:43
Basic cron parsing in sql

It should parse these ok but nothing more complex

* * * * * - Every minute.

0 0 * * * - At midnight every day.

30 14 * * 5 - At 14:30 (2:30 PM) on every Friday.

0 22 * * 1-5 - At 22:00 (10 PM) from Monday to Friday.

@andyg2
andyg2 / worktracker.py
Created May 29, 2024 10:12
Simple windows activity logger - logs keystroke count, mouse pixels and windows size/position per windows title, outputting to a yyyy-mm-dd csv file every 10 seconds.
import win32gui
import win32con
import win32process
import time
import csv
from datetime import datetime
from pynput import keyboard, mouse
from collections import defaultdict
# Dictionary to store keystrokes and mouse movement per window title

Keybase proof

I hereby claim:

  • I am andyg2 on github.
  • I am 74gee (https://keybase.io/74gee) on keybase.
  • I have a public key ASATrKdGwD2MAR_RimQK5KPdoheN7XGtC11rnvm02qR9rAo

To claim this, I am signing this object:

@andyg2
andyg2 / wrap.bat
Created December 16, 2023 17:35
One liner to wrap all mp4 files in a folder of the same name
for %F in (*.mp4) do @(md "%~nF" 2>nul && move "%F" "%~nF\")
@andyg2
andyg2 / wc-category-image-fallback.php
Created November 23, 2023 23:05
Override the WooCommerce subcategory thumbnail to fallback to a product image or the standard fallback image
<?php
/*
Plugin Name: WC Category Image Fallback
Description: WooCommerce Product Image Fallback for Categories.
Version: 1.0
Author: Andy Gee
*/
@andyg2
andyg2 / output.json
Last active October 28, 2023 00:52
A regulalr expression based JavaScript VCARD parser into a JSON
{
"adr": [
{
"meta": {
"TYPE": "INTL",
"TYPE1": "PARCEL",
"TYPE2": "WORK"
},
"value": [
"",
@andyg2
andyg2 / get_pages.php
Created September 15, 2023 05:56
Download Wordpress Page content from wp-json API
<?php
if (isset($_GET['host'])) {
define('WEBSITE_URL', 'https://' . $_GET['host']);
} else {
echo 'usage: get_pages.php?host=www.domain.com';
exit;
}
@andyg2
andyg2 / index.html
Created August 8, 2023 10:50
MediaPipe - Face Mesh
<div class="container">
<video class="input_video"></video>
<div class="canvas-container">
<canvas class="output_canvas" width="1280px" height="720px">
</canvas>
</div>
<div class="loading">
<div class="spinner"></div>
<div class="message">
Loading
@andyg2
andyg2 / wfscan.sh
Created July 6, 2023 22:03
Use WordFence's vulnerabilities API to determine if any directories match recently reported slugs (previous 30 days)
#!/bin/bash
# Usage: ./wfscan.sh /home/username/web/domain.com/public_html/wp-content/plugins
# Output (Clean)
# >>> Scanning /home/username/web/domain.com/public_html/wp-content/plugins
# >>> Nothing found.
# Output (Suspect)
# >>> Scanning /home/username/web/domain.com/public_html/wp-content/plugins