Skip to content

Instantly share code, notes, and snippets.

View VerosK's full-sized avatar
🚌
On the road.

Věroš Kaplan VerosK

🚌
On the road.
View GitHub Profile
class Writer:
def __init__(self, fname):
self.f = open(fname, 'wt')
print("__init__")
def put(self, ln):
print("put")
self.f.write("Hello, world!")
@VerosK
VerosK / solr-filter.conf
Created November 30, 2018 12:07 — forked from sebnmuller/solr-filter.conf
Logstash config for ingesting Solr logs
input {
file {
path => "/Users/sebastienmuller/comperio/projects/sintef/tmp/logs/indexing_logs_2/solr.log.3"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
# Extract event severity and timestamp
@VerosK
VerosK / riot-matrix-workshop.md
Created November 2, 2018 09:06 — forked from attacus/riot-matrix-workshop.md
Create your own encrypted chat server with Riot and Matrix

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

The goal of this workshop is to teach you how to configure and run your own Matrix/Riot service. By the end of the workshop, you should be able to log into secure chat rooms and invite others to the same server.

@VerosK
VerosK / logstash_prune_window.rb
Created September 29, 2018 22:55
Ruby filter to prune Windows logs fields
# use EventAPI
# https://www.elastic.co/guide/en/logstash/current/event-api.html
# the value of `params` is the value of the hash passed to `script_params`
# in the logstash configuration
def register(params)
# @drop_percentage = params["percentage"]
@subfield = "windows"
keep_fields = [
"Hostname", "Keywords", "EventType", "SeverityValue",
"Severity", "EventID", "SourceName", "Task", "RecordNumber",
@VerosK
VerosK / 02-add-uuid.conf
Created July 27, 2018 12:41
Logstash - add 20 byte random string
filter {
ruby {
code => 'event.set("_uuid", rand(36**20).to_s(36))'
}
}
@VerosK
VerosK / sorted.yml
Created July 23, 2018 16:16
Sort dict in Ansible
- hosts: localhost
vars:
images:
- name: first
date: 001
- name: second
date: 002
- name: fourth
date: 004
@VerosK
VerosK / ks-test.jsonnet
Last active July 13, 2018 09:49
Kickstart test
local DISK_SIZE = 40000; # disk size
{
builders: [
{
type: "virtualbox-iso",
boot_wait: "6s",
# Press
// boot_command: "<enter>",
@VerosK
VerosK / npcd.conf
Created June 13, 2018 07:52
npcd.confd on CentOS 7
user = nagios
group = icinga
log_type = file
log_file = /var/log/pnp4nagios/npcd.log
max_logfile_size = 10485760
log_level = 0
perfdata_spool_dir = /var/spool/icinga2/perfdata
perfdata_file_run_cmd = /usr/libexec/pnp4nagios/process_perfdata.pl
perfdata_file_run_cmd_args = --bulk
identify_npcd = 1
@VerosK
VerosK / tomcat.service.j2
Created June 11, 2018 13:11
Tomcat systemd unit template
[Unit]
Description=Tomcat v{{ tomcat_version }}
After=network.target
[Service]
ExecStart={{ tomcat_path }}/bin/start.sh
ExecStop={{ tomcat_path }}/bin/stop.sh
Type=forking
User={{ tomcat_user }}
@VerosK
VerosK / php70.yml
Last active May 18, 2018 07:10
Ansible PHP 70
# group_vars/php
php_webserver_daemon: "httpd"
php_opcache_enable: false
php_packages:
- centos-release-scl
- rh-php71-php
- rh-php71-php-fpm