Skip to content

Instantly share code, notes, and snippets.

View piotr1212's full-sized avatar

Piotr Popieluch piotr1212

  • The Netherlands
View GitHub Profile
@piotr1212
piotr1212 / connect_stat.stp
Created June 26, 2020 14:07
Check what connects to my port systemtap, from https://sourceware.org/systemtap/examples/network/connect_stat.stp but added port
#! /usr/bin/env stap
############################################################
# connect_stat.stp
# Author: Robin Hack <rhack@redhat.com>
# An example script show process tree of process
# which tried to call connect with specific ip address
############################################################
function process_tree (ip:string) {
@piotr1212
piotr1212 / statsd.py
Created May 30, 2018 20:19
Trying out Python's asyncio: Minimal statsd thingy
import asyncio
import time
import threading
from time import time
SERVER_ADDRESS = ('127.0.0.1', 5566)
INTERVAL = 10
@piotr1212
piotr1212 / _etc_uwsgi.d_graphite.ini
Created December 1, 2015 18:37
wsgi config for graphite-web on f21-22 (using Fedora rpm package)
[uwsgi]
socket=0.0.0.0:4800
master = true
single-interpreter = true
uid = apache
gid = apache
pythonpath = /usr/share/graphite
pythonpath = /usr/share/graphite/webapp
chdir = /usr/share/graphite/webapp
plugins=python
@piotr1212
piotr1212 / grafana-backup.sh
Created November 16, 2015 10:10
Grafana sqlite backup script
cat /usr/share/grafana/grafana-backup.sh
#!/bin/bash
DB="/var/lib/grafana/grafana.db"
BACKUP="/data/backup/grafana/grafana.db-$(date +%Y%m%d).bck"
SQLITE=/usr/bin/sqlite3
ZIP=/bin/gzip
${SQLITE} ${DB} ".backup ${BACKUP}"
${ZIP} ${BACKUP}
@piotr1212
piotr1212 / singlestat.json
Created October 21, 2015 07:50
dashboard with 144 empty singlestats
{
"id": 3,
"title": "perf_test",
"originalTitle": "perf_test",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"sharedCrosshair": false,
➜ rpmbuild fedora-review -b 1264546
INFO: Processing bugzilla bug: 1264546
INFO: Getting .spec and .srpm Urls from : 1264546
INFO: --> SRPM url: https://github.com/solettaproject/soletta-packaging/releases/download/v3/soletta-0.0.1-beta5.fc22.src.rpm
INFO: --> Spec url: https://raw.githubusercontent.com/solettaproject/soletta-packaging/v3/rpm/soletta.spec
INFO: Using review directory: /home/piotr/rpmbuild/1264546-soletta
INFO: Downloading .spec and .srpm files
warning: bogus date in %changelog: Tue Sep 2 2015 Gustavo Lima Chaves <gustavo.lima.chaves@intel.com> - 0.0.1-beta5
warning: bogus date in %changelog: Tue Sep 2 2015 Gustavo Lima Chaves <gustavo.lima.chaves@intel.com> - 0.0.1-beta5
INFO: No upstream for (Source2): config
#!/bin/bash
#
# log_check_es
#
# Check ElasticSearch for recent exceptions from the live tomcat servers
##Debug
#set -x
# Exit on Error
@piotr1212
piotr1212 / piwik-nginx.conf
Last active August 29, 2015 13:57
piwik-nginx.conf
## uncomment for https
#server {
# listen 80;
# server_name localhost;
#
# location / {
# return 301 https://$server_name;
# }
#}
@piotr1212
piotr1212 / piwik.spec
Last active August 29, 2015 13:57
piwik spec file
Name: piwik
Version: 2.1.0
Release: 1%{?dist}
Summary: Free Web Analytics Software
Group: Applications/Internet
License: GPLv3+ and Public Domain and BSD and (MIT or GPLv2) and (MIT or GPL) and MIT and (BSD or GPLv2) and LGPL and GPL and LGPLv3+ and (MIT or GPLv3) and CC-BY and LGPLv2.1
URL: https://piwik.org/
Source0: https://builds.piwik.org/%{name}-%{version}.tar.gz
Source1: %{name}-nginx.conf
@piotr1212
piotr1212 / gist:9135754
Created February 21, 2014 15:01
reposync script
#!/bin/bash
# based on: http://blog.kagesenshi.org/2007/06/fedora-repository-mirroring-script.html
# mirror root - the place you want the rpms to be downloaded
MROOT="/opt/storage/repository"
# processor architectures (space separated)
ARCHS="x86_64"