Skip to content

Instantly share code, notes, and snippets.

Avatar

Przemysław Pawełczyk przemoc

View GitHub Profile
@przemoc
przemoc / fibonacci.asm
Created Jul 19, 2010
Fibonacci n-th number (modulo 2^32) in x86 assembler
View fibonacci.asm
; Fibonacci n-th number (modulo 2^32)
;
; input:
; ecx = n
; modifies:
; eax, ecx, edx
; ouput:
; eax = number
; size:
; 15 bytes
View vdiwrap.c
/* 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 / xopen.c
Last active Feb 6, 2018
How to open a file and create all needed directories along the way - http://stackoverflow.com/q/11147850/241521
View xopen.c
/* SPDX-License-Identifier: MIT */
/*
* Copyright (C) 2012 Przemyslaw Pawelczyk <przemoc@gmail.com>
*
* This code is licensed under the terms of the MIT license.
* https://opensource.org/licenses/MIT
*/
#include <errno.h>
#include <fcntl.h>
@przemoc
przemoc / alpha.cpp
Last active Feb 6, 2018
How to check whether alpha channel is used in ARGB32 QImage - http://stackoverflow.com/q/6157286/241521
View alpha.cpp
// SPDX-License-Identifier: MIT
// Copyright (C) 2011 Przemyslaw Pawelczyk <przemoc@gmail.com>
//
// This script is licensed under the terms of the MIT license.
// https://opensource.org/licenses/MIT
bool useAlpha = false;
const uchar* pixelData = image.bits();
int bytes = image.byteCount();
@przemoc
przemoc / validations.rb
Last active Feb 6, 2018
Validation of IBAN, ISBN, ISSN, UESRP, NER and VATIN numbers
View validations.rb
# 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?
@przemoc
przemoc / abuild.sh
Last active Feb 6, 2018
Simplistic abuild wrapper for building packages out-of-the-tree.
View abuild.sh
#!/bin/sh
# SPDX-License-Identifier: MIT
## Copyright (C) 2017 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# abuild.sh
# Simplistic abuild wrapper for building packages out-of-the-tree.
@przemoc
przemoc / reassemble_arguments.sh
Last active Feb 6, 2018
Reassemble arguments (support-most-cases implementation) in POSIX shell - Transforming "$*" into "$@"
View reassemble_arguments.sh
#!/bin/sh
# SPDX-License-Identifier: MIT
## Copyright (C) 2016 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
# Reassemble arguments (support-most-cases implementation)
@przemoc
przemoc / tmux-vm.sh
Last active Feb 6, 2018
Set up log/debug Linux kernel session w/ QEMU in tmux
View tmux-vm.sh
#!/bin/sh
# SPDX-License-Identifier: MIT
## Copyright (C) 2012 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
LDIR="$HOME/qemu"
KDIR="$LDIR/$1"
@przemoc
przemoc / calcswsa.sh
Last active Feb 6, 2018
Shell script for calculating Sec-WebSocket-Accept from Sec-WebSocket-Key
View calcswsa.sh
#!/bin/sh
# SPDX-License-Identifier: MIT
## Copyright (C) 2013 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
_calcswsa()
{
View download_PAssist_Std.exe.sh
#!/bin/sh
# SPDX-License-Identifier: MIT
## Copyright (C) 2013 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Simple script for downloading program stored on CNET:
# - AOMEI Partition Assistant Standard
You can’t perform that action at this time.