Skip to content

Instantly share code, notes, and snippets.

@albinoloverats
albinoloverats / compress.sh
Created August 17, 2018 17:45
compress a file/directory using the best available algorithm/application (add/delete as applicable)
#!/bin/sh
FORMATS="xz lzip lzma bzip2 gzip lzop 7z rar zip"
LEVELS=$(seq 1 9)
if test -z "$1"
then
echo "Usage: $(basename $0) <file/dir to compress> [format]"
echo "Supported formats: $FORMATS"
exit 1
@albinoloverats
albinoloverats / kernel-radeon.log
Created May 20, 2017 06:43
Kernel log from when GPU started giving up
This file has been truncated, but you can view the full file.
May 19 23:31:36 insomniac kernel: radeon 0000:07:00.0: ring 3 stalled for more than 10136msec
May 19 23:31:36 insomniac kernel: radeon 0000:07:00.0: GPU lockup (current fence id 0x00000000005baef1 last fence id 0x00000000005bafb2 on ring 3)
May 19 23:31:36 insomniac kernel: radeon 0000:07:00.0: ring 0 stalled for more than 10136msec
May 19 23:31:36 insomniac kernel: radeon 0000:07:00.0: failed to get a new IB (-35)
May 19 23:31:36 insomniac kernel: radeon 0000:07:00.0: GPU lockup (current fence id 0x000000000ae14675 last fence id 0x000000000ae1472b on ring 0)
May 19 23:31:36 insomniac kernel: radeon 0000:07:00.0: failed to get a new IB (-35)
May 19 23:31:36 insomniac kernel: [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35)
May 19 23:31:36 insomniac kernel: radeon 0000:07:00.0: failed to get a new IB (-35)
May 19 23:31:36 insomniac kernel: [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35)
May 19 23:31:36 insomniac kernel: radeon 0000:07:00.0: failed to get a new IB (-
@albinoloverats
albinoloverats / parkrun.py
Last active March 7, 2024 13:35
Get running results from Parkrun
#!/usr/bin/python
# vim: set fileencoding=utf-8 :
import sys
import requests
import re
from bs4 import BeautifulSoup
from datetime import date
from datetime import timedelta
import dateutil.parser
@albinoloverats
albinoloverats / xor.c
Last active October 1, 2017 19:23
XOR two files together
/*
* gcc -std=gnu99 -O2 -s -o otp otp.c
*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
@albinoloverats
albinoloverats / qrcurses.c
Last active August 29, 2015 14:18
Terminal based QR code generator
/*
* gcc -lqrencode -Wall -Wextra -std=c99 -O3 -o qrcurses qrcurses.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <qrencode.h>
### Keybase proof
I hereby claim:
* I am albinoloverats on github.
* I am albinoloverats (https://keybase.io/albinoloverats) on keybase.
* I have a public key whose fingerprint is F0D6 A2B6 2E82 DF21 EEE3 29F1 6D76 99D6 7588 4643
To claim this, I am signing this object: