Skip to content

Instantly share code, notes, and snippets.

View igneus's full-sized avatar

Jakub Pavlík igneus

View GitHub Profile
import unittest
import time
import os
_COLOR = {'green': "\x1b[32;01m",
'red': "\x1b[31;01m",
'reset': "\x1b[0m"
}
def red_str(text):
@igneus
igneus / petynka.rb
Last active August 29, 2015 14:05
Koupaliště Petynka - teplota vzduchu, vody a počet návštěvníků bez otvírání webového prohlížeče
#!/usr/bin/env ruby
# 2015-05-09
#
# prints information from the Koupaliste Petynka's website
require 'mechanize' # interaction with websites
page = Mechanize.new.get('http://www.koupalistepetynka.cz/')
@igneus
igneus / json getter
Created March 27, 2015 15:13
if you have a lot of json files with the same structure and need some piece from all of them ...
#!/usr/bin/python
# jsongetter.py
#
# reads json file/s,
# gets a part specified in a Python dict/list notation,
# prints formatted contents
#
# $ jsongetter.py <keys> [file1 file2 ...]
#
@igneus
igneus / xmpl.json
Created August 4, 2015 09:01
geojson example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@igneus
igneus / pizzeria-manna-find-vegetarian.py
Last active December 13, 2015 22:59
My daily task - find some meatless meal in the daily menu of a local pizzeria - automated
# encoding: utf-8
from __future__ import unicode_literals
import sys, re
from bs4 import BeautifulSoup
import requests
from termcolor import colored
MENU_URL = 'http://www.pizzeria-manna.cz/index.asp?id=dennimenu'
@igneus
igneus / opraem_bohemia_1934.gly
Created December 15, 2015 18:45
Antiphonal proper for Bohemian Premonstratensian houses - chants only, transcribed from a 1934 Premonstratensian antiphonal
\header
title: Supplementum Antiphonarii pro eclesiis Montis Sion, Siloensi et Neorisensi
% Die 4. Martii
% Translatio S. Wenceslai Martyris
\score
office-part: antiphona ad Magnificat
mode: 1
annotation: Ad Magnif.
@igneus
igneus / collect_countries.rb
Created May 30, 2016 14:28
Country names harvested from the "countries" Ruby gem (https://github.com/hexorx/countries)
require 'countries'
require 'json'
require 'active_support'
require 'sort_alphabetical'
lang = ARGV[0] || 'cs'
data = ISO3166::Country
.all
.collect {|c| {name: c.translations[lang], code: c.alpha2} }
@igneus
igneus / seznam_searches.rb
Last active July 3, 2016 14:13
Analyze incoming traffic from seznam.cz search in your Apache access log
# script analyzing incoming traffic from seznam.cz search
# in Apache access log
# Seznam search is "kind enough" to preserve the query in referer
# typical usage:
# grep search.seznam.cz access.log | seznam_searches.rb
#
# grepping the log isn't really necessary, it just spares the script
# parsing each line and makes it work only with the interesting
@igneus
igneus / Gemfile
Created July 19, 2016 20:17
rest-client 1.6 isn't compatible with mime-types 3
source 'https://rubygems.org'
gem 'rest-client', '1.6.7'
gem 'mime-types', '3.1'
@igneus
igneus / webconsole_exploit_honeypot.rb
Created July 22, 2016 16:38
Safely watch an example exploit of a known Rails webconsole vulnerability
# having read
# https://benmmurphy.github.io/blog/2016/07/11/rails-webconsole-dns-rebinding/
# I wanted to see what http://www.dnsrebinder.net/ would execute
# if I had an app with Rails webconsole running on localhost:3000
# Usage:
# * run this application
# * visit http://www.dnsrebinder.net/
# * watch console