Skip to content

Instantly share code, notes, and snippets.

View HarryR's full-sized avatar
🏴‍☠️
My time travel machine is stuck at 60 seconds per minute

HaRold HarryR

🏴‍☠️
My time travel machine is stuck at 60 seconds per minute
View GitHub Profile
@pib
pib / sexp.py
Created November 23, 2009 07:57
A simple Python s-expression parser.
from string import whitespace
atom_end = set('()"\'') | set(whitespace)
def parse(sexp):
stack, i, length = [[]], 0, len(sexp)
while i < length:
c = sexp[i]
print c, stack
@HarryR
HarryR / FIZZ-Y-BUZZ.php
Last active December 27, 2015 05:08
/r/shittyprogramming fizz buzz competition entry
<?php
// CPOYRIGHT (C) 1989 ACCESODATA CORPORATION ES.
// AUTHOR: RDRGO.43
// DEPART: ENGINEERING
// PROJEC: INSURANCE DATA VERIFICACION
/* 0001 */ // DEFINE('
/* 0002 */ FOREACH( RANGE(1,100) AS $NUMERO )
/* 0003 */ {
/* 0004 */ // IS NUMERO FOR BUZZ?
/* 0005 */ $DIVTRES = (string)($NUMERO / 3);
#include <stdio.h>
#include <sodium.h>
int main(int argc, char **argv) {
int tries = 1;
sodium_init();
while (1) {
unsigned char zero_public_key[crypto_sign_PUBLICKEYBYTES] = {0};
@ndarville
ndarville / webm.md
Last active September 30, 2023 18:56
4chan’s guide to converting GIF to WebM - https://boards.4chan.org/g/res/41212767

Grab ffmpeg from https://www.ffmpeg.org/download.html

It's a command line tool which means you will have to type things with your keyboard instead of clicking on buttons.

The most trivial operation would be converting gifs:

ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
  • -crf values can go from 4 to 63. Lower values mean better quality.
  • -b:v is the maximum allowed bitrate. Higher means better quality.
@jesperborgstrup
jesperborgstrup / ec_lsag_test.py
Last active March 11, 2023 21:23
Python implementation of Linkable Ring Signatures over Elliptic curves
# MIT License
#
# Copyright (C) 2014 Jesper Borgstrup
# -------------------------------------------------------------------
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
@nlitsme
nlitsme / ecdsa_demo.py
Last active September 20, 2024 14:33
python implementation of ecdsa calculations, demonstrating how to recover a private key from two signatures with identical 'r', and demonstrating how to find the public key from a signature and message, or from two signatures.
from __future__ import print_function, division
"""
By Willem Hengeveld <itsme@xs4all.nl>
ecdsa implementation in python
demonstrating several 'unconventional' calculations,
like finding a public key from a signature,
and finding a private key from 2 signatures with identical 'r'
"""
@xnyhps
xnyhps / gist:33f7de50cf91a70acf93
Created July 4, 2014 14:29
mod_onions: Install instructions on Debian
# Add the Prosody repository, because we want the latest version
echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list
wget https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add -
sudo apt-get update
# Install tor and prosody, and lua-bitop, which is required for mod_onions
sudo apt-get install prosody tor lua-bitop
# Prepare the directories where Tor will store the hidden service's private key
@HelloZeroNet
HelloZeroNet / opensslVerify2.py
Last active June 19, 2017 23:36
Alternative openssl verify
#!/usr/bin/env python
##
## @file contrib/verifymessage/python/terracoin_verifymessage.py
## @brief terracoin signed message verification sample script.
## @author unknown author ; found on pastebin
##
import ctypes
import ctypes.util
import hashlib
@badmofo
badmofo / borromean.py
Last active November 1, 2021 05:53
Pure Python Borromean Ring Signatures
'''
Pure Python Borromean Ring Signatures
DEPENDS ON: pip install ecdsa
WARNING: THIS IS A PEDAGOGICAL IMPLEMENTATION.
PERFORMANCE IS HORRIBLE AND NON-CONSTANT.
CORNER CASES ARE NOT PROPERLY CHECKED.
FOR THE LOVE OF GOD USE THE CODE FROM THE ELEMENTS PROJECT.
https://gist.github.com/badmofo/2d6e66630e4a6748edb7
'''
from hashlib import sha256
@HarryR
HarryR / spider_DS_Store.py
Last active September 8, 2016 12:04
Spider .DS_Store files on a website
#!/usr/bin/env python
import requests
import sys
import requests
import os
from tempfile import mkstemp
from ds_store import DSStore
def main():
if len(sys.argv) < 2: