Skip to content

Instantly share code, notes, and snippets.

View aneury1's full-sized avatar
🎯
Focusing

Aneury Perez aneury1

🎯
Focusing
  • BairesDev
  • Dominican Republic
View GitHub Profile
import sys
import random
import pygame
# FROM https://www.youtube.com/watch?v=o-6pADy5Mdg
pygame.init()
screen_width= 1280
screen_height=900
std::string from_pan_to_string(std::string track2){
std::string encoded = "";
uint8_t acc = 0;
bool full = false;
for (uint8_t c : track2)
{
if (!full)
{
acc = c - 0x30;
acc <<= 4;
#include <vector>
#include <string>
#include <map>
#include <functional>
#include <memory>
#include <cctype>
#include <iostream>
#include <fstream>
using namespace std;
#include <Windows.h>
#include <iostream>
int main() {
// Open the serial port
HANDLE hSerial = CreateFile("COM9", GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hSerial == INVALID_HANDLE_VALUE) {
std::cerr << "Error opening serial port\n";
return 1;
#include <QApplication>
#include <QMainWindow>
#include <QMenuBar>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QPushButton>
#include <QSignalMapper>
void testM()
{
// 37 78 81 85 27 68 07 4d 21 11 20 11 71 05 57 65 00 00
// 37 78 81 85 27 68 07 4d 21 11 20 11 71 5 57 65 00 00
// track2 4-bit BCD encode
std::string track2 = "377881852768074=211120117105576500001";
std::string encoded = "";
bool generateX509(const std::string& certFileName, const std::string& keyFileName, long daysValid)
{
bool result = false;
std::unique_ptr<BIO, void (*)(BIO *)> certFile { BIO_new_file(certFileName.data(), "wb"), BIO_free_all };
std::unique_ptr<BIO, void (*)(BIO *)> keyFile { BIO_new_file(keyFileName.data(), "wb"), BIO_free_all };
if (certFile && keyFile)
{
std::unique_ptr<RSA, void (*)(RSA *)> rsa { RSA_new(), RSA_free };
Issuer Exponent RID Index RID List Modulus Key length SHA1 Key Type Expires
AMEX 03 01 A000000025 AFAD7010F884E2824650F764D47D7951A16EED6DBB881F384DEDB6702E0FB55C0FBEF945A2017705E5286FA249A591E194BDCD74B21720B44CE986F144237A25F95789F38B47EA957F9ADB2372F6D5D41340A147EAC2AF324E8358AE1120EF3F 768 ACFE734CF09A84C7BF025F0FFC6FA8CA25A22869
AMEX 03 02 A000000025 AF4B8D230FDFCB1538E975795A1DB40C396A5359FAA31AE095CB522A5C82E7FFFB252860EC2833EC3D4A665F133DD934EE1148D81E2B7E03F92995DDF7EB7C90A75AB98E69C92EC91A533B21E1C4918B43AFED5780DE13A32BBD37EBC384FA3DD1A453E327C56024DACAEA74AA052C4D 896 33F5B0344943048237EC89B275A95569718AEE20
AMEX 03 03 A000000025 B0C2C6E2A6386933CD17C239496BF48C57E389164F2A96BFF133439AE8A77B20498BD4DC6959AB0C2D05D0723AF3668901937B674E5A2FA92DDD5E78EA9D75D79620173CC269B35F463B3D4AAFF2794F92E6C7A3FB95325D8AB95960C3066BE548087BCB6CE12688144A8B4A66228AE4659C634C99E36011584C095082A3A3E3 1024 8708A3E3BBC1BB0BE73EBD8D19D4E5D20166BF6C Live
AMEX 03 04 A000000025 D0F543F03F2517133EF2BA4A1104486758630DC
// Set up the command and process information structures
STARTUPINFO startupInfo = {};
startupInfo.cb = sizeof(startupInfo);
SECURITY_ATTRIBUTES saAttr = {};
saAttr.nLength = sizeof(saAttr);
saAttr.bInheritHandle = TRUE;
// Create pipes for redirecting standard output
HANDLE hChildStd_OUT_Rd = NULL;
// g++ main.cpp -o video_player -lSDL2 -lavformat -lavcodec -lavutil -lswscale
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
extern "C" {
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}