Skip to content

Instantly share code, notes, and snippets.

@DusanMadar
DusanMadar / cors-origin-header.md
Last active July 11, 2022 19:15
tl;dr CORS and Origin header

A brief summary of CORS and the Origin header

Latest revision: 2022-07-11.

This simple gist sheds a bit of light on CORS and indicating an HTTP request origin. Should be easy to trick the server by setting Origin header, right? Not really.

tl;dr

CORS is a browser mechanism build around the forbidden Origin request header. That means the browser/user agent is in charge of telling the server where the request originates from. Setting the header manually/with code has no effect.

Založenie voľnej živnosti v ČR

Aktuálne k 17.11.2019

Budeš potrebovať

  • výpis z registra trestov -> ziskaš za 100 czk z CzechPoint (obsahuje slovenský aj český výpis)
  • sídlo živnosti
    • zriadiť virtuálne sídlo v prípade, že nemôžeš mať sídlo v mieste bydliska (napr. to nedovoľuje nájomná zmluva, atď.)
  • doklad totožnosti (občiansky preukaz alebo pas)
  • minimálne 1000 czk za ohlásenie žvnosti
  • doklad o zaplatení správneho poplatku
@DusanMadar
DusanMadar / prepare-commit-msg
Last active September 7, 2018 11:06
Git hook to auto prefix commit message with story/feature ID/name.
#!/usr/bin/env python
"""
Copy-paste this to `.git/hooks/prepare-commit-msg` and make the file executable.
Then just write your commit message as `git commit -m "message"`.
"""
from subprocess import check_output
import sys
@DusanMadar
DusanMadar / TorPrivoxyPython.md
Last active May 16, 2024 08:35
A step-by-step guide how to use Python with Tor and Privoxy

A step-by-step guide how to use Python with Tor and Privoxy

Latest revision: 2021-12-05.

Tested on Ubuntu 18.04 Docker container. The Dockerfile is a single line FROM ubuntu:18.04. Alternatively, you can simply run docker run -it ubuntu:18.04 bash.

NOTE: stopping services didn't work for me for some reason. That's why there is kill $(pidof <service name>) after each failed service <service name> stop to kill it.

References

@DusanMadar
DusanMadar / TorNoAuth.md
Last active April 17, 2024 18:59
A step-by-step guide how to use Tor without Authentication
@DusanMadar
DusanMadar / Spatially enable a SQLite database
Last active August 26, 2023 12:40
Spatially enable a SQLite database
# 0. enter the SQLite CLI interface
dm295@ubuntu:~$ sqlite3
# 1. load the spatial extension
sqlite> .load /usr/local/lib/mod_spatialite.so sqlite3_modspatialite_init
# 2. open the target database
sqlite> .open '/tmp/geocoding_cache.db';
# 3. turn off the synchronous pragma for performance