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 /
Last active Sep 27, 2019
Python NMAP scanner - vystup v HTML tabulce

apt-get install python-nmap

tuxmartin /
Last active Sep 21, 2019
Minimal Poco websocket C++ client

Stazeni a kompilace POCO

tar xzf poco-1.7.3.tar.gz
cd poco-1.7.3
./configure --minimal --static --no-samples --no-tests
time make -j4 -s
cd lib/Linux/x86_64/
for f in *.a; do "strip $f"; done
View gist:d86880b14ef882f447b9b9bcf4d4a764
yum install perl gcc libacl-devel libblkid-devel gnutls-devel readline-devel python-devel gdb pkgconfig krb5-workstation zlib-devel setroubleshoot-server libaio-devel setroubleshoot-plugins policycoreutils-python libsemanage-python setools-libs-python setools-libs popt-devel libpcap-devel sqlite-devel libidn-devel libxml2-devel libacl-devel libsepol-devel libattr-devel keyutils-libs-devel
cyrus-sasl-devel cups-devel bind-utils libxslt docbook-style-xsl openldap-devel pam-devel bzip2 vim wget openldap-devel openldap-clients nss-pam-ldapd pam-devel net-tools
./configure --enable-debug --enable-selftest --with-ads --with-systemd --with-winbind
make -j
make install
cat /etc/systemd/system/samba.service
tuxmartin /
Last active Aug 31, 2019
Python UDP IPv6 client & server
import socket
UDP_IP = "::1" # localhost
UDP_PORT = 5005
MESSAGE = "Hello, World!"
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", MESSAGE
View all_google-ips.txt
martin@martin:~$ whois -h "n google" | grep -i '^Google' | sed 's/.*)//' | tr -d ' '
tuxmartin /
Last active Aug 20, 2019
Python socket - server and client example (push notifications)
import socket
host = 'localhost'
port = 1234
buf = 1024
clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect((host, port))
print "Sending 'test1\\n'"
qemu-img create -f raw sd.img 512M
sudo losetup /dev/loop0 sd.img
sudo kpartx -av /dev/loop0
sudo mkfs.ext4 /dev/mapper/loop0p1
mount -t ext4 /dev/mapper/loop0p1 /mnt
tuxmartin /
Created Jun 10, 2015
Python ORM example (Python + SQLAlchemy + SQlite/MySQL)
from sqlalchemy.ext.declarative import declarative_base
#from sqlalchemy import *
#from sqlalchemy.orm import *
# Pro entity v podadresari. Podaresar *musi* obsahovat prazdny soubor !
#from entity.User import User
# apt-get install python-sqlalchemy
View gist:d3fd5975bccee1441a302e76faa3d874
# Test: fail2ban-regex /var/log/apache2/access.log /etc/fail2ban/filter.d/wordpress.conf
before = common.conf
View nyni.php
public function checkIfSeznam():bool
return $this->get('utm_source') === '' && in_array($this->get('utm_medium'), ['sekce-z-internetu', 'z-boxiku']);
You can’t perform that action at this time.