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 / 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])}' \
#include <stdio.h>
#include <stdlib.h>
#define NUMBER 12345678901234567890
#define _Q(n) #n
#define Q(n) _Q(n)
#define ATOL(n) atol(Q(n))
#define SSCANF(n) ({ long val = 0; sscanf(Q(n), "%ld", &val); val; })
@przemoc
przemoc / p7zip-pwd-from-stdin.patch
Created January 10, 2011 00:34
Awful p7zip hack for reading passwords from stdin. Compatible w/ 9.04 and 9.13.
--- p7zip_9.04.orig/CPP/7zip/UI/Console/Main.cpp 2009-06-27 16:18:14.000000000 +0200
+++ p7zip_9.04/CPP/7zip/UI/Console/Main.cpp 2011-01-10 01:25:36.000000000 +0100
@@ -48,6 +48,10 @@
#include "myPrivate.h"
#include "Windows/System.h"
+#include <iostream>
+
+#define MAX_PWD_SIZE_FROM_STDIN 1024
+
@przemoc
przemoc / gist:1105621
Created July 26, 2011 00:30
Blondie - Call me (Original 12 Mix) lyrics
Blondie - Call me (Original 12 Mix)
===================================
Colour me your colour baby, colour me your car
Colour me your colour darling, I know who you are
Come up off your colour chart
I know where you're coming from
Call me (call me) on the line
Call me, call me any, any time
@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 / 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 ++++----
@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