Skip to content

Instantly share code, notes, and snippets.

View CGenie's full-sized avatar
💭
I prefer sourcehut! sr.ht

CGenie

💭
I prefer sourcehut! sr.ht
View GitHub Profile
@CGenie
CGenie / gist:7884f53b2386d74c164b
Created August 11, 2014 17:21
Data.Aeson.Lens problems
{-# LANGUAGE OverloadedStrings #-}
import Data.Aeson.Lens
import Data.Text
import Data.Text.Encoding as E
main = do
lex x = (E.decodeUtf8 "{\"a\": 1}") ^? key "a"
return ()
@CGenie
CGenie / docker_inspect
Created October 7, 2014 10:18
Strange docker inspect behavior
docker inspect fuel/nailgun_6.0:latest
"config": {
"Hostname": "f218e5ce70a0",
"Domainname": "",
"User": "",
"Memory": 0,
"MemorySwap": 0,
"CpuShares": 0,
"AttachStdin": false,
@CGenie
CGenie / openstack.yaml
Last active August 29, 2015 14:07
openstack.yaml proposal
roles_metadata:
controller:
conflicts:
- compute
conditions:
- condition: "cluster:mode == 'multinode'"
then:
all:
- condition: "selectedNodes._length <= 1"
warning: "Multi-node environment cannot have more than one controller node."
@CGenie
CGenie / openstack.yaml
Last active August 29, 2015 14:07
openstack.yaml with implemented roles
---
- &base_release
model: "nailgun.release"
fields:
state: "available"
modes_metadata:
ha_compact:
description: "This configuration Deploys OpenStack ready for high availability (HA). Controller services are prepared for HA by setting up a base MySQL/Galera, RabbitMQ and HAProxy so that additional controllers can be deployed NOW, or scaled out LATER. 3 or more controllers are required for a true HA environment."
multinode:
description: "In this configuration the OpenStack controller is deployed separately from the compute and cinder nodes. This mode assumes the presence of 1 controller node and 1 or more compute/cinder nodes. You can add more nodes to scale your cloud later."
@CGenie
CGenie / urls.py
Created October 8, 2014 15:22
urls.py proposal
def test():
return ReleaseCollectionHandler
urls = (
...
r'/test/test/?$',
@CGenie
CGenie / field_mapping
Created October 20, 2014 07:36
ES lowercase analyzer
"doc_type_structure": {
"properties": {
"aid": {"type": "string", "index": "analyzed", "analyzer": "not_analyzed_lowercase"}
}
}
ceph-osd:
name: "Storage - Ceph OSD"
description: "Ceph storage can be configured to provide storage for block volumes (Cinder), images (Glance) and ephemeral instance storage (Nova). It can also provide object storage through the S3 and Swift API ( See settings to enable each)."
restrictions:
- condition: "settings:common.libvirt_type.value == 'vcenter'"
message: "Ceph cannot be used with vCenter"
update_once:
- controller
on_delete: warn
@CGenie
CGenie / rankntype.hs
Created February 11, 2015 19:20
RankNType question
{-# LANGUAGE RankNTypes #-}
module Main
where
class Zeroable a where
zero :: a -> Int

Keybase proof

I hereby claim:

  • I am cgenie on github.
  • I am cgenie (https://keybase.io/cgenie) on keybase.
  • I have a public key ASAQ_k-4ZhrXtVGO7xlvtWKr_yFH4pKxLHNiiWgazhjLCQo

To claim this, I am signing this object:

@CGenie
CGenie / Dockerfile
Created September 13, 2017 03:26
Libretime docker setup
FROM ubuntu-upstart:14.04
WORKDIR /code
COPY ./ /code
RUN set -x; \
apt-get update && \
apt-get install -y \
vim