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
# -*- coding: utf-8 -*-
"""
Based on:
https://gist.github.com/meeuw/c3bc9dd07945c87c89e6#file-findfiles-py
https://bitbucket.org/nosklo/pysmbclient/wiki/Home
"""
import os
import pexpect
import re
@shreyaskarnik
shreyaskarnik / Instructions.md
Last active March 24, 2023 15:35
Route Docker Logs to ELK Stack
  • With Docker 1.8.0 shipped new log-driver for GELF via UDP, this means that the logs from Docker Container(s) can be shipped directly to the ELK stack for further analysis.
  • This tutorial will illustrate how to use the GELF log-driver with Docker engine.
  • Step 1: Setup ELK Stack:
    • docker run -d --name es elasticsearch
    • docker run -d --name logstash --link es:elasticsearch logstash -v /tmp/logstash.conf:/config-dir/logstash.conf logstash logstash -f /config-dir/logstash.conf
    • Note the config for Logstash can be found at this link
    • docker run --link es:elasticsearch -d kibana
  • Once the ELK stack is up now let's fire up our nginx container which ships its logs to ELK stack.
  • LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' logstash)
  • `docker run -d --net=host --log-driver=gelf --log-opt gelf-address=u
@VerosK
VerosK / fpm-install.sh
Created August 17, 2015 11:39
Install fpm to local dir
GEM=fpm
BINARY=fpm
GEM_HOME=${HOME}/bin/${GEM}.gem/
mkdir -p $GEM_HOME
GEM_HOME=$GEM_HOME gem install --verbose ${GEM}
cat > ${HOME}/bin/${BINARY} <<EOF
#!/bin/bash
# this is wrapper
@sebnmuller
sebnmuller / solr-filter.conf
Last active May 10, 2021 18:37
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
@pulecp
pulecp / redis-stats.php
Last active June 15, 2016 03:56 — forked from VerosK/redis-stats.php
Test redis status
<?php
/* Redis PHP stats dump
* Based on code https://gist.github.com/putzflorian/45c137a8d7868d4b6250
*/
define(REDIS_TIMEOUT, 2);
$fp = fsockopen('127.0.0.1', 6379, $errno, $errstr, REDIS_TIMEOUT);
if (!$fp) {
die($errstr);
}
@greenmoss
greenmoss / decode_vcrpy.py
Created April 3, 2016 22:26
Decode compressed responses from vcrpy test artifacts
#!/usr/bin/env python
# Now you'll be able to read those encoded/compressed
# responses in your vcrpy test artifacts!
# References:
# https://github.com/kevin1024/vcrpy/issues/249
# http://stackoverflow.com/questions/36366234
# Thanks to Reti43 on StackOverflow
import sys
@vkanevska
vkanevska / centos_bstick.sh
Last active September 23, 2024 05:19
Custom CentOS 7 bootable ISO / Support UEFI & Secure boot
#!/bin/bash
# create custom bootable iso for CentOS 7 with kickstart
if [ $# -lt 2 ]
then
echo "Usage1: $0 path2iso path2kickstart"
exit 1
else
if [ ! -f $1 ]
then
@ofrzeta
ofrzeta / preseed.cfg
Last active May 10, 2019 14:14
Minmal preseed.cfg for Debian on KVM, German keyboard/timezone, auto LVM partitioning, serial console
d-i debian-installer/locale string en_US
d-i keymap select de
d-i keyboard-configuration/xkb-keymap select de
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string de
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string debianhost
d-i netcfg/get_domain string mydomain
d-i netcfg/wireless_wep string
@lachesis
lachesis / letsencrypt_notes.sh
Last active February 3, 2025 10:38
Set up LetsEncrypt using acme.sh without root
# How to use "acme.sh" to set up Lets Encrypt without root permissions
# See https://github.com/Neilpang/acme.sh for more
# This assumes that your website has a webroot at "/var/www/<domain>"
# I'll use the domain "EXAMPLE.com" as an example
# When this is done, there will be an "acme" user that handles issuing,
# updating, and installing certificates. This account will have the following
# (fairly minimal) permissions:
# - Host files at http://EXAMPLE.com/.well-known/acme-challenge
@pylover
pylover / a2dp.py
Last active April 17, 2025 03:30
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware