Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓
deploying awesomeness

Jaka Hudoklin offlinehacker

🤓
deploying awesomeness
View GitHub Profile
View install-nix.sh
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`
View .pypi2nix.json
{
"*": {
"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]"]}
}
View mysh.c
/* 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>
View fix-store.sh
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
@offlinehacker
offlinehacker / gist:33e8b545d2812cf06932
Last active Aug 29, 2015
Test implementation for new nix wheels
View gist:33e8b545d2812cf06932
import json
import sys
from pip.index import PackageFinder
from pip.req import parse_requirements
def generate_dependencies(requirements_txt):
results = {}
@offlinehacker
offlinehacker / pythonEval.nix
Created Oct 30, 2014
Runs python from nix as a function (Run with: --option allow-unsafe-native-code-during-evaluation true)
View pythonEval.nix
{ runCommand, python, nix, boehmgc }:
let
eval-python-src = builtins.toFile "eval-python.cc" ''
#include <Python.h>
#include <eval.hh>
#include <gc/gc.h>
#include <gc/gc_cpp.h>
#define NEW new (UseGC)
@offlinehacker
offlinehacker / composer2nix.nix
Created Dec 23, 2014
Creates nix file from composer.lock
View composer2nix.nix
{ pkgs ? import <nixpkgs> {}, file ? ./composer.lock }:
with pkgs.lib;
let
deps = builtins.fromJSON (builtins.readFile file);
in pkgs.stdenv.mkDerivation {
__noChroot = true;
name = "composer2nix";
View keybase.md

Keybase proof

I hereby claim:

  • I am offlinehacker on github.
  • I am offlinehacker (https://keybase.io/offlinehacker) on keybase.
  • I have a public key whose fingerprint is 589A 1B31 60F6 EA5C C7B8 5C8A C058 4FFA EF97 D4B2

To claim this, I am signing this object:

View vimrc
" VAM {{{
" Set leader keys
let mapleader=","
let maplocalleader = ","
" put this line first in ~/.vimrc
set nocompatible | filetype indent plugin on | syn on
fun! SetupVAM()
View wordpress_create.sh
#!/bin/sh
WORDPRESS_ROOT=/usr/share/
WORDPRESS_NAME=$1
PASSWORD=$2
DOMAIN=$3
if [ $# -ne 3 ]
then
echo "Syntax: `basename $0` wordpress_name password domain"
exit