Skip to content

Instantly share code, notes, and snippets.

@powerswitch
powerswitch / docchoose.diff
Created June 19, 2012 15:11
Document Chooser Patch for Cournal
diff -pruN cournal/cournal/documentchooserdialog.py cournal-simon-workspace/cournal/documentchooserdialog.py
--- cournal/cournal/documentchooserdialog.py 1970-01-01 01:00:00.000000000 +0100
+++ cournal-simon-workspace/cournal/documentchooserdialog.py 2012-06-19 16:28:52.351488468 +0200
@@ -0,0 +1,86 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# This file is part of Cournal.
+# Copyright (C) 2012 Simon Vetter
+#
@powerswitch
powerswitch / vgaberg.bas
Created July 10, 2012 17:00
Bergsteigersimulator
RANDOMIZE TIMER
CLS
SCREEN 13
FOR y = 200 TO 10 STEP -1
x = x + FIX(RND * 4)
IF x > 160 THEN EXIT FOR
LINE (x, y)-(320 - x, y), 8
NEXT
FOR y = 200 TO 10 STEP -1
FOR x = 1 TO 320
@powerswitch
powerswitch / extract.sh
Created October 24, 2012 15:29
Extracts all *.zip files in the directory even with wide-chars in it
#!/bin/bash
mkdir "zip"
for f in *.zip
do
if unzip -q -u -d "${f%.zip}" "$f" ; then
mv "$f" "zip/$f"
else
a=true
#!/bin/bash
# rotate the screen depending on notebook position
# need: xrotate script, thinkpad_acpi, tp_smapi
export DISPLAY=":0"
DISPLAY=:0
x=$(sed "s_(\([-0-9]\+\),.*)_\1_" /sys/devices/platform/hdaps/position)
y=$(sed "s_(.*,\([-0-9]\+\))_\1_" /sys/devices/platform/hdaps/position)
tablet=$(cat /sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode)
@powerswitch
powerswitch / xrotate
Created November 12, 2013 16:25
/usr/bin/xrotate rotate X-Screen and Wacom
#!/bin/bash
echo "xrotate screen"
output=LVDS1
if [ "$XROT_OUTPUT" ]
then
output=$XROT_OUTPUT;
fi
geomnbr=0
@powerswitch
powerswitch / 03-Penslot
Created November 12, 2013 16:27
/etc/acpi/events/03-Penslot rotate screen if pen is removed
event=ibm/hotkey IBM0068:00 00000080 0000500c
action=/etc/acpi/actions/03-Penslot.sh
.Xmm_ccw
keycode 113 = Up NoSymbol Up
keycode 116 = Left NoSymbol Left
keycode 111 = Right NoSymbol Right
keycode 114 = Down NoSymbol Down
.Xmm_cw
keycode 114 = Up NoSymbol Up
keycode 111 = Left NoSymbol Left
keycode 116 = Right NoSymbol Right
@powerswitch
powerswitch / hotkey.sh
Last active December 28, 2015 03:19
Bring the Thinkpad X60t hot keys back to life after kernel update killed them
echo 0xffffff > /sys/devices/platform/thinkpad_acpi/hotkey_mask #creates kernel warning
setkeycodes 71 103
setkeycodes 6e 105
setkeycodes 6d 106
setkeycodes 6f 108
setkeycodes 69 28
setkeycodes 6b 1
setkeycodes 6c 112
@powerswitch
powerswitch / 2b.asm
Created December 4, 2013 16:52
Assembler-Code für Intervallschachtelung des Temperatursensors
#! mrasm ; Kennung für den Assembler
.ORG 0 ; Adresse auf Null setzen
LD SP,0xF0 ; Stackpointer setzen
; *********************
; * Hauptprogramm zum Testen des Unterprogrammes
; *********************
MAINLOOP:
CALL TEMPERATURE ; Unterprogramm aufrufen
ST (0xFF),R0 ; R0 auf Output-Register schreiben
@powerswitch
powerswitch / v2c.asm
Created December 4, 2013 16:53
Assembler-Code für Temperaturabhängige Lüftersteuerung
#! mrasm ; Kennung für den Assembler
.ORG 0 ; Adresse auf Null setzen
LD SP,0xF0 ; Stackpointer setzen
; *********************
; * Hauptprogramm zur Lüftersteuerung
; *********************
MAINLOOP:
CALL TEMPERATURE ; Unterprogramm aufrufen
ST (0xFF),R0 ; R0 auf Output-Register schreiben