Skip to content

Instantly share code, notes, and snippets.

@relvira
relvira / nginx_logformat.conf
Created May 22, 2019 12:45
NGINX JSON log_format
log_format main_json escape=json
'{'
'"@timestamp":"$time_iso8601",'
'"cloudflare":{'
'"ray_id": "$http_cf_ray",'
'"colo": "$cf_colo",'
'"connecting_ip": "$http_cf_connecting_ip",'
'"device_type": "$http_cf_device_type",'
'"ipcountry": "$http_cf_ipcountry"'
'},'
@relvira
relvira / nginx_lua_statsd.conf
Created May 5, 2019 21:09
NGINX send metrics for each location to statsd using Lua and UDP
location /test {
set $service_name test;
content_by_lua_block {
--ngx.say("Let's send some stuff to statsd")
local sock = ngx.socket.udp()
local ok, err = sock:setpeername("127.0.0.1", 8125)
if not ok then
--ngx.say("failed to connect to udpserv: ", err)
return

Keybase proof

I hereby claim:

  • I am relvira on github.
  • I am rdelvira (https://keybase.io/rdelvira) on keybase.
  • I have a public key ASAZwBJRxdctqHw-8XLcXDKaOnA0jsacBeM8DeK3T6xLeAo

To claim this, I am signing this object:

# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@relvira
relvira / hack.sh
Created March 18, 2013 22:21 — forked from amrox/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/3999124/hack.sh | sh
#