Skip to content

Instantly share code, notes, and snippets.

Przemysław Pawełczyk przemoc

View GitHub Profile
View lockable_script_boilerplate.sh
#!/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
@przemoc
przemoc / pigz.c-msys2-mingw-w64.patch
Last active Mar 4, 2019
Make pigz.c compilable on MSYS2+MinGW-w64
View pigz.c-msys2-mingw-w64.patch
Make pigz.c (2.4) compilable on MSYS2+MinGW-w64.
diff --git a/pigz.c b/pigz.c
index bbbfd2cd19a1..85a61eeca674 100644
--- a/pigz.c
+++ b/pigz.c
@@ -324,6 +324,11 @@
// Use large file functions if available.
#define _FILE_OFFSET_BITS 64
@przemoc
przemoc / preferences
Created Dec 13, 2015
Switching from jessie to jessie-backports with support for installing stretch/sid packages. (/etc/apt/)
View preferences
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 / 10-trackpoint.rules
Last active Jan 16, 2019
udev rule (put it in /etc/udev/rules.d/) to make trackpoint more sensitive and speedy
View 10-trackpoint.rules
### 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 / gitio
Last active Nov 13, 2018
Turn a github.com URL into a git.io URL.
View gitio
#!/bin/sh
# 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
#
# Usage: gitio URL [CODE]
#
@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
@przemoc
przemoc / tc-delaydnsreqs.sh
Last active Apr 16, 2018
Traffic control - Make DNS requests delayed and low priority on Linux
View tc-delaydnsreqs.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
#
# Traffic control - Make DNS requests delayed and low priority on Linux.
@przemoc
przemoc / plzip-msys2-mingw-w64.patch
Created Feb 23, 2018
Make plzip compilable on MSYS2+MinGW-w64
View plzip-msys2-mingw-w64.patch
Make plzip compilable on MSYS2+MinGW-w64.
It's Hannes Domani's plzip.patch taken from:
http://download.savannah.gnu.org/releases/lzip/plzip/plzip-1.1-w.zip
that was applied against plzip 1.7:
http://download.savannah.gnu.org/releases/lzip/plzip/plzip-1.7.tar.gz
changed to not artificially limit number of threads (the limit was 32),
and finally diff has been regenerated using output with unified context.
--- a/decompress.cc 2018-02-07 20:17:00.000000000 +0100
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>
You can’t perform that action at this time.