Skip to content

Instantly share code, notes, and snippets.

View moretea's full-sized avatar

Maarten Hoogendoorn moretea

View GitHub Profile
@edolstra
edolstra / nix-lang.md
Last active May 2, 2024 23:39
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
@egguy
egguy / mongo_db_recover_delete_record.py
Created May 25, 2012 16:04
Recover deleted data from mongo DB database
"""A little script to recover deleted recording of a mongoDB db file
There's no optimization but it work and has saved me
"""
import struct
import bson
import pymongo
import sys
@tobert
tobert / start-lxc-cluster.sh
Created August 29, 2011 04:54
instant lxc cluster
#!/bin/bash
COUNT=10
BRIDGE="br1"
FORMAT="lxc%d"
PARENT=$(hostname --fqdn)
LXC_ROOT=/srv/virt/lxc
OS_ROOT=/srv/virt/lxc/base/root
for num in $(seq 1 $COUNT)
@grantr
grantr / gist:1105416
Created July 25, 2011 22:31
Chef mysql master/slave recipes
## mysql::master
ruby_block "store_mysql_master_status" do
block do
node.set[:mysql][:master] = true
m = Mysql.new("localhost", "root", node[:mysql][:server_root_password])
m.query("show master status") do |row|
row.each_hash do |h|
node.set[:mysql][:master_file] = h['File']
node.set[:mysql][:master_position] = h['Position']
end