Skip to content

Instantly share code, notes, and snippets.

Avatar

Robin Palotai robinp

  • Budapest, Hungary
View GitHub Profile
View recommended-reading.md
@Profpatsch
Profpatsch / hpack2nix.nix
Created May 26, 2017
hpack to nix file in nix expression
View hpack2nix.nix
let
hpack2nix =
name: src:
let
addCabalFile = stdenv.mkDerivation {
inherit name src;
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
installPhase = ''cp -r . $out'';
patchPhase = ''
${haskellPackages.hpack}/bin/hpack
@globin
globin / configuration.nix
Last active Jul 20, 2022
prometheus on nixos
View configuration.nix
{ pkgs, lib, config, ... }:
{
networking = {
firewall.allowedTCPPorts = [
3000 # grafana
9090 # prometheus
9093 # alertmanager
];
useDHCP = true;
};
View nginx-letsencrypt.nix
{config, ...}:
let
allowHttps = true;
serverTemplate = {
domain,
proxyTarget,
redirectWww ? false,
enableHttps ? false
}: let
View hover-export.js
// Hover.com "Zone file import/export" has been *Planned* since 2011
// https://help.hover.com/entries/471066-Zone-file-import-export
// Here's a brittle approximation of export.
//
// 1. login to your account: https://www.hover.com/domains
// 2. run the following in your browser's JavaScript console, changing the first line
// to your domain
// 3. copy the text logged to the console.
// 4. manually correct FQDNs, these have to end with a period "."
//
@jamie-allen
jamie-allen / IoManagerBootstrap.scala
Created Aug 10, 2012
Simple example of how to use Akka IOManager Iteratee and exporting work to another actor
View IoManagerBootstrap.scala
import akka.actor._
import akka.pattern.ask
import akka.util._
import akka.util.duration._
import scala.util.control.Exception._
/**
* To test, execute this code and use this command in a shell: "telnet localhost 8080"
* At the prompt, type in numbers and press enter, and they will be accumulated, returning
* the total value each time.