Skip to content

Instantly share code, notes, and snippets.

View aforemny's full-sized avatar
turning coffee into bugs

Alexander Foremny aforemny

turning coffee into bugs
  • Self-employed
  • Hanover, Germany
  • 15:24 (UTC +02:00)
View GitHub Profile
@aforemny
aforemny / default.nix
Created May 22, 2012 22:12
minimal Nix expression for a lighttpd service
{ config, pkgs, ... }:
with pkgs.lib;
let
lighttpdConf = pkgs.writeText "lighttpd.conf" ''
server.document-root = "/var/www/"
server.port = 3000
'';
# Upstart job `lighttpd'. This is a generated file. Do not edit.
description "Lighttpd webserver"
start on started network-interfaces
stop on stopping network-interfaces
env PATH=/nix/store/mpnj4k2ijrgyfkh48fg96nzcmklfh5pl-coreutils-8.15/bin:/nix/store/6hg10ashnalchwr6xlfi5yjxwsmlikf9-findutils-4.4.2/bin:/nix/store/bjfr2h0f4dr1ckpccp8i494hh667vbga-gnugrep-2.10/bin:/nix/store/fn7hm39xaj8iqlvg4n4hxd9q4nvi6qhv-gnused-4.2.1/bin:/nix/store/q97mxdamwmjcqlia1yc7a7cwrdvqlabc-upstart-1.5/bin:/nix/store/mpnj4k2ijrgyfkh48fg96nzcmklfh5pl-coreutils-8.15/sbin:/nix/store/6hg10ashnalchwr6xlfi5yjxwsmlikf9-findutils-4.4.2/sbin:/nix/store/bjfr2h0f4dr1ckpccp8i494hh667vbga-gnugrep-2.10/sbin:/nix/store/fn7hm39xaj8iqlvg4n4hxd9q4nvi6qhv-gnused-4.2.1/sbin:/nix/store/q97mxdamwmjcqlia1yc7a7cwrdvqlabc-upstart-1.5/sbin
@aforemny
aforemny / default.nix
Created June 19, 2012 08:45
solfege Nix expression
{ stdenv, fetchurl, pkgconfig, gettext, texinfo, pygobject, pygtk,
gnome_python, pythonPackages }:
let
pn = "solfege";
v = "3.20.4";
in stdenv.mkDerivation {
@aforemny
aforemny / Main.hs
Created June 27, 2012 14:30
Reactive Banana as library
{-# LANGUAGE ExistentialQuantification #-}
module Main where
import Control.Concurrent (forkIO, threadDelay)
import Control.Monad (forever)
import Data.Time (getCurrentTime)
import Reactive.Banana
main = do
(clock, clockSink) <- newAddHandler
@aforemny
aforemny / Main.hs
Created June 27, 2012 14:32
Reactive Banana as Library
module Main where
import Control.Concurrent (forkIO, threadDelay)
import Control.Monad (forever)
import Data.Time (getCurrentTime)
import Reactive.Banana
main = do
(clock, clockSink) <- newAddHandler
forkIO $ forever $ getCurrentTime >>= clockSink >> sleep
The Tiger Lillies
=================
SinDerella
----------
Brick in the Wall
-----------------
I know it is nothing
Nothing at all
I know I'm another
WRONG SIDE OF MIDNIGHT
KAT FRANKIE
POCKETKNIFE
I'm no longer for you
I'm not against your saying
I don't turn for you
You don't belong to me
But our friends
@aforemny
aforemny / gist:4164973
Created November 28, 2012 22:01
Compiling rpi-3.2.27
building drivers/mmc/host/bcm2708_mci.o
CC [M] drivers/mmc/host/bcm2708_mci.o
drivers/mmc/host/bcm2708_mci.c:33:23: fatal error: asm/sizes.h: No such file or directory
compilation terminated.
make[3]: *** [drivers/mmc/host/bcm2708_mci.o] Error 1
make[2]: *** [drivers/mmc/host] Error 2
make[1]: *** [drivers/mmc] Error 2
make: *** [drivers] Error 2
@aforemny
aforemny / postfix
Created January 13, 2013 11:43
services.postfix.enable = true; # postfix -c /var/postfix/conf start
postfix/postfix-script: warning: not owned by root: /var/postfix/conf/
postfix/postfix-script: warning: not owned by root: /var/postfix/queue
postfix/postfix-script: warning: not owned by root: /var/postfix/queue/pid
postfix/postfix-script: warning: group or other writable: /var/postfix/queue
postfix/postfix-script: warning: not owned by root: /var/postfix/conf//aliases.db
postfix/postfix-script: warning: not owned by root: /var/postfix/conf//virtual.db
postfix/postfix-script: warning: not owned by group postdrop: /nix/store/5qpm30f3r9nf2ln049nan1qh4hm1cpqv-postfix-2.8.12/sbin/postqueue
postfix/postfix-script: warning: not owned by group postdrop: /nix/store/5qpm30f3r9nf2ln049nan1qh4hm1cpqv-postfix-2.8.12/sbin/postdrop
postfix/postfix-script: warning: not set-gid or not owner+group+world executable: /nix/store/5qpm30f3r9nf2ln049nan1qh4hm1cpqv-postfix-2.8.12/sbin/postqueue
postfix/postfix-script: warning: not set-gid or not owner+group+world executable: /nix/store/5qpm30f3r9nf2ln049nan1qh4hm1cpqv-postfix-2.8.1
@aforemny
aforemny / teaser.hs
Created January 27, 2013 18:49
Extract the first paragraph of body after pandocCompiler processed the input.
match "posts/*" $ do
route $ setExtension ".html"
compile $ pandocCompiler >>= saveSnapshot "content" >>= ...
postCtx = mconcat
[ Context $ \k i ->
if k == "teaser" then do
i' <- loadSnapshot (itemIdentifier i) "content"
return $ fromMaybe "" $ safeHead $ lines $ itemBody i'
else