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 / 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 / APK_Downgrade.md
Last active March 23, 2023 15:46
Android Application Downgrade
@przemoc
przemoc / gist:a6a2bf05e112910be944
Created August 23, 2014 12:40
[Arch] List provisions with packages providing them
# [Arch] List provisions with packages providing them
# pacman-based solution
pacman -Si \
| awk '/^$/{n=""}/^Name/{n=$3}/^Provides/{if($3!="None"){for(i=3;i<=NF;i++){if(t[$i]=="")t[$i]="";t[$i]=t[$i]" "n}}}END{for(p in t)printf("%44-s :%s\n",p,t[p])}' \
| sort | less
# expac-based solution (better)
expac -S "%n %P" \
| awk 'NF>1{for(i=2;i<=NF;i++){if(t[$i]=="")t[$i]="";t[$i]=t[$i]" "$1}}END{for(p in t)printf("%44-s :%s\n",p,t[p])}' \
#!/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
@przemoc
przemoc / calcswsa.sh
Last active February 6, 2018 13:50
Shell script for calculating Sec-WebSocket-Accept from Sec-WebSocket-Key
#!/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()
{
@przemoc
przemoc / 0001-BadRAM-for-v2.6.32.x.patch
Last active December 15, 2015 11:09
BadRAM for v2.6.32.x
From 5d920ec604a896cfd8419f9360f3a81adedd19eb Mon Sep 17 00:00:00 2001
From: Przemyslaw Pawelczyk <przemoc@gmail.com>
Date: Sat, 30 Jan 2010 20:57:06 +0100
Subject: [PATCH] BadRAM for v2.6.32.x
Attempt to adapt BadRAM patches to recent kernel versions. Includes
improvements and fixes(?). Were previous versions working on x86_64?
I am kernel newbie so all my below thoughts might be severly wrong.
I am not sure about correctness of x86_32 path involving highmem. It is
diff -ru memtest86+-4.00/error.c memtest86+-4.00x/error.c
--- memtest86+-4.00/error.c 2009-09-22 02:35:46.000000000 +0200
+++ memtest86+-4.00x/error.c 2010-01-30 16:15:11.000000000 +0100
@@ -256,8 +256,8 @@
clear_scroll();
v->erri.hdr_flag++;
}
- /* Do not do badram patterns from test 0 or 5 */
- if (v->test == 0 || v->test == 5) {
+ /* Do not do badram patterns from test 0 */
@przemoc
przemoc / Fix-lowercase-sample-paths-in-.sfz.patch
Created September 11, 2012 21:45
Sonatina Symphonic Orchestra 1.0 - fix lowercase sample paths in .sfz files
From 4e7de246fa2db00112abca27c58922f2003af4c5 Mon Sep 17 00:00:00 2001
From: Przemyslaw Pawelczyk <przemoc@gmail.com>
Date: Tue, 11 Sep 2012 23:40:07 +0200
Subject: [PATCH] Fix lowercase sample paths in *.sfz.
---
Brass - Bass Trombone Solo.sfz | 28 ++++-----
Brass - Horn Solo.sfz | 26 ++++----
Brass - Tenor Trombone Solo.sfz | 22 +++----
Brass - Trumpet Solo.sfz | 26 ++++----
@przemoc
przemoc / festalon-Fix-CPUID-availability-test-for-x86_64.patch
Created June 25, 2012 22:52
Patch for festalon 0.5.5 to make it compilable on amd64 (Ryan C. Underwood's one is needlessly big and breaking DRY rule). // http://projects.raphnet.net/#festalon
From: Przemyslaw Pawelczyk <przemoc@gmail.com>
Date: Sun, 8 May 2011 23:16:55 +0200
Subject: [PATCH] Fix CPUID availability test for x86_64.
Before you got following gcc/clang error in x86_64:
cputest.c: Assembler messages:
cputest.c:38: Error: suffix or operands invalid for `pop'
cputest.c:41: Error: suffix or operands invalid for `push'
cputest.c:44: Error: suffix or operands invalid for `pop'
@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();