Skip to content

Instantly share code, notes, and snippets.

@cbluth
cbluth / main.go
Created January 7, 2018 17:48 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@cbluth
cbluth / https.go
Created January 7, 2018 17:58 — forked from kennwhite/https.go
Simple https http/2 static web server with HSTS & CSP (A+ SSLLabs & securityheaders.io rating) in Go using LetsEncrypt acme autocert
package main
import (
"crypto/tls"
"golang.org/x/crypto/acme/autocert"
"log"
"net"
"net/http"
)
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: internal-docker-registry
labels:
app: docker-registry
type: development
spec:
replicas: 1
selector:
@cbluth
cbluth / vineScrape.go
Created March 31, 2018 22:36 — forked from cryptix/vineScrape.go
extract a javascript object value from a html page using goquery and otto
package main
import (
"errors"
"log"
"os"
"github.com/PuerkitoBio/goquery"
"github.com/robertkrimen/otto"
)

DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.

In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.

Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud, open source and business](https://blogs.the451group.com/opensource/2010/03/03/devops-mixing-dev-ops-agile-cloud-open-source-and-busi

normal-user@ubuntu:~$ sudo -i
root@ubuntu:~# lastlog | grep cobin
root@ubuntu:~# adduser cobin
Adding user `cobin' ...
Adding new group `cobin' (1001) ...
Adding new user `cobin' (1001) with group `cobin' ...
Creating home directory `/home/cobin' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: # create a password
Retype new UNIX password: # same password
@cbluth
cbluth / Loader_1_0_0.idc
Created April 28, 2018 10:12 — forked from SciresM/Loader_1_0_0.idc
IDCs for the Nintendo Switch's "Loader" sysmodule.
This file has been truncated, but you can view the full file.
#define UNLOADED_FILE 1
#include <idc.idc>
static main(void)
{
// set 'loading idc file' mode
set_inf_attr(INF_GENFLAGS, INFFL_LOADIDC|get_inf_attr(INF_GENFLAGS));
GenInfo(); // various settings
Segments(); // segmentation
Enums(); // enumerations
#!/usr/bin/env bash
# /etc/libvirt/hooks/network
# https://www.libvirt.org/hooks.html
if [[ "$2" == "started" || "$2" == "plugged" || "$2" == "updated" ]] ; then
/sbin/iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable || true
/sbin/iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable || true
fi
@cbluth
cbluth / network-restart.sh
Created June 2, 2018 18:42 — forked from tachang/network-restart.sh
Cleanly restart the default libvirt network
#!/bin/bash
#
# Yury V. Zaytsev <yury@shurup.com> (C) 2011
#
# This work is herewith placed in public domain.
#
# Use this script to cleanly restart the default libvirt network after its
# definition have been changed (e.g. added new static MAC+IP mappings) in order
# for the changes to take effect. Restarting the network alone, however, causes
# the guests to lose connectivity with the host until their network interfaces
@cbluth
cbluth / remove_apt_cache
Created June 4, 2018 19:25 — forked from marvell/remove_apt_cache
Remove APT cache (for Dockerfile)
apt-get clean autoclean
apt-get autoremove --yes
rm -rf /var/lib/{apt,dpkg,cache,log}/