Skip to content

Instantly share code, notes, and snippets.

@icebob
icebob / README.md
Last active October 22, 2023 19:50
Health-check middleware for Moleculer (for Kubernetes liveness readiness checks)
@samyranavela
samyranavela / Example health-check script with systemd socket activation
Created April 18, 2018 12:56 — forked from kouk/Example health-check script with systemd socket activation
Simple HTTP health-check by abusing systemd socket activation with shell scripts
$ curl --dump-header - localhost:12345
HTTP/1.0 404 Not Found
Content-Type: text/html
Content-Length: 43
Date: Fri, 05 Dec 2014 17:48:56 +0000
<html>
<body>
<h1>WUT</h1>
</html>
// Size 4-40
screwDiameter = 2.8;
screwHeadDiameter = 5.5;
screwHeadHeight = 2.3;
insertDiameter = 4;
insertThreadedDiameter = 4.45;
insertHeight = 3.5;
standardPotShaftTopHeight = 8;
standardPotShaftTopDiameter = 6;
@scottsb
scottsb / resetting-csync2-cluster.md
Last active October 25, 2021 20:28
Guide to Resetting a csync2 Cluster

Guide to Resetting a csync2 Cluster

Introduction

These are possible steps to reset a csync2 cluster that has been seriously fubared. This is an apocalyptic approach and should only be used when more surgical fixes (like correcting an individual conflict) aren't workable.

Use Cases

@5263
5263 / exrsdoc.py
Last active August 5, 2016 10:57
parser for the rdsoc file format
#!/usr/bin/env python
import zipfile
tempdirlin='/home/user/sattemp'
tempdirwine='D:\\'
converterbin="/windows/Programme/Program Files (x86)/DesignSpark/DesignSpark Mechanical 1.0/sabSatConverter.exe"
# add freecad libdir to path
import sys
sys.path.insert(0,'/usr/local/freecad/lib')
@adityamenon
adityamenon / app.domainname
Last active December 28, 2021 06:31
My preferred configuration for a Laravel 4 API endpoint running over PHP-FPM, when I need to talk to it with AngularJS.
server {
root /path/to/app/public;
index index.php;
server_name test.dev;
set $cors_headers "whatever-custom-headers,you-would-like";
# redirection to index.php
location / {
try_files $uri $uri/ /index.php?$query_string;
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@vlad-shatskyi
vlad-shatskyi / notifyosd.zsh
Last active December 15, 2015 11:49 — forked from ihashacks/notifyosd.zsh
Displays a notification when a command, that takes over 10 seconds to execute, finishes and only if the current window isn't the terminal. Add to your .zshrc: [ -e path/to/notifyosd.zsh ] && . path/to/notifyosd.zsh
function active-window-id {
echo `xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}'`
}
# end and compare timer, notify-send if needed
function notifyosd-precmd() {
if [ ! -z "$cmd" ]; then
cmd_end=`date +%s`
((cmd_time=$cmd_end - $cmd_start))
fi
@kgriffs
kgriffs / sysctl.conf
Last active April 29, 2024 11:32
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
#
# See also: https://gist.github.com/kgriffs/4027835
#
# Assumes a beefy machine with lots of network bandwidth
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 22, 2024 04:20
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'