Skip to content

Instantly share code, notes, and snippets.

View 46bit's full-sized avatar
🏳️‍🌈

Miki Mokrysz 46bit

🏳️‍🌈
View GitHub Profile
@46bit
46bit / bn_lib.c
Created November 17, 2014 22:47
An extract from OpenSSL crypto/bn/bn_lib.c. BN_bn2bin is used to extract binary data from bignums. I think?
int BN_bn2bin(const BIGNUM *a, unsigned char *to)
{
int n,i;
BN_ULONG l;
bn_check_top(a);
n=i=BN_num_bytes(a);
while (i--)
{
l=a->d[i/BN_BYTES];
@46bit
46bit / test.hs
Last active August 29, 2015 14:02
Tiny demo of my Haskell Turing Machine (https://gist.github.com/46bit/46fba4b32db68a5f47c9)
import TM
import Data.Maybe
main :: IO ()
main = print . TM.prettyTM . TM.executeTM $
TM.createTM "bbc" [(0, 'a', 'b', TM.Idle, 1), (1, 'b', 'c', TM.Right, 1)]
@46bit
46bit / tm.hs
Last active August 29, 2015 14:02
Turing Machine in Haskell.
module TM (
State,
Symbol,
Direction(..),
Transition,
ZipTape,
TM,
prettyTransition,
prettyZipTape,
prettyTM,
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@takeshixx
takeshixx / hb-test.py
Last active March 9, 2024 13:37
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@munificent
munificent / gist:9749671
Last active June 23, 2022 04:04
You appear to be creating a new IDE...
You appear to be advocating a new:
[ ] cloud-hosted [ ] locally installable [ ] web-based [ ] browser-based [ ] language-agnostic
[ ] language-specific IDE. Your IDE will not succeed. Here is why it will not succeed.
You appear to believe that:
[ ] Syntax highlighting is what makes programming difficult
[ ] Garbage collection is free
[ ] Computers have infinite memory
[ ] Nobody really needs:
@rsutphin
rsutphin / tag_and_push_tag.cap
Last active April 18, 2018 13:08
A capistrano 3 task to tag the repo after every deploy
# Requires Capistrano 3.2 or later
namespace :deploy do
after :finishing, :tag_and_push_tag do
on roles(:app) do
within release_path do
set(:current_revision, capture(:cat, 'REVISION'))
# release path may be resolved already or not
resolved_release_path = capture(:pwd, "-P")
@Kimundi
Kimundi / java_rust_generic.md
Last active March 20, 2024 06:02
A light comparison between Rust and Java generics and type system features.

Introduction

If you are familiar with Java's generics, and are coming to Rust, you might be lead to assume that its generics are working the same way.

However, due to the different type systems, and different implementation details, there are quite a few differences between generic code in both languages.

This document tries to give a short summary about those differences:

Core functionality

Java

@ShivamMistry
ShivamMistry / nas-wired
Last active September 2, 2018 20:28
Wired NAS netctl config and wpa_supplicant config for University of York
Description='NAS York'
Interface=enp3s0
Connection=ethernet
IP=dhcp
Auth8021X=yes
Priority=2
WPAConfigFile=/etc/wpa_supplicant/nas.conf
@bertspaan
bertspaan / README.md
Created January 2, 2014 15:28
Python script to convert DBF database file to CSV