Skip to content

Instantly share code, notes, and snippets.

View klaxa's full-sized avatar

klaxa

  • Germany
View GitHub Profile
#!/usr/bin/python
import sys
if len(sys.argv) < 2:
print("Specify input file.")
sys.exit(1)
INPUT = sys.argv[1]
General
Unique ID : 54473042442071591303272632370512604571 (0x28FB205922CBDA7B80150A7B18692D9B)
Complete name : matchday.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 3.33 GiB
Duration : 5h 43mn
Overall bit rate : 1 388 Kbps
Writing application : Lavf55.22.100
Writing library : Lavf55.22.100
[root@localhost klaxa]# smartctl --all /dev/sda
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.6-1-ARCH] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Toshiba 2.5" HDD MK..55GSX
Device Model: TOSHIBA MK5055GSX
Serial Number: X958F7GES
LU WWN Device Id: 5 000039 216b00e0c
Firmware Version: FG001A
Mangatrader Downloader (Centralized)
CTRL+C to end at any time
Traceback (most recent call last):
File "dlc.py", line 157, in <module>
url_request = (base64.b64decode("aHR0cDovLzE0Ni4xODUuMTM3LjE5NS9tdC9Eb3dubG9hZFJhbmRvbVNlcmllcw==")).decode("utf-8");
File "/usr/lib/python3.2/base64.py", line 83, in b64decode
raise TypeError("expected bytes, not %s" % s.__class__.__name__)
TypeError: expected bytes, not str
@klaxa
klaxa / extractFonts.bash
Created June 22, 2014 21:07
Extracts fonts from mkv files
DEBUG=0
while read line; do
mkvinfo "$line" > currentmkvinfo.info
currentFontName=""
currentFontDigit=1
while read info; do
currentLine=`echo $info | sed 's/|//g' | sed 's/+//g'`
currentLineText=`echo $currentLine | sed 's/[0-9]//g'`
currentLineDigit=`echo $currentLine | sed 's/[a-z]//g' | sed 's/[A-Z]//g' | sed 's/://g'`
if [ "$DEBUG" -gt "1" ]
[klaxa@localhost Development]$ cat cassy_tiles.c
#include <stdio.h>
int main() {
for(int x = 0; x < 800; x+=256) { for (int y = 0; y < 480; y+=256) { printf("%dx%d\n", x, y); } }
}
[klaxa@localhost Development]$ gcc cassy_tiles.c -std=c99 -o cassy_tiles
[klaxa@localhost Development]$ ./cassy_tiles
0x0
0x256
#!/bin/bash
if [[ "$(whoami)" != "root" ]]
then
echo "Start as root, fag"
exit 1
fi
echo -n "Starting in 3..."
sleep 1
#!/bin/bash
ping -c 1 -W 2 8.8.8.8 2> /dev/null > /dev/null
ret=$?
if [[ "$ret" -ne "0" ]]
then
#echo \'<span color=\"red\">Offline</span> \'
echo " Offline "
else
#echo \'<span color=\"green\">Online</span> \'
[clickme]
full_text=Click me
command=echo hello $BLOCK_BUTTON
min_width=button=1 x=1280 y=800
align=left
[clickme2]
full_text=Click me!
command=notify-send "Button $BLOCK_BUTTON ($BLOCK_X, $BLOCK_Y)"
@klaxa
klaxa / frame2ts
Created January 1, 2015 23:52
Converts from frames to timestamps for 24 fps
def frame2ts(self, ts):
new_ts = ts / 24
new_ts_str = time.strftime('%H:%M:%S', time.gmtime(int(new_ts)))[1:]
ms = new_ts % 1
ms = Decimal(ms).quantize(Decimal('.01'), rounding=ROUND_DOWN)
new_ts_str += str(ms)[1:]
return new_ts_str