Skip to content

Instantly share code, notes, and snippets.

View jirutka's full-sized avatar
🇺🇦
Слава Україні!

Jakub Jirutka jirutka

🇺🇦
Слава Україні!
View GitHub Profile
@jirutka
jirutka / adduser.py
Created July 31, 2011 15:52
Script for creating user accounts (including LDAP)
#!/usr/bin/python
# -*- coding: utf-8 -*-
# encoding: utf-8
###############################################################################
# Copyright 2011 Jakub Jirutka. All rights reserved.
#
# "THE KOFOLA-WARE LICENSE" (Revision 1):
# Jakub Jirutka originally wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@jirutka
jirutka / make_index.py
Last active August 28, 2016 21:14
Script for creating directory A-Z index and recent items
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# encoding: utf-8
###############################################################################
# Copyright 2012 Jakub Jirutka. All rights reserved.
#
# "THE KOFOLA-WARE LICENSE" (Revision 1):
# Jakub Jirutka originally wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
@jirutka
jirutka / README.md
Created November 13, 2012 14:09
Secure SSH agent on Mac OS X
@jirutka
jirutka / ListAsSQLArrayUserType.java
Created March 3, 2013 23:09
Hibernate3 UserType for SQL ARRAY
package ome.tools.hibernate;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.sql.Array;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
@jirutka
jirutka / MOXyContextResolver.java
Created March 27, 2013 15:47
EclipseLink MOXy helpers for better handling of namespaces.
/* Copyright 2013 Jakub Jirutka. All rights reserved.
*
* "THE KOFOLA-WARE LICENSE" (Revision 1):
* Jakub Jirutka originally wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a Kofola in return. <jakub@jirutka.cz>
*/
import java.io.File;
import java.io.FileNotFoundException;
@jirutka
jirutka / keytool-import.sh
Last active January 28, 2024 03:45
Script to import key/certificate pairs into an existing Java keystore
#!/bin/bash
#
# The MIT License
#
# Copyright 2013-2015 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@jirutka
jirutka / analytics.conf
Created March 31, 2013 01:03
Add Google Analytics tracking code to HTML via nginx
#
# Add Google Analytics tracking code to HTML response
#
# Usage:
# set $tracking_id 'UA-12345678-9';
# include incl/analytics.conf;
#
# It needs nginx compiled with option --with-http_sub_module.
# Uses optimized GA code from: http://mathiasbynens.be/notes/async-analytics-snippet
#
@jirutka
jirutka / webdav_treat_osx.conf
Created April 14, 2013 00:28
Nginx optimization for WebDAV access from OS X Finder. This config snippet ensures that nginx will ignore requests for useless dot files generated by the Finder (.DS_Store, ._*, …)
#
# Ignore requests for useless dot files generated by OS X Finder (WebDAV).
#
# This little hack speeds-up a WebDAV access from the Finder significantly and
# also prevents messing storage with these annoying files.
#
location ~ \.(_.*|DS_Store|Spotlight-V100|TemporaryItems|Trashes|hidden)$ {
access_log off;
error_log off;
@jirutka
jirutka / InlineXHtmlPegdownPluginParser.java
Created September 3, 2013 21:18
Pegdown plugin that demonstrates how to “hide” any inline or block rule defined in the Pegdown Parser class.
import java.util.ArrayList;
import java.util.List;
import org.parboiled.Rule;
import org.parboiled.matchers.FirstOfMatcher;
import org.parboiled.matchers.Matcher;
import org.pegdown.Parser;
import org.pegdown.ast.InlineHtmlNode;
import org.pegdown.plugins.InlinePluginParser;