Skip to content

Instantly share code, notes, and snippets.

View mjf's full-sized avatar

Matouš Jan Fialka mjf

View GitHub Profile
@SIN-777
SIN-777 / mysql_total_memory_usage_calculation.sql
Created June 5, 2012 05:10
mysql total memory usage calculation query
-- copied from: http://mogmet.blog20.fc2.com/blog-entry-55.html
select @@GLOBAL.KEY_BUFFER_SIZE + @@GLOBAL.INNODB_BUFFER_POOL_SIZE + @@GLOBAL.INNODB_LOG_BUFFER_SIZE + @@GLOBAL.INNODB_ADDITIONAL_MEM_POOL_SIZE + @@GLOBAL.NET_BUFFER_LENGTH as GLOBAL_BUFFER_SIZE, @@GLOBAL.SORT_BUFFER_SIZE + @@GLOBAL.MYISAM_SORT_BUFFER_SIZE + @@GLOBAL.READ_BUFFER_SIZE + @@GLOBAL.JOIN_BUFFER_SIZE + @@GLOBAL.READ_RND_BUFFER_SIZE as THREAD_BUFFER_SIZE, @@GLOBAL.KEY_BUFFER_SIZE + @@GLOBAL.INNODB_BUFFER_POOL_SIZE + @@GLOBAL.INNODB_LOG_BUFFER_SIZE + @@GLOBAL.INNODB_ADDITIONAL_MEM_POOL_SIZE + @@GLOBAL.NET_BUFFER_LENGTH + (@@GLOBAL.SORT_BUFFER_SIZE + @@GLOBAL.MYISAM_SORT_BUFFER_SIZE + @@GLOBAL.READ_BUFFER_SIZE + @@GLOBAL.JOIN_BUFFER_SIZE + @@GLOBAL.READ_RND_BUFFER_SIZE) * @@GLOBAL.MAX_CONNECTIONS AS TOTAL_MEMORY_SIZE, (@@GLOBAL.KEY_BUFFER_SIZE + @@GLOBAL.INNODB_BUFFER_POOL_SIZE + @@GLOBAL.INNODB_LOG_BUFFER_SIZE + @@GLOBAL.INNODB_ADDITIONAL_MEM_POOL_SIZE + @@GLOBAL.NET_BUFFER_LENGTH + (@@GLOBAL.SORT_BUFFER_SIZE + @@GLOBAL.MYISAM_SORT_BUFF
@sacreman
sacreman / gist:4453493
Created January 4, 2013 15:32
haproxy config
global
log 127.0.0.1 local2 info
pidfile /var/run/haproxy.pid
stats socket /var/run/haproxy.stat mode 600 level admin
#debug
defaults
mode http
log global
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
@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

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 / 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
@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.
@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 {
@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: