Skip to content

Instantly share code, notes, and snippets.

Martin Vancl tuxmartin

Block or report user

Report or block tuxmartin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tuxmartin /
Created Sep 23, 2015
Angee Kickstarter Notification
from urllib2 import Request, urlopen, URLError
from time import sleep
import subprocess
someurl = ''
old_percent= 0.0
tuxmartin /
Created Dec 4, 2015
echo "test 123" | python cs
#! /usr/bin/python
# !!! Pouze pro vyukove ucely! Na 99,9% porusuje licenci Googlu !!!
$ echo "test 123" | python cs
$ echo "test 123" | python en
tuxmartin / razeni_utf8.php
Created Dec 11, 2015
Razeni UTF-8 retezcu v PHP zacinajicich diakritickym znakem
View razeni_utf8.php
setlocale(LC_COLLATE, 'cs_CZ.utf8');
$array = array("žragsg", "chodźić", "přidać", "ágščgš", "ćehnyć", "łopjeno");
usort($array, 'strcoll');
echo "<pre>";
echo "/<pre>";
View poco_uri_parser.cpp
// g++ -o poco_uri_parser poco_uri_parser.cpp -L/usr/local/lib -lPocoNet -lPocoFoundation
#include "Poco/URI.h"
#include <iostream>
using namespace std;
int main(int argc, char** argv)
tuxmartin / irrecord list-namespace
Created Dec 21, 2015
OpenELEC - namapovani IR dalkoveho ovladani - LIRC
View irrecord list-namespace
# killall lircd
# irrecord --list-namespace
# modprobe lirc_rpi
# irrecord -d /dev/lirc0 /storage/.config/lircd.conf
View usleep.c
// gcc -std=c99 -O3 -pedantic -Werror -static -o usleep usleep.c
// ./usleep 1000000
#define _BSD_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char *argv[])
tuxmartin / dns_zaznamy
Created Dec 26, 2015
Staticky zaznam DNS ve vlastni siti
View dns_zaznamy
# /etc/unbound/dns_zaznamy
local-zone: "lan." static
local-data: "server.lan. IN A"
local-data: "pc.lan. IN A"
local-data: "*.server.lan. IN CNAME server.lan."
local-data: "*.pc.lan. IN CNAME pc.lan."
tuxmartin /
Last active Jan 6, 2016
Vytvoreni DEB balicku, APT zdroje a jejich zprava

Vytvoreni a prace s APT zdrojem

Typ zdroje

Typ trivial archive ve tvaru deb ./ je deprecated, ale nicemu to nevadi.

Dnes se maji spravne pouzivat official archive ve tvaru deb unstable main.

Vytvoreni vlastniho zdroje DEB balicku pro APT

tuxmartin / 99-ubnt.conf
Last active Jan 16, 2016
Ubiquiti - log TxRate and RxRate to syslog
View 99-ubnt.conf
# /etc/rsyslog.d/99-ubnt.conf
:msg,contains,"UBNT_RXTX " /var/log/ubnt.log
View readme.txt
vancl@vancl-pc:~/wrt/OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-$ pwd
vancl@vancl-pc:~/wrt/OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-$ ./toolchain-mips_r2_gcc-4.6-linaro_uClibc- -static-libstdc++ -o ubnt ubnt.cpp
vancl@vancl-pc:~/wrt/OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-$ ./toolchain-mips_r2_gcc-4.6-linaro_uClibc- ubnt
vancl@vancl-pc:~/wrt/OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-$ ls -lh | grep ubnt
-rwxrwxr-x 1 vancl vancl 448K led 19 20:12 ubnt
-rw-rw-r-- 1 vancl vancl 2,2K led 19 20:04 ubnt.cpp
vancl@vancl-pc:~/wrt/OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-$ file ubnt
ubnt: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), stripped
You can’t perform that action at this time.