Skip to content

Instantly share code, notes, and snippets.

View gburd's full-sized avatar

Greg Burd gburd

View GitHub Profile
@gburd
gburd / skip_list.c
Created March 21, 2024 17:46 — forked from zhpengg/skip_list.c
skiplist implementation in c
/* Skip Lists: A Probabilistic Alternative to Balanced Trees */
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#define SKIPLIST_MAX_LEVEL 6
typedef struct snode {
int key;
-- This is done once per database instance.
BEGIN;
CREATE SCHEMA partman;
CREATE EXTENSION pg_partman SCHEMA partman;
COMMIT;
BEGIN;
CREATE ROLE partman WITH LOGIN;
GRANT ALL ON SCHEMA partman TO partman;
@gburd
gburd / build-erlang.sh
Last active October 5, 2021 14:42 — forked from bryanhunter/build-erlang.sh
This script will install dependencies and then build and install erlang using kerl on Ubuntu
#!/bin/bash
# This script will install dependencies then build and install erlang using kerl
# Pull this file down, make it executable and run it with sudo
#
# wget https://gist.githubusercontent.com/bryanhunter/adbd9c8d9fb2f6366eee/raw/build-erlang.sh
# chmod u+x build-erlang.sh
# sudo ./build-erlang.sh
#
# Version: 17.1
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@gburd
gburd / install-beats.sh
Last active September 17, 2019 16:47 — forked from EikeDehling/install-beats.sh
Install filebeat & metricbeat on debian (as root) and ship data to Humio's cloud hosted service for log and metric management (a replacement for Splunk, Elasticsearch, Loggly, etc.)
# Install filebeat & metricbeat
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
apt-get update
apt-get install filebeat metricbeat
# Configure filebeat
cat >/etc/filebeat/filebeat.yml <<EOL
filebeat.inputs:
@gburd
gburd / sysctl.conf
Created January 5, 2019 02:43 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@gburd
gburd / build-openjdk9-with-shenandoahgc-zero-shark-for-macos-10.13.sh
Last active October 13, 2017 17:20 — forked from bonifaido/build-openjdk9-osx.sh
Build OpenJDK 9 Zero(Shark) with ShenandoahGC on macOS High Sierra 10.13 (bash build-openjdk9-with-shenandoahgc-zero-shark-for-macos-10.13.sh)
#!/bin/bash
# Latest Mercurial, OS X Command Line Tools, JDK 8 and libffi are needed
# WIP, not yet fully functional.
# Targeting macOS High Sierra 10.13 LLVM version: 5.0.0, clang version 5.0.0 (tags/RELEASE_500/final)
# Strict Mode: http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
brew install mercurial
@gburd
gburd / llvm-update-alternatives
Last active August 8, 2019 02:08 — forked from RaymondKroon/llvm-update-alternatives
LLVM & clang alternatives
#!/usr/bin/env sh
sudo update-alternatives --install \
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-3.6 200 \
--slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-3.6 \
--slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-3.6 \
--slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-3.6 \
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-3.6 \
--slave /usr/bin/llvm-diff llvm-diff /usr/bin/llvm-diff-3.6 \
--slave /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-3.6 \
@gburd
gburd / Makefile
Created January 12, 2016 20:47 — forked from postmodern/Makefile
A generic Makefile for building/signing/install bash scripts
NAME=project
VERSION=0.0.1
DIRS=etc lib bin sbin share
INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null`
INSTALL_FILES=`find $(DIRS) -type f 2>/dev/null`
DOC_FILES=*.md *.txt
PKG_DIR=pkg
PKG_NAME=$(NAME)-$(VERSION)
@gburd
gburd / gist:1828342
Created February 14, 2012 17:26 — forked from seancribbs/gist:1704534
Riak Ruby install
--- setup:
gem install riak-client
--- create a cluster
require 'rubygems'
require 'riak/cluster'
cluster = Riak::Cluster.new(:count => 4, :source => "/opt/riak/1.0.3/node1/bin", :root => "/tmp/mycluster")
cluster.create
cluster.start
cluster.join