Skip to content

Instantly share code, notes, and snippets.


Christopher Grebs EnTeQuAk

  • Mozilla
  • Berlin, Germany
View GitHub Profile
stephen-puiszis / elasticsearch-cheatsheet.txt
Last active Jun 4, 2021
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
View elasticsearch-cheatsheet.txt
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# cat paths
mattiaslundberg / arch-linux-install
Last active Jun 23, 2021
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
View arch-linux-install
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide ( contains a more verbose description.
# Download the archiso image from
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
seancribbs /
Last active Dec 22, 2015
WIP Client-side Riak CRDT API for Python
from collections import MutableSet, MutableMapping, Mapping
class DataType(object):
def __init__(self, value=None, context=None):
if value is not None:
self.value = value
if context:
self.context = context
benubois /
Created Jul 30, 2013
This requires that `ifstat`, `sysstat` and `bc` are installed and that `$LIBRATO_USER` and `$LIBRATO_TOKEN` are available in the environment.
# Run top twice, first output is cached
top_out=$(top -bn2 -d0.1)
cpu=$(echo "${top_out}" | grep "Cpu(s)" | sed -E "s/.*,\s*([0-9\.]+)\%id.*/\1/" | awk '{print 100 - $1}' | sed -n 2p)
memory_total=$(echo "${top_out}" | grep "Mem:" | awk {'print $2'} | sed s/k// | sed -n 2p)
echohack /
Last active Dec 16, 2015
An example of a pattern I use when using requests to wrap an api.
import requests
import json
class AbstractDataProvider():
"""A list of methods that data providers should implement or extend."""
def __init__(self, base_url, username=None, password=None):
self.base_url = base_url.rstrip('/')
self.username = username
self.password = password
vjt /
Last active May 12, 2021
Copy data from a Time Machine volume mounted on a Linux box.
# Copy data from a Time Machine volume mounted on a Linux box.
# Usage: <source> <target>
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
View gist:4160894
import uuid
alphabet = (
amueller / ml_with_sklearn_notebook.ipynb
Created Oct 29, 2012
Teaser on machine learning with scikit-learn
View ml_with_sklearn_notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
preshing / sort1mb.cpp
Created Oct 25, 2012
Sort one million 8-digit numbers in 1MB RAM
View sort1mb.cpp
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef unsigned int u32;
typedef unsigned long long u64;
// WorkArea
ojii /
Created Oct 18, 2012
Simple random name generator
from random import choice
import sys
'a', 'e', 'i', 'o', 'u',
'ka', 'ke', 'ki', 'ko', 'ku',
'ga', 'ge', 'gi', 'go', 'gu',
'sa', 'se', 'shi', 'so', 'su',
'ja', 'je' ,'ji', 'jo', 'ju',
'za', 'ze', 'chi', 'zo', 'zu',