Skip to content

Instantly share code, notes, and snippets.

View linkdd's full-sized avatar
🙂

David Delassus linkdd

🙂
View GitHub Profile
@linkdd
linkdd / enter-chroot.bash
Created July 4, 2012 09:15
Script to manage chroot
#!/bin/bash
if [ "$UID" != "0" ]
then
echo "You have to be root" >&2
exit 1
fi
CHROOT=$1
@linkdd
linkdd / ints.c
Created January 16, 2013 23:53
long is a shortcut to long int, short is a shortcut to short int, char is a type, long long doesn't exist in C90
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
printf ("char: %lu\n", sizeof (char));
printf ("short: %lu\n", sizeof (short));
printf ("int: %lu\n", sizeof (int));
printf ("long: %lu\n", sizeof (long));
printf ("long long: %lu\n\n", sizeof (long long));
@linkdd
linkdd / hekad.toml
Created May 22, 2013 14:47
hekad configuration
[HttpInput]
url = "127.0.0.1:9000"
interval = 1
[JsonDecoder]
encoding_name = "JSON"
[DashboardOutput]
address = "127.0.0.1:9001"
@linkdd
linkdd / jsonschema2py.py
Created July 9, 2015 12:29
parse a json schema and generate a python class from it
# -*- coding: utf-8 -*-
import json
class ModelFactory(object):
"""Parse a JSONSchema and generate a class from it."""
TYPES = {
'string': str,
@linkdd
linkdd / setup.py
Last active February 18, 2016 13:25
setup.py skeleton
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import sys
import os
NAME = '<package name>'
KEYWORDS = '<keyword 1> <keyword 2>'
DESC = '<package description>'
{match,[
{variable_name,"Mega"},
{assign_operator,"="},
{identifier,"graph"},
{left_parenthesis,"("},
{identifier,"id"},
{assign_operator,"="},
{left_bracket,"["},
{variable_name,"Help"},
{list_separator,","},
@linkdd
linkdd / config.toml
Last active March 17, 2021 13:32
Standard Web Components with Hugo
baseURL = "https://example.com"
languageCode = "en-us"
title = "Example of Standard Web Component"
@linkdd
linkdd / elixir-node.dockerfile
Last active April 25, 2022 21:05
Example of Dockerfile for an Elixir application
FROM elixir:1.12-alpine AS builder
ARG BUILD_ENV=prod
ARG BUILD_REL=my_app
# Install system dependencies
RUN mix local.hex --force
RUN mix local.rebar --force
# Add sources
@linkdd
linkdd / deployment.yaml
Created September 14, 2021 17:09
Example of Elixir deployment for Kubernetes
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-elixir-app
namespace: default
labels:
app.kubernetes.io/name: my-elixir-app
app.kubernetes.io/instance: myapp-cluster
spec:
@linkdd
linkdd / service-headless.yaml
Created September 14, 2021 17:28
Example of headless Service for libcluster (Elixir)
---
apiVersion: v1
kind: Service
metadata:
name: my-elixir-app-svc-headless
namespace: default
labels:
app.kubernetes.io/name: my-elixir-app
app.kubernetes.io/instance: myapp-svc-headless
spec: