Skip to content

Instantly share code, notes, and snippets.

FROM ubuntu
RUN apt update && apt install -y sudo && \
mkdir -p /home/user && groupadd -r user && \
useradd -r -g user -d /home/user -s /sbin/nologin -c "User" user && \
echo "user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user
ENV HOME=/home/user
RUN chown user:user /home/user
RUN apt install -y curl bzip2
USER user
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash
true
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p nix-prefetch-scripts curl jshon jq
set -e
json="{}"
add() { json=$(jshon "$@" <<<"$json"); }
rm -rf overlay/upstream
mkdir -p overlay/upstream
GET() {

Keybase proof

I hereby claim:

  • I am mbrock on github.
  • I am mbrock (https://keybase.io/mbrock) on keybase.
  • I have a public key ASBYWz5glW-ksfNNPzhmsTlZVH-rpyk6rKyLHC1WghPddAo

To claim this, I am signing this object:

# Put this expression right in your systemPackages
(pkgs.writeScriptBin "foo" ''
#! ${stdenv.shell}
echo foo
'')
@mbrock
mbrock / docker-services.nix
Created July 28, 2017 09:09
Nix service thing for Docker
{ config, pkgs, ... }:
let dockerService = {
name,
vhosts ? [],
public ? (if builtins.length vhosts > 0 then true else false),
image,
user ? "docker",
cmd ? "",
volumes ? [],
#!/bin/sh
# use: ipfspic <picture-to-upload>
url=https://ipfs.pics/upload.php
http --headers -f POST $url img@"$1" |
grep Location |
sed 's/^Location: //' |
sed 's#pics/#pics/ipfs/#' |
sed 's/#new//'
// Simplest possible wrapper around IHKeyboardAvoiding.
//
// I don't really know how to Xcode, but I got it to work by:
//
// 1. Checking out the IHKeyboardAvoiding repository.
// https://github.com/IdleHandsApps/IHKeyboardAvoiding
//
// 2. Dragging the Files IHKeyboardAvoiding.{h,m} into my project.
//
// 3. Ensuring that both .m files are in the "Compile Sources" phase of the target.
### Keybase proof
I hereby claim:
* I am mbrock on github.
* I am mbrock (https://keybase.io/mbrock) on keybase.
* I have a public key whose fingerprint is 3673 4075 057B 4F4D C333 499B 79BA 85F4 1B9F 0FA0
To claim this, I am signing this object:
@mbrock
mbrock / default-scope-on-subclass-test.rb
Created January 8, 2015 12:29
NoBrainer: error using default_scope in subclass
require 'nobrainer'
NoBrainer.configure do |config|
config.app_name = "default-scope-on-subclass-test"
end
class Thing
include NoBrainer::Document
end