Navigation Menu

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 / reassemble_arguments.sh
Last active February 6, 2018 14:05
Reassemble arguments (support-most-cases implementation) in POSIX shell - Transforming "$*" into "$@"
#!/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 / abuild.sh
Last active February 6, 2018 14:11
Simplistic abuild wrapper for building packages out-of-the-tree.
#!/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 / 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?
@przemoc
przemoc / alpha.cpp
Last active February 6, 2018 14:39
How to check whether alpha channel is used in ARGB32 QImage - http://stackoverflow.com/q/6157286/241521
// 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 / xopen.c
Last active February 6, 2018 14:52
How to open a file and create all needed directories along the way - http://stackoverflow.com/q/11147850/241521
/* 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>
/* 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
@przemoc
przemoc / 10-trackpoint.rules
Last active January 16, 2019 23:24
udev rule (put it in /etc/udev/rules.d/) to make trackpoint more sensitive and speedy
### default values: sensitivity=128, speed=97
ACTION=="add", SUBSYSTEM=="input", ATTR{name}=="TPPS/2 IBM TrackPoint", ATTR{device/sensitivity}="196", ATTR{device/speed}="255"
@przemoc
przemoc / preferences
Created December 13, 2015 20:49
Switching from jessie to jessie-backports with support for installing stretch/sid packages. (/etc/apt/)
Package: *
Pin: release n=jessie-backports
Pin-Priority: 800
Package: *
Pin: release n=jessie-updates
Pin-Priority: 700
Package: *
Pin: release n=jessie
@przemoc
przemoc / hd-sentinel.md
Created May 3, 2019 21:58
Hard Disk Sentinel (standard) 5.30 for Windows for FREE

Hard Disk Sentinel is a good tool to check and monitor your disks parameters and health. You should consider having it in your toolbox.

Now you can get Windows version of Hard Disk Sentinel v5.30 (9417) for free at SharewareOnSale. After clicking "Download Hard Disk Sentinel Now" button you'll have to fill a form asking for email (they'll use it to send you news regarding SharewareOnSale offers), country, used platforms, gender, job level, and confirm it by clicking "Give it to me now". You'll get SharewareOnSale_Giveaway_Hard_Disk_Sentinel_hub.exe and also mail titled "Download is ready: Hard Disk Sentinel" starting with:

Hi there. Thank you for downloading from us. Your download details are given below.

Hard Disk Sentinel (100% discount)

YOUR DOWNLOAD(S)