Skip to content

Instantly share code, notes, and snippets.

@Ilgrim
Ilgrim / sdl2_game_loop.c
Created September 25, 2023 21:17 — forked from velipso/sdl2_game_loop.c
SDL2 game loop forcing a certain frame rate
//////////////////////////////////////////////////
//
// EDIT: Warning, this doesn't seem to work well.
//
//////////////////////////////////////////////////
@Ilgrim
Ilgrim / rsacrypto.go
Created September 14, 2023 11:03 — forked from dadencukillia/rsacrypto.go
Golang rsa module with chunk encryption and decryption
// Adapted from: https://gist.github.com/miguelmota/3ea9286bd1d3c2a985b67cac4ba2130a
package rsacrypto
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"fmt"
@Ilgrim
Ilgrim / MoveSprite.asm
Created August 14, 2023 16:23 — forked from biomood/MoveSprite.asm
A C64 example in assembly that moves a sprite up/down/left/right
;*************************************************
;* Create and move a simple sprite x,y *
;*************************************************
processor 6502
org $1000
;helpful labels
CLEAR = $E544
GETIN = $FFE4
@Ilgrim
Ilgrim / mount_qcow2.md
Created August 10, 2023 12:53 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@Ilgrim
Ilgrim / git-apply-patch.md
Created August 4, 2023 09:11 — forked from emmanueltissera/git-apply-patch.md
Generate a git patch for a specific commit

Creating the patch

git format-patch -1 <sha>
OR
git format-patch -1 HEAD

Applying the patch

git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying

@Ilgrim
Ilgrim / rss.php
Created June 21, 2023 12:25 — forked from bossman759/rss.php
Parse RSS(XML) in php!
$html = "";
// URL containing rss feed
$url = "http://www.realbeta.net63.net/blog/rss?id=1";
$xml = simplexml_load_file($url);
for($i = 0; $i < 1; $i++){
$title = $xml->channel->item[$i]->title;
$link = $xml->channel->item[$i]->link;
$description = $xml->channel->item[$i]->description;
$pubDate = $xml->channel->item[$i]->pubDate;
@Ilgrim
Ilgrim / starttls_smtp_example.go
Created June 14, 2023 19:52 — forked from jim3ma/starttls_smtp_example.go
Golang StartTLS SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@Ilgrim
Ilgrim / golang-tls.md
Created June 14, 2023 19:51 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@Ilgrim
Ilgrim / main.cpp
Created May 28, 2023 22:44 — forked from adituv/main.cpp
SDL Gamepad Input Stuff
#include <cstdio>
#include <string>
#include <vector>
#include <SDL.h>
void logJoystickEvent(SDL_Event e);
std::string showHatState(Uint8 hat);
int main(int argc, char* argv[]) {
// Detect first gamepad on which a key is pressed, then log its events.
@Ilgrim
Ilgrim / ISA.txt
Created May 21, 2023 18:11 — forked from PhirePhly/ISA.txt
Intro to the ISA bus by Mark Sokos
THE ISA AND PC/104 BUS
IBM, IBM/XT, IBM PC, and IBM PC AT are registered trademarks of
International Business Machines Corporation.
This file is designed to give a basic overview of the bus found in
most IBM clone computers, often referred to as the XT or AT bus. The
AT version of the bus is upwardly compatible, which means that cards