Skip to content

Instantly share code, notes, and snippets.

@samrose
samrose / nix-n3h.bash
Created May 1, 2019 17:36 — forked from neonphog/nix-n3h.bash
nix-n3h.bash
#!/bin/bash
# -- sane bash errors -- #
set -Eeuo pipefail
# -- docker exec -- #
cat > Dockerfile <<EOF
FROM nixos/nix
RUN nix-channel --add https://github.com/Holo-Host/nixpkgs-channels/archive/680f9d7ea90dd0b48b51f29899c3110196b0e913.tar.gz
@samrose
samrose / scylla.nix
Created March 29, 2019 21:47 — forked from teburd/scylla.nix
scylla.nix
with import <nixpkgs> {};
#{stdenv, fetchFromGitHub, python, ninja}:
stdenv.mkDerivation rec {
name = "scylla-${version}";
version = "2.1.0";
src = fetchgit {
url = "https://github.com/scylladb/scylla";
super: self:
let
rustOverlayRepo = self.fetchFromGitHub {
owner = "mozilla";
repo = "nixpkgs-mozilla";
rev = "90d41cd5dd6c31c7bfaaab68dd6f00bae596d742";
sha256 = "0cpv969mgv2v8fk6l9s24xq1qphwsvzbhf8fq4v6bkkwssm0kzn6";
};
rustOverlay = import "${rustOverlayRepo}/rust-overlay.nix" self super;
@samrose
samrose / default.nix
Created February 13, 2019 20:39 — forked from greglearns/default.nix
NixOS default.nix for compiling Nightly Rust using Mozilla overlay, also with a specific RustRegistry for specific date, to handle "version not found" issues. Doesn't actually work, so do not use.
{
pkgs ? (
let
pkgs = import <nixpkgs>;
pkgs_ = (pkgs {});
rustOverlay = (pkgs_.fetchFromGitHub {
owner = "mozilla";
repo = "nixpkgs-mozilla";
rev = "1608d31f7e5b2415fb80b5d76f97c009507bc45f";
sha256 = "0mznf82k7bxpjyvigxvvwpmi6gvg3b30l58z36x192q2xxv47v1k";
@samrose
samrose / cnxsoft.md
Created July 20, 2018 16:26 — forked from stefanozanella/cnxsoft.md
Emulate a Raspberry Pi with Qemu+ KVM

Booting with CNXSoft image

Reference: http://www.cnx-software.com/2012/07/31/84-mb-minimal-raspbian-armhf-image-for-raspberry-pi/

curl -O https://dl.dropbox.com/u/45842273/2012-07-15-wheezy-raspian-minimal.img.7z

yum install p7zip
7za e 2012-07-15-wheezy-raspian-minimal.img.7z

qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda 2012-07-15-wheezy-raspian-minimal.img -net nic -net user -vnc :0 -net tap,ifname=vnet0,script=no,downscript=no
@samrose
samrose / configuration.nix
Created July 18, 2018 17:47 — forked from seanjensengrey/configuration.nix
Nixos with raid-0 root partition using mdadm
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
# Download graphical ISO, http://nixos.org/nixos/download.html
# if you want to do an install over an SSH connection
# $ systemctl start sshd.service
# $ useradd remoteinstaller
# $ passwd remoteinstaller
@samrose
samrose / snake-nginx.nix
Created July 10, 2018 13:29 — forked from thoughtpolice/snake-nginx.nix
A complete example of a working Hydra build machine and other stuff.
let
# Wrap a nginx server block in an HTTPS site
wrapSSL = site: cert: key: block: ''
server {
listen 80;
listen [::]:80;
server_name ${site};
location /nginx_status {
stub_status on;
@samrose
samrose / introrx.md
Created April 25, 2018 17:13 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@samrose
samrose / README.md
Created July 13, 2017 11:10 — forked from bertspaan/README.md
Python script to convert DBF database file to CSV
@samrose
samrose / zeromq_install.sh
Last active July 1, 2016 21:08 — forked from cdjhlee/zeromq_install.sh
install zeromq in ubuntu 14.04
#!/usr/bin/bash
##############################################
#from http://zeromq.org/intro:get-the-software
##############################################
#get zeromq
wget https://github.com/zeromq/zeromq4-1/releases/download/v4.1.5/zeromq-4.1.5.tar.gz
#unpack tarball package