Skip to content

Instantly share code, notes, and snippets.

View titpetric's full-sized avatar

Tit Petric titpetric

View GitHub Profile
@d0x2f
d0x2f / .drone.yml
Last active August 17, 2021 22:18
.drone.yml example
workspace:
base: /build
pipeline:
dbnode1:
detach: true
image: mysql/mysql-cluster:7.5
commands:
- sleep 5
@jsokel
jsokel / sqs_publisher.go
Created April 13, 2017 14:49
A simple generic GO SQS publisher
package queue
import (
"encoding/base64"
"encoding/json"
log "github.com/Sirupsen/logrus"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/sqs"
"github.com/aws/aws-sdk-go/service/sqs/sqsiface"
"reflect"
@alexras
alexras / service-checklist.md
Created October 9, 2016 04:51 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
function do_cleanup {
echo "--- Cleaning up all my trash"
rm -rf /tmp/all_the_things
}
trap do_cleanup EXIT
docker pull my-cool-thing:latest
rspec
echo ":party_parrot:"
./do-failing-thing
@bcho
bcho / m.go
Created July 11, 2015 13:29
trick
// A cancellable job runner prototype.
package main
import (
"fmt"
"math/rand"
"time"
)
func worker(id int, cancel chan interface{}, done chan int) {
@Humerus
Humerus / index.html
Created April 16, 2015 00:09
Docker Exec Web Console
<html>
<head>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script src="//cdn.rawgit.com/chjj/term.js/0b10f6c55d5113d50d0ff94b6c38a46375a5f9a5/src/term.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
@danackerson
danackerson / 100_base.conf
Last active October 20, 2023 10:11
using nginx + lua + redis for redirects and rewrites
# using such a setup requires `apt-get install lua-nginx-redis` under Ubuntu Trusty
# more info @ http://wiki.nginx.org/HttpLuaModule#access_by_lua
http {
lua_package_path "/etc/nginx/include.d/?.lua;;";
lua_socket_pool_size 100;
lua_socket_connect_timeout 10ms;
lua_socket_read_timeout 10ms;
server {
@ekristen
ekristen / check_docker_container.sh
Last active January 16, 2024 16:15
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@peterhellberg
peterhellberg / api.go
Last active January 18, 2019 01:58
A tiny example API written in Go using Martini and Redigo
package main
import (
"flag"
"fmt"
"net/http"
"github.com/codegangsta/martini"
"github.com/garyburd/redigo/redis"
"github.com/martini-contrib/render"