Skip to content

Instantly share code, notes, and snippets.

View przemoc's full-sized avatar

Przemysław Pawełczyk przemoc

View GitHub Profile
@przemoc
przemoc / p7zip-pwd-from-stdin.patch
Created January 10, 2011 00:34
Awful p7zip hack for reading passwords from stdin. Compatible w/ 9.04 and 9.13.
--- p7zip_9.04.orig/CPP/7zip/UI/Console/Main.cpp 2009-06-27 16:18:14.000000000 +0200
+++ p7zip_9.04/CPP/7zip/UI/Console/Main.cpp 2011-01-10 01:25:36.000000000 +0100
@@ -48,6 +48,10 @@
#include "myPrivate.h"
#include "Windows/System.h"
+#include <iostream>
+
+#define MAX_PWD_SIZE_FROM_STDIN 1024
+
#include <stdio.h>
#include <stdlib.h>
#define NUMBER 12345678901234567890
#define _Q(n) #n
#define Q(n) _Q(n)
#define ATOL(n) atol(Q(n))
#define SSCANF(n) ({ long val = 0; sscanf(Q(n), "%ld", &val); val; })
@przemoc
przemoc / validations.rb
Last active February 6, 2018 14:29
Validation of IBAN, ISBN, ISSN, UESRP, NER and VATIN numbers
# SPDX-License-Identifier: MIT
## Copyright (C) 2010 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
module Validations # version 0.1
# International Bank Account Number
def iban?
#!/bin/bash
# SPDX-License-Identifier: MIT
## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Lockable script boilerplate
/* SPDX-License-Identifier: MIT */
/*
* Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com>
*
***** Description ************************************************************
*
* Simple (and incomplete) syscalls interposition for accessing fixed-size Sun
* xVM VirtualBox Virtual Disk Images (.vdi files), especially using sfdisk.
*
***** License ****************************************************************
@przemoc
przemoc / fibonacci.asm
Created July 19, 2010 14:06
Fibonacci n-th number (modulo 2^32) in x86 assembler
; Fibonacci n-th number (modulo 2^32)
;
; input:
; ecx = n
; modifies:
; eax, ecx, edx
; ouput:
; eax = number
; size:
; 15 bytes