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

apt-get install python-nmap

@tuxmartin
tuxmartin / README.md
Last active Sep 21, 2019
Minimal Poco websocket C++ client
View README.md

Stazeni a kompilace POCO

wget http://pocoproject.org/releases/poco-1.7.3/poco-1.7.3.tar.gz
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
https://wiki.samba.org/index.php/Joining_a_Samba_DC_to_an_Existing_Active_Directory
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
tuxmartin / udp_ipv6_client.py
Last active Aug 31, 2019
Python UDP IPv6 client & server
View udp_ipv6_client.py
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 whois.arin.net "n google" | grep -i '^Google' | sed 's/.*)//' | tr -d ' '
2620:E7:4000::-2620:E7:4000:FFFF:FFFF:FFFF:FFFF:FFFF
2620:E7:C000::-2620:E7:C000:FFFF:FFFF:FFFF:FFFF:FFFF
108.170.192.0-108.170.255.255
108.177.0.0-108.177.127.255
142.250.0.0-142.251.255.255
172.217.0.0-172.217.255.255
172.253.0.0-172.253.255.255
173.194.0.0-173.194.255.255
192.178.0.0-192.179.255.255
@tuxmartin
tuxmartin / socket_client.py
Last active Aug 20, 2019
Python socket - server and client example (push notifications)
View socket_client.py
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'"
View alpine-qemu-arm.sh
wget http://dl-cdn.alpinelinux.org/alpine/v3.7/releases/armhf/alpine-uboot-3.7.0-armhf.tar.gz
wget http://dl-cdn.alpinelinux.org/alpine/v3.7/releases/armhf/alpine-minirootfs-3.7.0-armhf.tar.gz
qemu-img create -f raw sd.img 512M
sudo losetup /dev/loop0 sd.img
sudo kpartx -av /dev/loop0
lsblk
sudo mkfs.ext4 /dev/mapper/loop0p1
mount -t ext4 /dev/mapper/loop0p1 /mnt
@tuxmartin
tuxmartin / Test.py
Created Jun 10, 2015
Python ORM example (Python + SQLAlchemy + SQlite/MySQL)
View Test.py
from sqlalchemy.ext.declarative import declarative_base
#from sqlalchemy import *
#from sqlalchemy.orm import *
# Pro entity v podadresari. Podaresar *musi* obsahovat prazdny soubor __init__.py !
#from entity.User import User
'''
Zavislosti:
# apt-get install python-sqlalchemy
View gist:d3fd5975bccee1441a302e76faa3d874
# https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-hard.conf
# https://github.com/TrogloGeek/fail2ban-apache-sqlinject
# Test: fail2ban-regex /var/log/apache2/access.log /etc/fail2ban/filter.d/wordpress.conf
[INCLUDES]
before = common.conf
[Definition]
View nyni.php
public function checkIfSeznam():bool
{
return $this->get('utm_source') === 'www.seznam.cz' && in_array($this->get('utm_medium'), ['sekce-z-internetu', 'z-boxiku']);
}
You can’t perform that action at this time.