Skip to content

Instantly share code, notes, and snippets.

@caiges
caiges / Makefile
Created August 20, 2020 19:13
Makefile help target
.PHONY: help
help: ## Display this help section
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-38s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@caiges
caiges / devstack-arch.sh
Last active May 14, 2020 16:16
OpenStack DevStack on Arch
yay -S --noconfirm libvirt ebtables dnsmasq bridge-utils
sudo virsh net-define /etc/libvirt/qemu/networks/default.xml
cat <<EOF>devstack-lxc.conf
# Permit access to /dev/loop*
lxc.cgroup.devices.allow = b 7:* rwm
# Setup access to /dev/net/tun and /dev/kvm
lxc.mount.entry = /dev/net/tun dev/net/tun none bind,create=file 0 0
lxc.mount.entry = /dev/kvm dev/kvm none bind,create=file 0 0
@caiges
caiges / gist:637820
Created October 21, 2010 02:31
nifty django modeling
"" From external_apps/products/models.py ""
from django.db import models
from django.contrib.auth.models import User
class BaseProduct(models.Model):
name = models.CharField(max_length = 100, blank = False, null = False)
description = models.CharField(max_length = 200, blank = True, null = True, default = None)
long_description = models.TextField(blank = True, null = True, default = None)
product_details = models.TextField(blank = True, null = True, default = None)
@caiges
caiges / gist:ed6d9215d41b3e7180f1cb555c645417
Created May 23, 2019 16:06
coredns-proxy-fallback-plugin-build
Step 1/9 : FROM golang:1.12 AS builder
---> 7ced090ee82e
Step 2/9 : RUN mkdir -p /usr/src
---> Running in 8c536b9b7e8c
Removing intermediate container 8c536b9b7e8c
---> 2d38ebf7a52a
Step 3/9 : RUN git clone --branch v1.5.0 https://github.com/coredns/coredns /usr/src/coredns
---> Running in 1b719c7e213e
Cloning into '/usr/src/coredns'...
Note: checking out 'e3f9a80b1d5a112907a012acee276e9080b32852'.
tags:
- infrastructure-deployer
variables:
ENV: ""
TERRAFORM_BRANCH: "master"
stages:
- clone
- image
pipeline {
agent { label 'infrastructure-deployer' }
parameters {
string(name: 'ENV', description: 'The environment to deploy')
string(name: 'TERRAFORM_BRANCH', defaultValue: 'master', description: 'The infrastructure branch to deploy')
}
stages {
stage('clone infrastructure') {
steps {
checkout poll: false, scm: [$class: 'GitSCM',

Keybase proof

I hereby claim:

  • I am caiges on github.
  • I am caiges (https://keybase.io/caiges) on keybase.
  • I have a public key ASBKvy3w14-6ZNLPQtkroyCa4CXc_LUm9tZWz4OOrsN5tgo

To claim this, I am signing this object:

{
"color_scheme": "Packages/User/SublimeLinter/Solarized (Light) (SL).tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 8,
"ignored_packages":
[
"Vintage"
],
"theme": "Hero Dark.sublime-theme",
"translate_tabs_to_spaces": true,
@caiges
caiges / gist:5913747
Created July 2, 2013 22:17
Firefox profile for the Python Selenium driver. This ignores untrusted certs and bypasses default browser checks.
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
class Firefox(webdriver.Firefox):
def __init__(self, accept_untrusted_certs = True):
binary = FirefoxBinary(firefox_path = '/Users/cnichols/Applications/Firefox.app/Contents/MacOS/firefox')
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = accept_untrusted_certs
profile.set_preference('browser.shell.checkDefaultBrowser', False)
{
"color_scheme": "Packages/Dimmed Color Scheme/dimmed-monokai.tmTheme",
"font_face": "Source Code Pro",
"font_size": 12,
"ignored_packages":
[
],
"tab_size": 2,
"theme": "Piatto Dark.sublime-theme",
"translate_tabs_to_spaces": true,