Skip to content

Instantly share code, notes, and snippets.

View vasekch's full-sized avatar

Vašek Chalupníček vasekch

  • dtlab
  • Prague, Czech Republic
View GitHub Profile
@vasekch
vasekch / docker-compose.yml
Last active April 6, 2025 13:04
Minecraft server docker traefik configuration labels - pass TCP along with HTTP and HTTPS
services:
web:
image: ...
volumes:
...
labels:
- "traefik.enable=true"
# to enforce http port over tcp
- "traefik.http.services.web-minecraft.loadbalancer.server.port=80"
- "traefik.http.services.web-minecraft.loadbalancer.passhostheader=true"
@vasekch
vasekch / druhy.py
Created May 10, 2019 09:15
PyLadies jaro 2019 NTK - Tridy I. - Kotatka
'''
Pouzijeme tridu kotatko z modulu (souboru) zviratka.py
'''
from zviratka import Kotatko
k1 = Kotatko("Micka")
k1.uber_zivot()
k2 = Kotatko("Mourek")
k1.uber_zivot()
k2.snez("granulky")
@vasekch
vasekch / airbnb.py
Created May 10, 2019 09:12
PyLadies jaro 2019 NTK - opakovaci cviceni
'''
Zadani: udelej CLI (command line interface) pro Airbnb
Analyza:
- user - guest: book, manage bookings, pay, chat
- user - host: accept, manage rooms, chat
- user - anonym: sign in, sign up, forgotten password
Navrh:
Zkusime si naimplementovat use case prihlasit - sign in
1. Uzivatel pusti v terminalu program airbnb.py
2. opakuj
@vasekch
vasekch / kytka.py
Created October 3, 2018 22:27
PyLadies - Kresleni kyticky
from turtle import forward, left, right, exitonclick, circle
def kvet(velikost=100, pocet_listku=10):
for k in range(pocet_listku):
for i in range(4):
forward(velikost)
left(90)
left(360 / pocet_listku)
@vasekch
vasekch / gist:8e71a93a16881415e5afbd20c6331163
Created July 23, 2017 23:26
Ubuntu 16.04 Mikrotik L2TP VPN settings
Install l2tp support
sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp
sudo apt-get update
sudo apt-get install network-manager-l2tp
sudo apt-get install network-manager-l2tp-gnome
https://askubuntu.com/a/898086
@vasekch
vasekch / systemd_commands
Created March 21, 2017 15:13
Useful systemd commands
List all
# systemctl list-unit-files
Dependency for a service
# systemctl list-dependencies httpd.service
@vasekch
vasekch / config
Last active March 16, 2017 12:36
ssh config to virtualbox with unknown ip - find out from guest properies
# can not use HostName because ip is dynamic
# target machine is vm in virtual box and has bridged interface to the network
# this is useful when you run vm that shall be accessible the same way as host
# machine is and you can not have statically assigned ip from dhcp
# edit: following comment is outdated
# prerequisity is to have `socat` and `arp-scan` commands available (installed)
# also need of providing password for sudo may be avoided by setting sudoers
# with proper NOPASSWD directive
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.common.by import By
from selenium.common.exceptions import *
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
binary = FirefoxBinary(r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe')
browser = webdriver.Firefox(firefox_binary=binary)
#browser = webdriver.Firefox()
@vasekch
vasekch / smb.conf
Created April 7, 2016 22:40
Simple samba config for Bananian
[global]
workgroup = workgroup
security = share
share modes = yes
# [homes]
# comment = Home Directories
# browsable = no
# read only = no
@vasekch
vasekch / .tmux.conf
Last active January 1, 2017 21:33
tmux HOWTO long history, mouse scroll, focus pane on click, preload windows and panes on start
# -------------------------------------------------------------------------------------
# This config will set up tmux default startup screens.
#
# Filename ~/.tmux.conf
#
# You should uncomment and change following items to fit your needs:
# - session name
# - window names (monitoring, nodejs, django, root console)
# - design number and sizes of split screens (run project, watch files, tail files, etc.)
# - preexecuted commands (grunt, gulp, management commands, htop, iftop, watch, tree, etc.)