Skip to content

Instantly share code, notes, and snippets.

View krystof-k's full-sized avatar

Kryštof Korb krystof-k

View GitHub Profile
@krystof-k
krystof-k / create_testing_calcs.py
Last active September 2, 2023 14:55 — forked from michalskop/create_testing_calcs.py
Create testing files for Slovak calculators
"""Create testing files for calcs."""
# import gspread
import os
import json
import pandas as pd
import random
import string
import math

Restricting client access to a subnet in OpenVPN on Turris

The goal is to restrict certain OpenVPN clients to the specific subnet and keeping the ReForis OpenVPN configuration interface working.

This guide assumes you have already the OpenVPN set up and working with the default configuration. We will create only one subnet, but the procedure should be easily adjusted even for multiple subnets (you would just need to shift the IP ranges and adjust subnet masks). It should also work with any other OpenVPN configurations on OpenWRT.

Note: I'm no expert and it is possible that there are some serious issues in the following. Nevertheless it is working fine so far for me. Use at your own risk.

Step by step guide

@krystof-k
krystof-k / index.html
Created February 27, 2021 18:55
CSS for paged media
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>CSS for paged media playground</title>
<style media="print">
input, button {
display: none;
}
{
"openapi": "3.0.0",
"info": {
"title": "Document Manager API",
"version": "1.0"
},
"servers": [
{
"url": "https://documentmanager.cz",
"description": "Production environment"
@krystof-k
krystof-k / regularni-vyraz-pro-nedelitelne-mezery.md
Created January 3, 2019 14:09
Regulární výraz pro nahrazení mezer za nedělitelné v těch místech, kde se podle pravopisu nemá zalamovat řádek
  1. ve spojení neslabičných předložek k, s, v, z s následujícím slovem
    (?<=[[:space:]](k|s|v|z))[[:space:]]
    
  2. ve spojení slabičných předložek o, u a spojek a, i s výrazem, který po nich následuje
    (?<=[[:space:]](o|u|a|i))[[:space:]]
    
  3. pro členění čísel, např. 2 500, 1 000 000, 25,325 23
@krystof-k
krystof-k / my-macos-setup.md
Last active March 31, 2019 17:00
Must-have apps & tricks for macOS