Skip to content

Instantly share code, notes, and snippets.

View Meraj's full-sized avatar
🖥️
coding, as usual

Meraj

🖥️
coding, as usual
View GitHub Profile
@insom
insom / despair.cpp
Created February 6, 2020 13:04
MySQL Session Tracking for ALL_GTIDS
#include <cstdio>
#include <mysql.h>
void retrieve_session_track_data(MYSQL *m) {
const char *data;
size_t length;
for(int type=0; type <= 255; type++) {
if (mysql_session_track_get_first(m, (enum enum_session_state_type) type, &data, &length) == 0) {
do {
@kevinjam
kevinjam / Decrypt.java
Last active September 7, 2022 07:25
RSA Encrypt in PHP and Decrypt in Java or Kotlin
public class DecryptKey {
//before you proceed, you need to ensure your public key is PKCS8 since that is what can be read natively in java.
//If your key begins with-----BEGIN CERTIFICATE-----,
// the it is ssleay and you need to convert it using the openssl command below
//openssl pkcs8 -topk8 -inform pem -in public.key -outform pem -nocrypt -out pkcs8-public-key.pem
//TODO You can you phpsecLib lib but it doesn't support some Library
//opnssl work fine
final private static String RSA_PRIVATE_KEY =
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzTrKt2Y7HqQpt8w379Sl
@fracek
fracek / CMakeLists.txt
Last active May 12, 2024 17:13
CMake and GTK+ 3
# Thanks to @danger89 and @Ilothar for updating the gist.
# Set the name and the supported language of the project
project(hello-world C CXX)
# Set the minimum version of cmake required to build this project
cmake_minimum_required(VERSION 3.10)
# Use the package PkgConfig to detect GTK+ headers/library files
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED gtkmm-3.0)