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 / tmux-vm.sh
Last active February 6, 2018 13:54
Set up log/debug Linux kernel session w/ QEMU in tmux
#!/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 / rc.lua
Created February 2, 2012 23:40
My trashy awesome/rc.lua file.
-- Standard awesome library
require("awful")
require("awful.autofocus")
require("awful.rules")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
-- Load Debian menu entries
@przemoc
przemoc / almost-endless-history.sh
Created February 2, 2012 23:47
How not to lose your BASH history (and make it more compact)
# Add following lines to:
# - /etc/bash.bashrc
# - /etc/profile
export HISTSIZE=1000000
export HISTFILESIZE=$HISTSIZE
export HISTCONTROL=ignoredups
@przemoc
przemoc / tmux-Stop-searching-forward-at-the-end-of-the-buffer.patch
Created February 18, 2012 23:05
Patch for tmux 1.6: Stop searching forward at the end of the buffer.
From 6bccc3fc7362967ea7d4c296a22793f7f3a2c6d8 Mon Sep 17 00:00:00 2001
From: Przemyslaw Pawelczyk <przemoc@gmail.com>
Date: Sat, 18 Feb 2012 23:51:38 +0100
Subject: [PATCH] Stop searching forward at the end of the buffer.
Requested-by: Jacobo de Vera <devel@jacobodevera.com>
---
window-copy.c | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
@przemoc
przemoc / FREEBSD-VM-URLS
Last active December 13, 2015 14:42
FreeBSD VirtualBox/VMware Images
# FreeBSD 7.1
http://virtualboxes.org/images/freebsd/
# FreeBSD 9.0 -- pre-prepared VM image for Google Code-In
http://wiki.freebsd.org/GoogleCodeIn/GettingStarted
# FreeBSD 10.1, 10.2
http://www.osboxes.org/freebsd/
# FreeBSD STABLE, CURRENT snapshot -- pre-installed VM images
@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>
@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 / 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 / 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 ++++----
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 */