Skip to content

Instantly share code, notes, and snippets.

View szaydel's full-sized avatar

Sam Zaydel szaydel

  • RackTop Systems
  • Moss Beach
View GitHub Profile
@szaydel
szaydel / python-supervise.py
Created January 8, 2020 04:42 — forked from ajdiaz/python-supervise.py
python snippet to handle runit/daemontools services
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Python supervise
----------------
This module provide a methods to handle runit [1]_ or daemontools [2]_ based
supervised services, using the control file provided. Here are a small
example::
@szaydel
szaydel / python-supervise.py
Created January 8, 2020 04:42 — forked from ajdiaz/python-supervise.py
python snippet to handle runit/daemontools services
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Python supervise
----------------
This module provide a methods to handle runit [1]_ or daemontools [2]_ based
supervised services, using the control file provided. Here are a small
example::
@szaydel
szaydel / colors.go
Created December 22, 2019 07:38 — forked from ik5/colors.go
Simple golang expirement with ANSI colors
package main
// http://play.golang.org/p/jZ5pa944O1 <- will not display the colors
import "fmt"
const (
InfoColor = "\033[1;34m%s\033[0m"
NoticeColor = "\033[1;36m%s\033[0m"
WarningColor = "\033[1;33m%s\033[0m"
ErrorColor = "\033[1;31m%s\033[0m"
DebugColor = "\033[0;36m%s\033[0m"
@szaydel
szaydel / unixhttpc.go
Created August 24, 2019 03:57 — forked from teknoraver/unixhttpc.go
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@szaydel
szaydel / getaddrinfo_example.c
Created January 29, 2019 17:42 — forked from jirihnidek/getaddrinfo_example.c
Example of getaddrinfo() program.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
int
lookup_host (const char *host)
@szaydel
szaydel / Plot_Examples.md
Created August 17, 2017 12:24 — forked from gizmaa/Plot_Examples.md
Various Julia plotting examples using PyPlot
@szaydel
szaydel / windows_build_numbers.txt
Created August 7, 2017 22:14 — forked from mxpv/windows_build_numbers.txt
Windows build numbers
Windows Name or Service Pack Version Number
---------------------------- --------------
Windows 1.0 1.04
Windows 2.0 2.11
Windows 3.0 3
Windows NT 3.1 3.10.528
Windows for Workgroups 3.11 3.11
@szaydel
szaydel / grace.go
Last active August 29, 2015 14:15 — forked from rcrowley/grace.go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
@szaydel
szaydel / async.py
Last active December 19, 2017 22:55 — forked from hemanth/async.py
import sys
from subprocess import PIPE, Popen
from threading import Thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # python 3.x
ON_POSIX = 'posix' in sys.builtin_module_names
@szaydel
szaydel / tmux.conf
Last active August 29, 2015 14:06 — forked from spicycode/tmux.conf
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000