Skip to content

Instantly share code, notes, and snippets.

@clofresh
clofresh / datadog.conf
Last active March 3, 2023 22:24
Multiline datadog agent log parser
[Main]
dogstreams: /path/to/log:/path/to/multiline.py:MultilineParser
#!/bin/bash
# Convert gzipped haproxy files to use date extensions
for f in $(ls haproxy*.gz | grep -v 2013)
do
dest="${f%.*.gz}-"$(gunzip -c $f | head -n 1 | awk '{ print $1 }' | cut -d T -f 1 | tr --delete '-')".gz"
mv "$f" "$dest"
done
# Convert and gzip the delayed files
package main
// #include "lua.h"
// #include "lualib.h"
// #include "lauxlib.h"
// static int imgsize(lua_State *L)
// {
// char *path = luaL_checkstring(L, 1);
// char *err;
// GoUint w, h;
<!DOCTYPE html>
<style>
.domain {
display: none;
}
</style>
<svg width="960" height="500"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
@clofresh
clofresh / consul-incr.sh
Created May 17, 2017 01:10
atomic counter in consul
#!/bin/bash
KEY=$1
VAL=$2
MAX=${3-10}
if [ -z $KEY ]; then
echo "Must specify a key" >&2
exit 1
fi

Keybase proof

I hereby claim:

  • I am clofresh on github.
  • I am clofresh (https://keybase.io/clofresh) on keybase.
  • I have a public key ASAHFxEeutbD2NI1URA1nBLyjk8xg7rJnTuOsvxPPNOWnwo

To claim this, I am signing this object:

#!/bin/bash -e
if [ -z $1 ]; then
echo "Must specify a python requirement"
exit 1
fi
curdir=$(pwd)
dir=$(mktemp -d)
output="${curdir}/requirements.txt"
local V = require('vector')
local state = {idle = {}, pressed = {}}
local current = {
state = state.idle,
}
local lines = {}
local M = {
state = state,
current = current,
-- Love debugging app for discovering joysticks
--
pressed = {}
function love.draw()
local x = 100
local y = 100
local dx = 12
local joysticks = love.joystick.getJoysticks()
using System;
using Nancy;
using Nancy.Hosting.Self;
namespace HelloNancy
{
public class HelloNancy : NancyModule
{
public HelloNancy ()
{