Skip to content

Instantly share code, notes, and snippets.

View pkieltyka's full-sized avatar
🇨🇦
hi

Peter Kieltyka pkieltyka

🇨🇦
hi
View GitHub Profile
##
## HTTP Router benchmarks -- Nov 29, 2020 with Go 1.15.5 on Linux AMD 3950x
##
## This benchmark suite is based on https://github.com/julienschmidt/go-http-routing-benchmark
## using the most up-to-date version of each pkg as of today. Each router has their own
## pros and cons, so consider the designs of each router to suit your application.
##
## *NOTE*: the memory reports below by the go benchmark tool look quite wrong, as there must
## be a bug somewhere in the go bench tool with the Go version I'm running. I will re-run
## with future versions and report back. However, in general you'll want to look at the "ns/op"
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "ngrok";
src = fetchzip {
url = https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip;
sha256 = "16gd92gqpb2fhgk2r2yzm7ralgcqy0gymh888k6h6n32j6pglzwi";
};
@pkieltyka
pkieltyka / aclmux.go
Last active December 22, 2023 22:01
wrapped chi.Router with basics for acl functionality
package aclmux
import (
"net/http"
"regexp"
"strings"
"github.com/go-chi/chi"
)
//
// CORS Anywhere -- Cloudflare Workers edition!
//
// try: https://cors-anywhere.0xhorizon.workers.dev/https://discordapp.com/api/guilds/444586810765475860/widget.json
//
addEventListener('fetch', event => {
event.respondWith(handleRequest(event, event.request))
})
require 'em-jack'
EM.run {
q = EMJack::Connection.new #connect to beanstalk
q.each_job do |job|
puts "Got job #{job.jobid}"
if process(job)
r = q.delete(job)
@pkieltyka
pkieltyka / gist:308894
Created February 19, 2010 16:55
VM sysctl options on FBSD 8
superpages on:
--------------
# sysctl -a | grep vm
kern.ipc.semvmx: 32767
kern.vm_guest: none
vm.vmtotal:
vm.loadavg: { 0.00 0.02 0.02 }
vm.v_free_min: 12793
vm.v_free_target: 53855
vm.v_free_reserved: 2683
{ stdenv, lib, fetchurl, dpkg, atk, glib, pango, gdk-pixbuf, gnome3, gtk3, cairo
, freetype, fontconfig, dbus, libXi, libXcursor, libXdamage, libXrandr
, libXcomposite, libXext, libXfixes, libXrender, libX11, libXtst, libXScrnSaver
, libxcb, nss, nspr, alsaLib, cups, expat, udev, libpulseaudio
, libuuid, at-spi2-atk, at-spi2-core, nodejs-13_x }:
let
libPath = stdenv.lib.makeLibraryPath [
stdenv.cc.cc gtk3 gnome3.dconf atk glib pango gdk-pixbuf cairo freetype fontconfig dbus
libXi libXcursor libXdamage libXrandr libXcomposite libXext libXfixes libxcb
{ pkgs, lib, ...}:
with lib;
let machine = import ~/.dotfiles/machine.nix;
in
{
enable = true;
hooks.postswitch = {
prometheus setup
================
1. sudo docker network create prom
2. mkdir -p /data/prometheus
3. create the prometheus.yml file..
3. sudo docker run -d --name prometheus --network prom -p 9090:9090 -v /data/prometheus:/prometheus-data/ prom/prometheus --config.file=/prometheus-data/prometheus.yml
@pkieltyka
pkieltyka / Supfile
Last active August 22, 2019 19:44
Short example of a sup tail-logs command
# Supfile
---
env:
NAME: api
IMAGE: ecorp/api
CONTAINER_PORT: 5000
networks:
production: