Skip to content

Instantly share code, notes, and snippets.

View angrycub's full-sized avatar

Charlie Voiselle angrycub

View GitHub Profile
@ajeetraina
ajeetraina / gist:1618c2ddbe94a8fdff6fb8cba785e4e4
Last active April 1, 2021 17:23
Getting Started with LinuxKit on MacOS
LinuxKit for Docker for Mac:
***Cloning LinuxKit Repository:***
Ajeets-MacBook-Air:~ ajeetraina$ sudo git clone https://github.com/linuxkit/linuxkit
Cloning into 'linuxkit'...
remote: Counting objects: 20097, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 20097 (delta 1), reused 0 (delta 0), pack-reused 20082
@Manc
Manc / consul.service
Last active July 15, 2020 03:03 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=Consul service discovery agent
Requires=network-online.target
After=network.target
[Service]
User=consul
Group=consul
PIDFile=/run/consul/consul.pid
Restart=on-failure
@drewkerrigan
drewkerrigan / README.md
Last active September 17, 2015 20:52
Compile relocatable release on Ubuntu

Instructions

sudo su ubuntu
sudo -s
apt-get install -y git
git clone https://gist.github.com/94d82c2ac08dfcad488e.git riak_relocatable
cd riak_relocatable
chmod 755 build.sh
./build.sh
@eiri
eiri / README.md
Created August 27, 2015 12:35
Demonstrate Erlang's 'busy wait' effect on CPU utilization

Demonstrate Erlang's 'busy wait' effect on CPU utilization

How?

Just make Erlang to do some light-load task in a bunch of relatively short leaving processes. Calculating PI to 80th digit in batches per 10 procs with short, 8 ms, sleep in-between, to give schedulers a breath space, will do.

Running

Run erl with 8 schedulers and no busy waiting on schedulers at all.

@sdebnath
sdebnath / gist:36c235e042cb35db7d1f
Last active July 13, 2018 09:39
Add field to Riak YZ Schema with CRDTs
This gist captures what needs to be done to add a new field to Riak's Yokozuna
search index.
Sources:
- https://github.com/basho/yokozuna/issues/130
- http://riak-users.197444.n3.nabble.com/How-to-update-existed-schema-td4032143.html
The code below is for illustration purposes only. Use at your own risk.
1. Create/Update new schema file
@binarytemple
binarytemple / query.riak.realtime.queue.markdown
Last active February 2, 2016 21:47
Query objects on the real time queue (with sizes)

Load 10Mb of data into /tmp/foo:

sudo dd if=/dev/disk0 of=/tmp/foo bs=1m count=10

Start loading it into dev1 node

for i in `seq 1 10000`
do curl -XPUT "http://localhost:10018/buckets/food3/keys/ooopp$i" -d@/tmp/foo  
@drewkerrigan
drewkerrigan / setup.md
Last active July 12, 2018 14:31
simple Riak default schema search setup

Simple Search 2.0 Setup

Create an index
curl -i -XPUT http://localhost:8098/search/index/my_index
Link the index to a bucket
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@bsparrow435
bsparrow435 / riak_metrics.escript
Last active August 21, 2017 09:06
Escript to query various in-VM metrics on a Riak node not currently available from stats.
-module(riak_metrics).
-compile(export_all).
main([NodeName0, Cookie, Length, Command]) ->
LocalName = 'riak_metrics@127.0.0.1',
NodeName = list_to_atom(NodeName0),
case net_kernel:start([LocalName]) of
{ok, _} ->
erlang:set_cookie(node(), list_to_atom(Cookie)),
case net_kernel:hidden_connect_node(NodeName) of