Skip to content

Instantly share code, notes, and snippets.

@karnauskas
karnauskas / pf.conf
Created November 7, 2019 16:09 — forked from ottodevs/pf.conf
Trustin's /etc/pf.conf for Mac OS X
# 1. Put this file to /etc/pf.conf
# 2. Install init boot scripts using IceFloor then - http://www.hanynet.com/icefloor/
# I tried to use IceFloor to configure everything but it didn't work very well.
# 3. Once done, you can confirm the rules were loaded with 'sudo pfctl -sr'
# 4. At System Preferences -> Security -> Firewall -> Firewall Options,
# check 'Block all incoming connections' to prevent annoying per-app dialogs.
set skip on lo0
set block-policy drop
@karnauskas
karnauskas / .mongorc.js
Created October 2, 2019 00:17 — forked from sawanoboly/.mongorc.js
Sample .mongorc.js for replicaSets.
prompt = function() {
// set version
version = db.version();
// case mongos
if (rs.status().info == 'mongos') {
return rs.status().info + ':[' + version + '] > ';
}
// config or replica
@karnauskas
karnauskas / workflow.gdsl
Created September 25, 2019 21:07 — forked from gclayburg/workflow.gdsl
Jenkins workflow plugin groovy code completion support for IntelliJ IDE
/*
Author: Gary Clayburg
This file allows IntelliJ IDEA to perform basic syntax checking and code completion for
Jenkins workflow groovy scripts. https://github.com/jenkinsci/workflow-plugin
These methods are supported
sh
readFile
node
echo
@karnauskas
karnauskas / ciSeedJob.groovy
Created August 16, 2019 07:13 — forked from marcelbirkner/ciSeedJob.groovy
Jenkins Job DSL Seed Job for Continuous Integration Jobs
import groovy.sql.Sql
import java.util.Date
import java.text.SimpleDateFormat
/*
* THIS IS AN EXAMPLE SNIPPET. FOR MORE DETAILS SEE THE FOLLOWING BLOG ARTICLE:
* https://blog.codecentric.de/en/?p=30502
*
* This Jenkins Job DSL Groovy Script creates Continuous Integration (CI) Jobs
* for all Maven & Ant projects that exist on a GitLab Server.
@karnauskas
karnauskas / recipe.rb
Created August 14, 2019 01:36 — forked from davewongillies/recipe.rb
Package Go tools with fpm-cookery (automatically uses godep dependencies if present)
class ChefRunner < FPM::Cookery::Recipe
GOPACKAGE = "github.com/mlafeldt/chef-runner"
name "chef-runner"
version "0.8.0"
revision 1
source "https://#{GOPACKAGE}/archive/v#{version}.tar.gz"
sha256 "a7de23f989f8353ecf838b551a8ceff09b83c8aeff2553b2c31d57615f8fcc53"
description "The fastest way to run Chef cookbooks"
@karnauskas
karnauskas / ansible_variable_precedence.md
Created July 18, 2019 09:31 — forked from ekreutz/ansible_variable_precedence.md
Ansible variable precedence (order, hierarchy)
@karnauskas
karnauskas / proxy.py
Created March 9, 2019 23:50 — forked from bxt/proxy.py
A very basic caching python HTTP proxy server.
# Originally from http://sharebear.co.uk/blog/2009/09/17/very-simple-python-caching-proxy/
#
# Usage:
# A call to http://localhost:80000/example.com/foo.html will cache the file
# at http://example.com/foo.html on disc and not redownload it again.
# To clear the cache simply do a `rm *.cached`. To stop the server simply
# send SIGINT (Ctrl-C). It does not handle any headers or post data.
import BaseHTTPServer
import hashlib
@karnauskas
karnauskas / FindMYSQL.cmake
Created October 23, 2018 00:06 — forked from RenatoUtsch/FindMYSQL.cmake
Find MySQL with CMake.
# - Try to find MySQL.
# Once done this will define:
# MYSQL_FOUND - If false, do not try to use MySQL.
# MYSQL_INCLUDE_DIRS - Where to find mysql.h, etc.
# MYSQL_LIBRARIES - The libraries to link against.
# MYSQL_VERSION_STRING - Version in a string of MySQL.
#
# Created by RenatoUtsch based on eAthena implementation.
#
# Please note that this module only supports Windows and Linux officially, but
@karnauskas
karnauskas / mysql-server.init-patch
Created October 9, 2018 15:43 — forked from utdrmac/mysql-server.init-patch
MySQL 5.7 Keyring Decryption Snipplet
# Encrypt initially using
# openssl rand -base64 32 >/etc/ssl/private/mykey.bin && chmod 600 /etc/ssl/private/mykey.bin
# openssl aes-256-cbc -a -salt -in /usr/local/mysql/keyring -out /usr/local/mysql/keyring.asc -pass file:/etc/ssl/private/mykey.bin
echo $echo_n "Decrypting Keyring..."
rm -f /usr/local/mysql/keyring
if [ ! -e /usr/local/mysql/keyring.asc -o ! -e /etc/ssl/private/mykey.bin ]
then
echo "Encrypted keyring and/or keyfile not found. Aborting MySQL startup."
exit 1;
fi
@karnauskas
karnauskas / Lithuanian stop words
Created June 14, 2018 18:38 — forked from revelt/Lithuanian stop words
Here are deduped, checked and sorted stop words for Lithuanian language. Use them in all search/indexing applications, for example Lunr.js
a
abi
abidvi
abiejose
abiejų
abiejuose
abiem
abipus
abu
abudu