This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: { | |
services.nfs.server.enable = true; | |
services.nfs.server.exports = '' | |
/exports/nix 192.168.1.0/255.255.255.0(rw,no_root_squash,no_subtree_check,hide,fsid=0) | |
/exports/nix/store 192.168.1.0/255.255.255.0(rw,no_root_squash,no_subtree_check,fsid=1) | |
''; | |
services.nfs.server.createMountPoints = true; | |
programs.ssh.extraConfig = '' | |
Port 64123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
from pip.index import PackageFinder | |
from pip.req import parse_requirements | |
def generate_dependencies(requirements_txt): | |
results = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path=$(nix-collect-garbage -d 2>&1 | grep error: | awk -F"\`" '{print $2}' | awk -F"\'" '{print $1}') | |
echo $path | |
until [ $path = */nix/store* ]; do | |
sqlite3 /nix/var/nix/db/db.sqlite "DELETE FROM ValidPaths WHERE path='$path'" | |
nix-store --delete $path | |
path=$(nix-collect-garbage -d 2>&1 | grep error: | awk -F"\`" '{print $2}' | awk -F"\'" '{print $1}') | |
echo $path | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compile with: g++ -Wall –Werror -o shell shell.c */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <limits.h> | |
#include <dirent.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"*": { | |
"setuptools": {"append_deps": ["pytest[test]"]}, | |
"sqlalchemy": {"append_deps": ["pysqlite[test]"], "spec": "sqlalchemy==0.8.5"}, | |
"sqlalchemy-imageattach": { | |
"src": "https://github.com/crosspop/sqlalchemy-imageattach/archive/{{spec.pinned}}.tar.gz#egg=sqlalchemy-imageattach-{{spec.pinned}}", | |
"append_deps": ["pysqlite[test]"] | |
}, | |
"alembic": {"append_deps": ["pysqlite[test]"]} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION=1.6.1 | |
ARCH=`uname -m` | |
ARCH_SYS=`uname -s | tr "[A-Z]" "[a-z]"` | |
if [[ "$ARCH" = "i386" ]] | |
then | |
ARCH = "i686" | |
fi | |
WORK_DIR=`pwd` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This file defines the builds that constitute the Nixpkgs. | |
Everything defined here ends up in the Nixpkgs channel. Individual | |
jobs can be tested by running: | |
$ nix-build pkgs/top-level/release.nix -A <jobname>.<system> | |
e.g. | |
$ nix-build pkgs/top-level/release.nix -A coreutils.x86_64-linux | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class overridable_property(property): | |
""" | |
Property where you can override return value by setting _name | |
>>> class test(object): | |
... @overridable_property | |
... def test(self): | |
... return "abcd" | |
... | |
>>> a = test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations | |
def divide(l, p={}): | |
for v in (j for i in xrange(1, len(l) + 1) for j in combinations(l, i)): | |
r = tuple(set(l) - set(v)) | |
for s in devide(r): | |
t = (v,) + (s if s else tuple()) | |
if frozenset(t) in p: continue | |
else: yield t; p[frozenset(t)] = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class merge_with_base(object): | |
""" | |
Merges result of function or attribute from child class with result of | |
function or attribute from the base class. | |
:param type: Use this base class instead of first base class found and | |
not with mixins | |
.. note:: |