Skip to content

Instantly share code, notes, and snippets.

View warmans's full-sized avatar

SW warmans

  • Nottingham
View GitHub Profile
@piraz
piraz / monitor_service.py
Last active April 6, 2022 02:58
Script that monitors a service running on systemd. If service is not running the script will try to start the service.
#!/bin/python
#
# Copyright 2016 Flavio Garcia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@lenards
lenards / _question.md
Last active October 26, 2017 17:44
Understanding the usage of `nodetool getendpoints` with compound partition keys

TL;DR - I think I have an answer that I'm sort of okay with ... and I might have decided that I need to write up a bug regarding a regression.

The whole thing has gotten a bit complicated - so you can skip it if you like...


If you consider nodetool getendpoints as a tool in our toolkit, we'd like know how to use it on realistic data. The examples in the exercises were just integer types, and not something a bit more complex.

@Kerrick
Kerrick / gist:2476702
Created April 24, 2012 05:21
Ready a live site for deployment via Git instead of FTP, and keep the git directory separate from the working tree on the server.
# On the server
# Assuming you the site is served from ~/www/example.com/ and you want the git directory to live in ~/git/
# Keep in mind that ^C is Control-C, or what ever the command is for your server to halt a program.
mkdir ~/git/example.com.git && cd ~/git/example.com.git
git init --bare
git config core.bare false
git config core.worktree ~/www/example.com
git config receive.denycurrentbranch ignore
cat > hooks/post-receive
#!/bin/sh
@the42
the42 / gist:1956518
Created March 2, 2012 07:34
GZip encoding for GO V1 using custom responsewriter
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
type gzipResponseWriter struct {