Skip to content

Instantly share code, notes, and snippets.

View aryan-gupta's full-sized avatar
👾
what even is computational entropy?

Aryan Gupta aryan-gupta

👾
what even is computational entropy?
View GitHub Profile
@fikri-izzuddin
fikri-izzuddin / dual_secure_boot.md
Last active April 2, 2024 14:20
Arch Linux dual secure boot with Windows 11
  • secure boot
  • encrypted root Arch Linux partition
  • Windows 11 with bitlocker on C partition
  • enable TPM2

Installation

Download Arch Linux and Windows 11 ISO

Arch Linux ISO: https://archlinux.org/download/

@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active May 8, 2024 17:59
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@lbeckman314
lbeckman314 / sudoers.lecture
Last active September 16, 2018 03:46
credit to reddit user /u/odapt and github user @brianclemens
 "Bee" careful __
with sudo! // \
\\_/ //
''-.._.-''-.._.. -(||)(')
'''
@primaryobjects
primaryobjects / m3u8.md
Last active May 8, 2024 09:27
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@idolpx
idolpx / download.py
Last active April 9, 2020 22:17 — forked from mjohnsullivan/download.py
Python HTTP download with resume and optional MD5 hash checking
import os.path
import requests
import shutil
import hashlib
import logging
def validate_file(file_path, hash):
"""
Validates a file against an MD5 hash value
@setzer22
setzer22 / README.md
Last active December 2, 2023 14:03
Linux command to hibernate and then reboot into a different OS

Linux command to hibernate and then reboot into a different OS

In this document I describe my setup about how to add a menu shortcut that will hibernate and reboot the system into a different OS (in my case, Windows), and then restore linux on the next reboot.

For this, I'll be using Arch Linux with systemd-boot as my boot manager, but in practice any bootloader that handles the LoaderEntryOneShot (a.k.a. BootNext) efivar should work.

NOTE It is advisable to not do this with window's fast boot feature active, since alternating the hibernation of two systems can cause shared partitions to get corrupted. However, if additional steps are taken in order to ensure the shared partition are unmounted before reboot, or no partitions are shared between the two OSs, this can be made to work with fastboot enabled which should give quite a boost in Windows' startup time.

Set the LoaderEntryOneShot/BootNext EFI variable

@brianclemens
brianclemens / sudoers.lecture
Created July 8, 2017 04:04
hardcore sudo lecture
 "Bee" careful __
with sudo! // \
\\_/ //
''-.._.-''-.._.. -(||)(')
'''
@jeb2239
jeb2239 / main.cpp
Created February 28, 2017 22:09
Example C++ concepts with gcc 6.2 or greater
//compile this file with gcc 6.2 or greater
#include <iostream>
#include <string>
#include <locale>
#include <vector>
#include <cassert>
#include <list>
using namespace std::literals;
@Manouchehri
Manouchehri / rfc3161.txt
Last active May 8, 2024 17:45
List of free rfc3161 servers.
https://rfc3161.ai.moda
https://rfc3161.ai.moda/adobe
https://rfc3161.ai.moda/microsoft
https://rfc3161.ai.moda/apple
https://rfc3161.ai.moda/any
http://rfc3161.ai.moda
http://timestamp.digicert.com
http://timestamp.globalsign.com/tsa/r6advanced1
http://rfc3161timestamp.globalsign.com/advanced
http://timestamp.sectigo.com
@maxtruxa
maxtruxa / Makefile
Last active August 31, 2023 14:56
Generic makefile for C/C++ with automatic dependency generation, support for deep source file hierarchies and custom intermediate directories.
# output binary
BIN := test
# source files
SRCS := \
test.cpp
# files included in the tarball generated by 'make dist' (e.g. add LICENSE file)
DISTFILES := $(BIN)