Skip to content

Instantly share code, notes, and snippets.

View mjf's full-sized avatar

Matouš Jan Fialka mjf

View GitHub Profile
@namrata4
namrata4 / admin.sql
Last active March 16, 2024 17:24
Handy PostgreSQL Monitoring Scripts
-- turn off paging (less/more)
psql> \pset pager off
/*
Pager usage is off.
*/
-- find an object name by id
SELECT OID, relname
@mjf
mjf / Makefile
Last active December 20, 2020 10:58
RPM specfiles for the recent HAProxy and InfluxDB OSS 2 releases
help:
@ echo 'haproxy[-libslz][-51degrees[-trie]]'
@ echo 'influxdb2'
all:
@ echo 'not supported'
clean:
@ rpmbuild-clean
@arkady-emelyanov
arkady-emelyanov / haproxy.cfg
Last active October 25, 2023 22:02
haproxy check: postgresql is master
# Sample haproxy postgresql master check
#
# haproxy listen: 5431
# pg, instance #1 listen: 5432 (master node)
# pg, instance #2 listen: 5433 (replica node)
# external failover, promoting replica to master in case of failure
# passwordless auth for user web
# template1 database is accessible by user web
#
# haproxy will pass connection to postgresql master node:
@Luzifer
Luzifer / workflowy.user.css
Last active December 16, 2016 13:14
Custom Workflowy (Based on "Work a Simpler Flowy v2.0")
@-moz-document domain("workflowy.com") {
@import 'https://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono';
@font-face {
font-family: 'FontAwesome';
font-style: normal;
font-weight: 400;
src: local('FontAwesome'), url(//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/fonts/fontawesome-webfont.woff) format('woff');
}
#controlsLeft {
@bric3
bric3 / UTF-8-demo.txt
Last active March 10, 2021 08:14
Shell (commands) tips accumulated over years
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 CC BY
The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.
@mjf
mjf / linux_sysctl.stl.txt
Last active August 29, 2015 14:25
Linux Syscall Table (semi-handcrafted)
#! /usr/bin/env stl
. Linux Syscall Table (semi-handcrafted)
. Copyright (C) 2015 Matous Jan Fialka, <http://mjf.cz/>
. Released under the terms of The MIT License
.meta linux version: 4.1.x
.meta source 1: arch/x86/syscalls/syscall_64.tbl
.meta source 2: arch/x86/syscalls/syscall_32.tbl

Velocity Conf 2015

Day 1

Bootstrapping an Ops Team - Charity Majors (Parse)

Operations - anything pertaining to maintaining and implementing systems at scale

Do you really need an ops team?

@mjf
mjf / README.rst
Last active June 9, 2022 20:05
Linux Load Average Percentage (suitable as HAProxy Agent Check)

Manual

ABOUT

   loadavgpct - Linux Load Average Percentage
   loadavgpct - Linux Load Average Percentage Capacity
@PiBa-NL
PiBa-NL / HAProxy SNI fallback workaround example
Last active September 27, 2019 05:31
HAProxy SNI fallback/workaround example this example shows some of the possibilities that are possible to give 'best effort' support for browsers that do not support SNI.. (or at least my quick testcase/workout turned into this.., i dont use it myself, and i don't claim its actually usable for anyone.)
global
maxconn 300
log 192.168.0.40 local0 debug
stats socket /tmp/haproxy.socket level admin
gid 80
nbproc 1
chroot /var/empty
daemon
#
# Example configuration for HAProxy 1.5-dev19 for using SNI
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.