Skip to content

Instantly share code, notes, and snippets.

View tomasfejfar's full-sized avatar
🏠
Working from home

Tomáš Fejfar tomasfejfar

🏠
Working from home
View GitHub Profile
{
"_index": "logstash-2015.04.14",
"_type": "accesslog",
"_id": "zpnGd2u2Tta2kePty2bDfA",
"_version": 1,
"_score": 1,
"_source": {
"message": "127.0.0.1 - - [14/Apr/2015:14:02:33 +0000] "GET /server-status?auto HTTP/1.1" 401 194 "-" "collectd/5.1.0"",
"@version": "1",
"@timestamp": "2015-04-14T14:55:03.684Z",
@tomasfejfar
tomasfejfar / bring-to-front.js
Created November 14, 2014 17:17
SVG bring to front
svgBringToFront = function (domElement) {
var parent = domElement.parentElement;
parent.removeChild(domElement);
parent.appendChild(domElement);
}
@tomasfejfar
tomasfejfar / gist:6da337de445d823442fa
Last active August 29, 2015 14:04
Jaký je business case pro DJ Supermarket?
  • nutně něco potřebuju, abych si mohl uvařit
    • chci si koupit kypřící prášek, vajíčka a vanilkový lusk (protože plánuju péct a nemam nakoupeno a tohle mi chybí)
    • nejvíc mě zajímá čas doručení
    • na DJS nefunguje, protože minimální obj. je 500, než řešit co všechno objednám za 500, tak si skočim do Žabky
  • nákup něčeho co se mi nechce tahat
    • zajímá mě přesnost doručení na plánovaný čas + čas (že to není třeba do druhého dne)
    • když si to takhle naplánuju, tak objednám přes oběd a chci aby mi to dorazilo večer až budu doma
    • zajímá mě sortiment (mají třeba mlíko "s uzávěrem"?)
    • méně mě zajímají malé rozdíly v ceně (~2-5kč na mléce) - kupuju abych to netahal, ne abych ušetřil
  • periodické nákupy
@tomasfejfar
tomasfejfar / diff.path
Created March 31, 2014 19:54
diff between nginx (2) and apache (1)
--- /2.txt po III 31 21:31:58 2014
+++ /1.txt po III 31 21:31:48 2014
@@ -4,13 +4,14 @@
GD Version bundled (2.1.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
-FreeType Version 2.4.10
+FreeType Version 2.4.9
+T1Lib Support enabled
GIF Read Support enabled
@tomasfejfar
tomasfejfar / gist:7909047
Created December 11, 2013 11:48
Icinga spam blacklist check config
define command {
command_name check_rbl
command_line /opt/check_rbl/check_rbl -t 60 -H $HOSTADDRESS$ \
-s dnsbl.ahbl.org \
-s cbl.abuseat.org \
-s dnsbl.cyberlogic.net \
-s bl.deadbeef.com \
-s spamtrap.drbl.drand.net \
-s spamsources.fabel.dk \
-s 0spam.fusionzero.com \
@tomasfejfar
tomasfejfar / hostname.py
Created August 22, 2013 15:29
hostname resolver
import socket
def resolve(hostname):
return socket.gethostbyname(hostname)
dataQuery = {
"query" : {
"custom_filters_score" : {
"query" : {
"match" : { "_all" : query }
},
"filters" : [
{
"filter" : { "term" : {"_type" : "ticket"} },
"boost" : 1.5
@tomasfejfar
tomasfejfar / compare.php
Created June 19, 2013 16:35
Compare two ini files with different formats. Will sort the keys and dump php arrays. Really useful for mysql/apache conf.
<?php
/**
* INI configurations compare
*
* Usage: php compare.php file1.ini file2.ini
* Result: Will export sorted arrays into *.res files to use with normal diff tool
*/
$x = parse_ini_file($argv[1],true);
$y = parse_ini_file($argv[2],true);
ksort($x);
@tomasfejfar
tomasfejfar / salt-cmd.sh
Created April 11, 2013 17:53
Useful Salt stack commands
# last job
sudo salt-run jobs.list_jobs | tac | grep -P ^'.*':$ -m 1 -B 9999 | tac
@tomasfejfar
tomasfejfar / setup-vpn.sh
Last active December 16, 2015 01:19
Fork of https://raw.github.com/cwaffles/ezpptp/master/ezpptp.sh Simple script to start PPTP VPN on debian I tried to fix to work on my virtual
#!/bin/bash
# Interactive PoPToP install script for an OpenVZ VPS
# Tested on Debian 5, 6, and Ubuntu 11.04
# April 2, 2013 v1.11
# Author: Commander Waffles
# http://www.putdispenserhere.com/pptp-debian-ubuntu-openvz-setup-script/
 
echo "######################################################"
echo "Interactive PoPToP Install Script for an OpenVZ VPS"
echo