Skip to content

Instantly share code, notes, and snippets.

View MXP2095onetechguy's full-sized avatar
:electron:
doing things for fun!

MXPSQL Server 20953 onetechguy MXP2095onetechguy

:electron:
doing things for fun!
View GitHub Profile
@MXP2095onetechguy
MXP2095onetechguy / cert.pem
Created October 1, 2023 12:03
MXPSQL's Self-Signed Certificate for future use
-----BEGIN CERTIFICATE-----
MIID2TCCAsGgAwIBAgIUKnvjRAOeTP+v9PyMSJgGIbSJnWwwDQYJKoZIhvcNAQEL
BQAwfDELMAkGA1UEBhMCQVUxEjAQBgNVBAgMCURlbHRhTGFuZDESMBAGA1UEBwwJ
RGVsdGFUb3duMRgwFgYDVQQKDA9TYXJhaC1TZWxpbmFUZWwxKzApBgkqhkiG9w0B
CQEWHGJsYWJiZXJzcWxAc2hlcmVsbGU5Lm5haC5icm8wHhcNMjMxMDAxMTIwMjQ2
WhcNMjMxMDMxMTIwMjQ2WjB8MQswCQYDVQQGEwJBVTESMBAGA1UECAwJRGVsdGFM
YW5kMRIwEAYDVQQHDAlEZWx0YVRvd24xGDAWBgNVBAoMD1NhcmFoLVNlbGluYVRl
bDErMCkGCSqGSIb3DQEJARYcYmxhYmJlcnNxbEBzaGVyZWxsZTkubmFoLmJybzCC
ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOYhzYxN3qNOI1RvRE83XisR
hdi31n6XhHc4lEJhORh7RvwCb6ejPQzWAbOVKX4Q02N/EYAS/WTwU8l22wtYpNiu
@MXP2095onetechguy
MXP2095onetechguy / amsert.bat
Created August 30, 2023 13:17
Batch script for automating MSERT downloads.
@echo off
rem Amsert
rem Auto MSERT
rem Auto MSERT for doing its job automatically for you
rem Pronounced as ("Am" as in "I am") and ("sert" as "sir" with a "t" or "sert" as in "assert"), or you can just pronounce it as "I Am Sirt" but without the "I" and no space between "Am" and the "Sirt" here. Or just the easy way as "I Am Assert" but without the "I" and that "as" in the "assert" along with no spaces between the "Am" and the "Sert" here. So basically Am-Sert is how you pronounced it, not "A-M-Sert" you slagfish.
rem
rem That one tool made in batch script for you lazy people of slags
rem
rem Batch becuz its EZ to run (and hard to write)
@MXP2095onetechguy
MXP2095onetechguy / tiffc.py
Created July 14, 2023 08:43
Convert and compile multiple images to one multipaged TIFF image file.
#/usr/bin/env python3
# import modules
from PIL import Image
import argparse
import glob
# initialize magic images
tiffimg = Image.new("RGB", (80, 80), "white")
imgs = []
@MXP2095onetechguy
MXP2095onetechguy / DangerDream.h
Last active February 6, 2023 12:59
ChatGPT made this abomination when I ask for a C header that may potentially be harmful.
/// DangerDream.h, the worst things to commit to a C preprocessor.
/// MXPSQL asked ChatGPT to write something that started off as a prank, but became worse and it came out with this masterpiece.
/// Made in February 6, 2023
///
/// Copyright 2023, MXPSQL
///
/// Copying and distribution of this file, with or without modification, are permitted in any medium without royalty, provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.
#ifndef DANGERDREAM_H
#define DANGERDREAM_H
@MXP2095onetechguy
MXP2095onetechguy / cpdb.h
Last active March 10, 2023 08:21
Copy Sqlite databases. Ripped from https://www.sqlite.org/backup.html
int CopyDatabase(sqlite3 *pDb1, sqlite3* pDb2){ /* Copy from pDb1 to pDb2 */
int rc; /* Function return code */
sqlite3 *pFile; /* Database connection opened on zFilename */
sqlite3_backup *pBackup; /* Backup object used to copy data */
/* Set up the backup procedure to copy from the "main" database of
** connection pFile to the main database of connection pInMemory.
** If something goes wrong, pBackup will be set to NULL and an error
** code and message left in connection pTo.
**
@MXP2095onetechguy
MXP2095onetechguy / u_die.h
Created September 13, 2022 10:27
Die in C and C++
#if !(defined(__cplusplus) || defined(c_plusplus)
#include <stdio.h>
#include <stdlib.h>
#else
#include <cstdio>
#include <cstdlib>
#include <string>
#endif
#!/usr/bin/env python3
b = "abc"
a = b[::-1][::-1]
print(a, a is b)
@MXP2095onetechguy
MXP2095onetechguy / mystrtok.h
Created May 13, 2022 08:24
A thread safe strtok function compatible with the POSIX strtok_r
#ifdef __cplusplus
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstddef>
#else
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
@MXP2095onetechguy
MXP2095onetechguy / Jifpad.java
Created March 28, 2022 03:09
A text pad that is multidocument in java with jshell
//usr/bin/env jshell --show-version --execution local "$0" "$@"; exit $?
// A JShell script for JIFpad (a text pad, multidocument)
import javax.swing.*;
JFrame jf = new JFrame("JIFPad");
JInternalFrame jif = new JInternalFrame();
int inty = 1;
jf.add(jif);
@MXP2095onetechguy
MXP2095onetechguy / better-mavericks-iso.sh
Last active December 31, 2021 15:00 — forked from c0d3d-net/mavericks-iso.sh
Create a bootable ISO from the OS X Mavericks app
#!/bin/sh
# Better Mavericks ISO
# Tool that generates mavericks iso file
#
# Improved version of https://gist.github.com/MXP2095onetechguy/cfe9c91f15a59932a0774af84eb0777c
# MXPSQL wrote this fork on the last day of 2021
# Use temp to do it
# Create a bootable ISO from the OS X Mavericks app
# http://thezinx.com/misc/trend/create-bootable-dmg-iso-mavericks-app/