Skip to content

Instantly share code, notes, and snippets.

View brodul's full-sized avatar

Andraz Brodnik brodul

View GitHub Profile
#! /usr/bin/env python
"""
Script that checks all uncommented domains in a nginx or apache config directory.
The domain is checked for the HTTP return code and
if the there is a DNS record for the domain.
Optionaly you can provide the ip of you server and the script will check
if the domain is hosted on your server or not.
@brodul
brodul / postne.json
Last active March 4, 2024 14:06
Postne stevilke
[{"number": 8341, "name": "Adlešiči"}, {"number": 5270, "name": "Ajdovščina"}, {"number": 6280, "name": "Ankaran/Ancarano"}, {"number": 9253, "name": "Apače"}, {"number": 8253, "name": "Artiče"}, {"number": 4275, "name": "Begunje na Gorenjskem"}, {"number": 1382, "name": "Begunje pri Cerknici"}, {"number": 9231, "name": "Beltinci"}, {"number": 2234, "name": "Benedikt"}, {"number": 2345, "name": "Bistrica ob Dravi"}, {"number": 3256, "name": "Bistrica ob Sotli"}, {"number": 8259, "name": "Bizeljsko"}, {"number": 1223, "name": "Blagovica"}, {"number": 8283, "name": "Blanca"}, {"number": 4260, "name": "Bled"}, {"number": 4273, "name": "Blejska Dobrava"}, {"number": 9265, "name": "Bodonci"}, {"number": 9222, "name": "Bogojina"}, {"number": 4263, "name": "Bohinjska Bela"}, {"number": 4264, "name": "Bohinjska Bistrica"}, {"number": 4265, "name": "Bohinjsko jezero"}, {"number": 1353, "name": "Borovnica"}, {"number": 8294, "name": "Boštanj"}, {"number": 5230, "name": "Bovec"}, {"number": 5295, "name": "Branik"}, {"nu
@brodul
brodul / index.html
Last active July 15, 2021 07:05
closures presentation
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>@brodul</title>
<link rel="stylesheet" href="dist/reset.css">
-----BEGIN PGP MESSAGE-----
hQIMA4Ey4yWmnclQARAAzBNg/7bPiex2avGPlbB0P3Dg4pU5w2Ab6yGCg3QecQk6
X3XSzFNtQ6cIIEX8aa+Kzeg1egsku41/HbfsRwbQTrp9syiFJcW0OCiPJ8x7+JUY
oLCvZ7Zn/C48Hrf+2w+OIezMdkUuUDo3ujiXHz/DOdEhUzT6X2B0zrFi7bV7rhkD
Ca9nDTkLOC87bjEXKwczlRGqvG2pOPnYou7THoydqhfMwaBzG+cxBXSSxaVH5CIF
h/qG+/3/4jE6zd6MealQq7+hsq/8w5spYulAQdqqwPizVSaj+MZj86bBId0mNs8R
UQy8o5DO8oPHuApYNqg5bpmOnrK1fcgvXNp63BdJJoLriFD3aA0KZETfRTClGqOD
D2MPy3JaDIBYOMDkErW0JraxC32TtXAUZy9ovupiRxRMdkHaUnHnviDRwStOGQtd
OHGrpSdb+GsXdQiqtVdAPr4c9VOowPJg6JZcOfIlONuyb63GRcph8lzEeHv66amD
// ==UserScript==
// @name Huble Bundle Books
// @namespace http://brodul.org
// @version 0.1
// @description Downloads books in a format from huble bundle
// @author Andraz Brodnik brodul
// @match https://www.humblebundle.com/*
// @grant GM_download
// @run-at document-idle
// ==/UserScript==
@brodul
brodul / Makefile
Created August 26, 2020 06:50
python Makefile
SHELL= bash
VENV = venv
install: requirements.txt
python3 -m venv $(VENV)
$(VENV)/bin/pip install -r requirements.txt --upgrade
clean:
rm -rf $(VENV)
@brodul
brodul / streaming.sh
Created July 25, 2012 19:39
Twitch.tv script for streaming
#! /bin/bash
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# gist created by brodul
INRES="1280x800" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution
@brodul
brodul / basic_wrapping.py
Last active January 4, 2020 11:55
concurrency in python in 2020
import urllib.request
import asyncio
loop = asyncio.get_event_loop()
loop.set_debug(True)
def get(url):
with urllib.request.urlopen(url) as f:
return f.read()
@brodul
brodul / fabfile.py
Created February 3, 2012 11:29
List files with fabric
from fabric.api import env, run, cd
env.hosts = ["localhost"]
def list_dir(dir=None):
"""docstring for list_dir"""
dir = dir or env.cwd
string = run("for i in %s*; do echo $i; done" % dir)
files = string.replace("\r","").split("\n")
return files
@brodul
brodul / streaming.sh
Created July 25, 2012 19:38
Twitch.tv script for streaming
#! /bin/bash
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# gist created by brodul
INRES="1280x800" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution