Skip to content

Instantly share code, notes, and snippets.

View jupierce's full-sized avatar

Justin Pierce jupierce

  • Red Hat
  • Raleigh, NC
View GitHub Profile
@jupierce
jupierce / generate_directory_index_caddystyle.py
Created August 12, 2021 19:47 — forked from glowinthedark/generate_directory_index_caddystyle.py
Generate directory index (recurse subfolders with `-r` or `--recursive`). Use `-h` or `--help` for all options
#!/usr/bin/env python3
# ---
# Copyright 2020 glowinthedark
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
[{'btype': 'image',
'btype_id': 4,
'build_id': 1182060,
'buildroot_id': 5921278,
'checksum': '15d264287484691efc28a407c069e7f2',
'checksum_type': 0,
'extra': {'docker': {'config': {'architecture': 'arm64',
'config': {'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
{'build_id': 1182060,
'cg_id': 1,
'cg_name': 'atomic-reactor',
'completion_time': '2020-05-01 14:59:35.914208',
'completion_ts': 1588345175.91421,
'creation_event_id': 31231571,
'creation_time': '2020-05-01 14:55:14.542148',
'creation_ts': 1588344914.54215,
'epoch': None,
'extra': {'container_koji_task_id': 28319352,
@jupierce
jupierce / conflicting.sh
Created April 7, 2020 17:24
Merge demonstrations
#!/bin/sh
set -e
#set -o xtrace
function set_version() {
v="$1"
if [[ -z "$2" ]]; then
msg="$cb commit of $v"
else
#!/bin/sh
iptables -w -C INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT || iptables -w -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -w -C INPUT -p icmp -j ACCEPT || iptables -w -A INPUT -p icmp -j ACCEPT
iptables -w -C INPUT -i lo -j ACCEPT || iptables -w -A INPUT -i lo -j ACCEPT
# Make sure ssh access is there
iptables -w -C INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT || iptables -w -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -w -C INPUT -j OS_FIREWALL_ALLOW || iptables -w -A INPUT -j OS_FIREWALL_ALLOW
for port in 10010 10250 10256 80 443 4789 "9000:10000" 1936; do
apiVersion: v1
items:
- apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
annotations:
image.openshift.io/triggers: |
[{"from":{"kind":"ImageStreamTag","name":"node:v3.11"},"fieldPath":"spec.template.spec.containers[?(@.name==\"openvswitch\")].image"}]
kubernetes.io/description: |
This daemon set launches the openvswitch daemon.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char **argv) {
int lookup[65536] = {1048576,983041,917505,917506,851969,851970,851970,851971,786433,786434,786434,786435,786434,786435,786435,786436,720897,720898,720898,720899,720898,720899,720899,720900,720898,720899,720899,720900,720899,720900,720900,720901,655361,655362,655362,655363,655362,655363,655363,655364,655362,655363,655363,655364,655363,655364,655364,655365,655362,655363,655363,655364,655363,655364,655364,655365,655363,655364,655364,655365,655364,655365,655365,655366,589825,589826,589826,589827,589826,589827,589827,589828,589826,589827,589827,589828,589827,589828,589828,589829,589826,589827,589827,589828,589827,589828,589828,589829,589827,589828,589828,589829,589828,589829,589829,589830,589826,589827,589827,589828,589827,589828,589828,589829,589827,589828,589828,589829,589828,589829,589829,589830,589827,589828,589828,589829,589828,589829,589829,589830,589828,589829,589829,589830,589829,589830,589830,589831,524289,5242
// First, download the proxy pac file locally (make sure to use RAW content)
// wget https://gist.githubusercontent.com/jupierce/f0f2cd8721c3fa4fbf08451e1003a6e6/raw -O /path/to/proxy.pac # Download git content to your home directory
// Second, use browser specific configuration steps
// ***Firefox****
// Open about:config in the URL bar.
// Configure 'network.proxy.autoconfig_url' setting to point to this gist 'file:///path/to/proxy.pac' for the setting's value.
#!/bin/bash
set -o xtrace
# CERT_FILE=./registry.apps.abutcher.com.crt KEY_FILE=./registry.apps.abutcher.com.key CA_FILE=./ca-chain.cert.pem ./regcerts.sh
DEST_CA="$(awk '{printf "%s\\n", $0}' /etc/origin/master/ca.crt)"
CERTIFICATE="$(awk '{printf "%s\\n", $0}' ${CERT_FILE})"
KEY="$(awk '{printf "%s\\n", $0}' ${KEY_FILE})"
CABUNDLE="$(awk '{printf "%s\\n", $0}' ${CA_FILE})"
I0914 13:58:13.770394 125324 round_trippers.go:383] PUT https://internal.api.free-int.openshift.com:443/api/v1/nodes/ip-172-31-49-31.ec2.internal
I0914 13:58:13.770408 125324 round_trippers.go:390] Request Headers:
I0914 13:58:13.770417 125324 round_trippers.go:393] User-Agent: oc/v1.7.0+695f48a16f (linux/amd64) kubernetes/d2e5420
I0914 13:58:13.770425 125324 round_trippers.go:393] Accept: application/json, */*
I0914 13:58:13.774175 125324 round_trippers.go:408] Response Status: 409 Conflict in 3 milliseconds
I0914 13:58:13.774190 125324 round_trippers.go:411] Response Headers:
I0914 13:58:13.774198 125324 round_trippers.go:414] Date: Thu, 14 Sep 2017 13:58:13 GMT
I0914 13:58:13.774204 125324 round_trippers.go:414] Cache-Control: no-store
I0914 13:58:13.774210 125324 round_trippers.go:414] Content-Type: application/json
I0914 13:58:13.774216 125324 round_trippers.go:414] Content-Length: 342