This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <assert.h> | |
#include <netdb.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// iloveyou.c | |
#include <stdio.h> | |
int main () { | |
for (unsigned int I = 0; I<3U; ++I) | |
puts("true == I<3U"); | |
} | |
// vim: set ts=4 sw=4 noet syn=c: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ring_buffer.c | |
// ring_buffer -- Trivial lock-free (wait-free) ring-buffer for use in | |
// single-reader/single-writer scenarios without using atomic primitives. | |
// Copyright (C) 2017 Isabell Cowan | |
// | |
// This program is free software: you can redistribute it and/or modify | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation, either version 3 of the License, or | |
// (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# blockstatd.py | |
# The graphite-blockstat daemon | |
# graphite-blockstat -- Send Linux blockstat metrics to Graphite | |
# Copyright (c) 2017 Bodhi Digital LLC., Isabell Cowan | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import string | |
from random import SystemRandom | |
from crypt import crypt | |
from getpass import getpass | |
def get_salt(saltlen): | |
copts = string.ascii_letters + string.digits | |
sysrand = SystemRandom() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
from urllib.request import Request, urlopen | |
from sys import argv, stderr | |
def pp_json(data): | |
pretty_json = json.dumps(data, sort_keys=True, indent=2, separators=(",", ": ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function get_stime() { | |
head -n 2 <<< "$1" | tail -n 1 | cut -d ' ' -f 1-3 | date --date="$(cat /dev/fd/0)" +%s | |
} | |
function get_etime() { | |
tail -n 1 <<< "$1" | cut -d ' ' -f 1-3 | date --date="$(cat /dev/fd/0)" +%s | |
} |