Skip to content

Instantly share code, notes, and snippets.

View lenada's full-sized avatar

Leander Roters lenada

View GitHub Profile
# basic pfctl control
# ==
# Related: http://www.OpenBSD.org
# Last update: Tue Dec 28, 2004
# ==
# Note:
# this document is only provided as a basic overview
# for some common pfctl commands and is by no means
# a replacement for the pfctl and pf manual pages.
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Event",
"name" : "Typhoon with Radiation City",
"startDate" : "2013-09-14T21:30",
"location" : {
"@type" : "Place",
"sameAs" : "http://www.hi-dive.com",
"name" : "The Hi-Dive",
@lenada
lenada / gist:f36ccc69badab0db16f73a5f4300acdc
Created October 19, 2016 13:00
Elasticsearch: replace long hostnames with short ones (ELK/Logstash)
curl -XPOST 'localhost:9200/logstash*/_update_by_query?conflicts=proceed&pretty' -d'
{
"script": {
"inline": "if(ctx._source.host instanceof String) {ctx._source.host = ctx._source.host.replace( \".domain.com\", \"\" )} else if (ctx._source.host instanceof ArrayList) { ctx._source.host = ctx._source.host[0] }"
},
"query": {
"match": {
"host": {
"query": "*.domain.com",
"type": "phrase"

Keybase proof

I hereby claim:

  • I am lenada on github.
  • I am lenada (https://keybase.io/lenada) on keybase.
  • I have a public key ASBIaUtVN87EczGI78X6xCRpnrZ0aym2177JE0W3CNvRywo

To claim this, I am signing this object:

@lenada
lenada / Guardfile
Created April 17, 2013 01:08
Guardfile for php-tricorder `guard -G ThisGuardfile`
# A hackish inline Guardfile for php-tricorder
# More info at https://github.com/guard/guard#readme
# https://github.com/chartjes/php-tricorder/#readme
# watching certain files in a directory, the tricorder 'fires' on change
# running php-tricorder continously is probably not that useful
# still using this file as a Guardfile `guard -G ThisGuardfile`
# is a shortcut to easily run tricorder and get hints for testing approaches instantly
@lenada
lenada / gist:5336736
Last active December 15, 2015 22:59 — forked from gusano/gist:5336265
delete merged git branches
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
@lenada
lenada / gist:4012862
Created November 4, 2012 18:21
Installing OwnCloud on FreeNAS 8.3

FreeNAS "plugin" OwnCloud

see http://doc.freenas.org/index.php/Plugins get pluginjail running

create a folder / zfs filesystem on a device with sufficient storage space. mount_nullfs created directory to /plugin-jail-path/usr/ports

portsnap fetch portsnap extract

@lenada
lenada / Guardfile
Created October 26, 2012 14:50
PHPCodeSniffer inline Guard
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
require 'guard/guard'
module ::Guard
class Phpcs < Guard
def run_on_change(paths)
puts phpcs_command(paths)
@lenada
lenada / gist:3034651
Created July 2, 2012 18:08
sample websolr update request
curl http://hostname/solr/xxxxxxxxxxx/update -H "Content-Type: text/xml" --data-binary '<add allowDups="false" overwritePending="true" overwriteCommitted="true"><doc><field name="id">easybib_4562eb2ace54c7e846baca223705eff8</field><field name="source">journal</field><field name="json">{"_id":"4562eb2ace54c7e846baca223705eff8","_rev":"1-3133123208","source":"journal","pubtype":{"main":"pubjournal","suffix":"pubdatabase"},"pubjournal":{"nonconsecutive":"","end":"61","start":"61","title":"Time Canada","issue":"16","restarts":"","series":"","seriesnumber":"","volume":"162","year":"2003"},"journal":{"title":"This is Your Brain on Rejection"},"pubdatabase":{"dayaccessed":"30","monthaccessed":"october","yearaccessed":"2006","city":"","db":"EBSCOhost","library":"","searchtext":"","searchtype":"","service":""},"reference_number":"200612141352101165","contributors":[{"function":"author","first":"Mark","middle":"R","last":"Leary"}],"annotation":[]}</field><field name="datasource">easybib</field><field name="source_boost
@lenada
lenada / gist:2400099
Created April 16, 2012 17:26
Booktype DeprecationWarnings
$ django-admin.py runserver
/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/db/__init__.py:19: DeprecationWarning: settings.DATABASE_* is deprecated; use settings.DATABASES instead.
DeprecationWarning
/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/db/__init__.py:60: DeprecationWarning: Short names for ENGINE in database configurations are deprecated. Prepend default.ENGINE with 'django.db.backends.'
DeprecationWarning
/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/db/__init__.py:19: DeprecationWarning: settings.DATABASE_* is deprecated; use settings.DATABASES instead.
DeprecationWarning
/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/db/__init__.py:60: DeprecationWarning: Short names for ENGINE in database configurations are deprecated. Prepend default.ENGINE with 'django.db.backends.'
DeprecationWarning