Skip to content

Instantly share code, notes, and snippets.

View hypothermic's full-sized avatar

hypothermic hypothermic

View GitHub Profile
@mmozeiko
mmozeiko / tls_client.c
Last active June 5, 2024 16:22
simple example of TLS socket client using win32 schannel api
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <windows.h>
#define SECURITY_WIN32
#include <security.h>
#include <schannel.h>
#include <shlwapi.h>
#include <assert.h>
#include <stdio.h>
@orhun
orhun / arch_linux_installation.md
Last active May 22, 2024 19:59
Notes on my Arch Linux installation: UEFI/Secure Boot + systemd-boot, LUKS-encrypted root (XFS), LUKS-encrypted swap (with hibernate & unlocked via TPM)
@NeRdTheNed
NeRdTheNed / Forge1.2.5WorkspaceGuide.md
Last active May 31, 2024 22:06
How to set up a functional Forge 1.2.5 workspace in 2020.

How to set up a Forge 1.2.5 workspace in 2020 & above.

Automatic script (recommended)

I've created a bash script that sets up Forge 1.2.5, which you can find here! It automatically does each step of this guide for you, and includes a fix for sounds.

Manual setup

TODO: Add a section on installing the resources (sounds) folder to the MCP environment. The links have changed and Minecraft 1.2.5 isn't able to download them anymore.

@revant
revant / README.md
Last active July 16, 2022 08:46
Arch Linux on Lenovo IdeaPad 330-15ARR

Required Kernel params

loglevel=3 iommu=pt acpi_backlight=native
  • iommu=pt Solves sudden freeze of graphics Arch Forum Link
  • acpi_backlight=native Solves back light "failed" message during boot Arch Wiki
  • Use it with other params e.g. loglevel=3 iommu=pt acpi_backlight=native apparmor=1 security=apparmor quiet
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active June 7, 2024 06:32
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active May 29, 2024 19:10
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

machine_name : "eMMC Transfer Mode";
machine_version : 1.0.0;
machine_reference : ["https://www.design-reuse.com/news_img/20101001_2.gif",
"https://www.design-reuse.com/articles/24546/functional-fsm-paths-coverage-systemverilog.html"];
machine_author : "John Haugeland <stonecypher@gmail.com>";
machine_license : MIT;
jssm_version : >= 5.0.0;
graph_layout : dot;
@mcjohnalds
mcjohnalds / how-to-do-error-reporting-in-glib.md
Created May 12, 2016 12:25
Here's how to do error reporting in GLib

How to do error reporting in GLib

C doesn't support exceptions but GLib has its own error reporting system. It's kind of verbose but it works ok.

Let's pretend we were making a JSON parser library, here's how the error reporting would work. (This example was actually derived from json-glib).

First we create an enum to represent different error codes.

@bhanuc
bhanuc / hello.glade
Last active January 10, 2023 10:19
Minimal gnome hello world using glade + gjs
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<template class="Gjs_AppWindow" parent="GtkApplicationWindow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">gnome-hello</property>
<property name="window_position">center</property>
<property name="default_width">200</property>
<property name="default_height">100</property>
@dpryden
dpryden / ClassLoaderLeakExample.java
Created October 20, 2014 00:01
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,