Skip to content

Instantly share code, notes, and snippets.

Christopher Schmidt FaKod

View GitHub Profile
View code-server-deploy.yaml
apiVersion: v1
kind: Namespace
metadata:
name: code-server
---
apiVersion: v1
kind: Service
metadata:
name: code-server
View kubernetes_docker_tail.rb
module Fluent
class NewKubernetesDockerTailInput < NewTailInput
Plugin.register_input("kubernetes_docker_tail", self)
desc 'The file to read the container name'
config_param :container_name_file, :string
def initialize
super
@FaKod
FaKod / k8s-node.j2
Created Jun 28, 2016
Ansible node template for Torus installation as a Volume Plugin
View k8s-node.j2
#cloud-config
write-files:
- path: /opt/bin/wupiao
permissions: '0755'
content: |
#!/bin/bash
# [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen
[ -n "$1" ] && [ -n "$2" ] && while ! curl --output /dev/null \
--silent --head --fail \
http://${1}:${2}; do sleep 1 && echo -n .; done;
View gist:e6724675e4ebaf9f8fa4
function insertValues(data, value, dimension, metric, domain) {
var defaults = {};
domain.forEach(function(item) {
var v = {};
v[dimension] = item;
v[metric] = value;
defaults[item] = v;
});
_.each(data, function(item) {
@FaKod
FaKod / gist:2710656
Created May 16, 2012
NullPointerException @ RestRelationship
View gist:2710656
public class RestTraversalMain {
/**
* running neo4j community 1.5.2
* Matrix Example -> Node 391 is Neo
* <p/>
* Throws Exception:
* <p/>
* Exception in thread "main" java.lang.NullPointerException
@FaKod
FaKod / gist:2277743
Created Apr 1, 2012
Neo4j Typed Traverser Examples using the REST interface
View gist:2277743
{
{
/**
* follow list of nodes with relations BOTH "KNOWS" and OUT "CODED_BY"
*/
val erg = startNodes.doTraverse[Test_MatrixBase](follow -- "KNOWS" ->- "CODED_BY") {
/**
* prune evaluator is Java Script and returns false
@FaKod
FaKod / gist:1761507
Created Feb 7, 2012
Typed Traversal for Neo4j
View gist:1761507
trait MatrixBase {
val name: String
val profession: String
}
case class Matrix(name: String, profession: String) extends MatrixBase
case class NonMatrix(name: String, profession: String) extends MatrixBase
/**
@FaKod
FaKod / gist:1366334
Created Nov 15, 2011
Create and delete Neo4j Nodes via REST
View gist:1366334
case class MatrixNodeProperties(name: String, profession: String)
object CreateAndDeleteNodes extends App with Rest with SimpleWebResourceProvider {
// base location of Neo4j server instance
override def baseUriAsString = "http://localhost:7474/db/data/"
// all subsequent REST calls should use JSON notation
override val mediaType = Some(MediaType.APPLICATION_JSON)
@FaKod
FaKod / gist:1331645
Created Nov 1, 2011
Creating and deleting Nodes with Neo4j Server and sjersey-client for Scala
View gist:1331645
rest {
implicit s =>
// defining note names and profession
val nodes = ("Mr. Andersson", "Hacker") ::
("Morpheus", "Hacker") ::
("Trinity", "Hacker") ::
("Cypher", "Hacker") ::
("Agent Smith", "Program") ::
("The Architect", "Whatever") :: Nil
@FaKod
FaKod / gist:1331556
Created Nov 1, 2011
The Neo4j Matrix Example with Neo4j-Scala
View gist:1331556
/**
* The Matrix Example
* http://wiki.neo4j.org/content/The_Matrix
*/
case class Matrix(name: String, profession: String)
object TheMatrix extends App with Neo4jWrapper with EmbeddedGraphDatabaseServiceProvider {
ShutdownHookThread {
shutdown(ds)
You can’t perform that action at this time.