Skip to content

Instantly share code, notes, and snippets.

git clone https://git.openstack.org/openstack-dev/devstack
cd devstack
cat << EOF > local.conf
[[local|localrc]]
HOST_IP=192.168.33.33
PUBLIC_NETWORK_CIDR=10.0.1.0/24
DEST=/opt/stack
DATA_DIR=/opt/stack/data
SCREEN_LOGDIR=/opt/stack/data/logs/
LOGFILE=/opt/stack/data/logs/devstacklog.txt
@agentultra
agentultra / agealyzer.clj
Last active February 25, 2016 20:53 — forked from clee/agealyzer.clj
agealyzer: given a root directory, spits out histogram of ages of files
(ns clee.agealyzer)
(require '[clojure.java.io :as io])
(defn date [x] (java.util.Date. x))
(defn is-file? [f] (.isFile f))
(defn last-modified [f] (.lastModified f))
(defn get-year [x] (.getYear x))
(defn process-dir
@agentultra
agentultra / Form.hs
Last active March 27, 2018 19:34
Modelling a Form in Haskell
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StandaloneDeriving #-}
module Form where
import qualified Data.Aeson as JSON
@agentultra
agentultra / SentinelFields1.hs
Last active July 18, 2018 21:07
Aeson Parsing Optional Fields with a Sentinel
{-# LANGUAGE DeriveGeneric #-}
module SentinelFields1 where
{-
We have some JSON..
[
{
"name": "Foo Test",
@agentultra
agentultra / Adventure.hs
Created April 16, 2020 14:17
A minimalist text adventure
module Adventure where
import Control.Monad.State
import Data.Char
import Data.List
import System.IO
data Item
= Item
{ itemName :: String
@agentultra
agentultra / Socket.hs
Created July 19, 2020 17:31
This works differently on Windows
-- This is basically the same program taken from https://hackage.haskell.org/package/network-3.1.1.1/docs/Network-Socket.html#g:9
-- on 2020-07-19
-- It works as expected on Unix-like OSs: each line is buffered in and echoed back out
-- On Windows each character is read and echoed back out
module Lib where
import Control.Concurrent (forkFinally)