Skip to content

Instantly share code, notes, and snippets.

View brennv's full-sized avatar

Brennan Vincello brennv

View GitHub Profile
@brennv
brennv / emojiparty.zsh-theme
Last active September 3, 2022 08:09 — forked from oshybystyi/random-emoji.zsh-theme
An emoji happy oh-my-zsh theme: a blend of random-emoji and terminalparty
# emojiparty: a blend of random-emoji and terminalparty
PROMPT_EMOJI=(🐶 🐱 🐭 🐹 🐰 🐻 🐼 🐨 🐯 🦁 🐮 🐷 🐽 🐵 🙈 🙉 🙊 🐒 🐔 🐧 \
🐦 🐤 🐣 🐥 🐺 🐗 🐴 🦄 🐝 🐛 🐌 🐜 🕷 🦂 🐠 🐟 🐡 🐬 🐳 🐋 🐆 🐅 🐃 🐂 \
🐄 🐪 🐫 🐘 🐐 🐏 🐑 🐎 🐖 🐀 🐁 🐓 🦃 🕊 🐕 🐩 🐈 🐇 🐿 🎋 🍂 🌾 🌺 \
🌻 🌷 🌼 🌸 💐 🌰 🎃 🐚 🕸 🚕 🚙 🚌 🚎 🚓 🚑 🚐 🚚 🚜 🏍 🚲 🚔 🚍 🚘 🚖 \
🚡 🚟 🚃 🚋 🚅 🚈 🚞 🚆 🚇 🚊 🚉 🚁 🛩 🛫 🛬 ⛵️ 🛥 🚤 ⛴ 🛳 🚀 🛰 💺 🚧 \
😀 😬 😁 😃 😄 😅 😆 😇 😉 😊 🙂 🙃 😋 😌 😍 😘 😗 😙 😚 😜 😝 😛 🤑 🤓 \
😎 🤗 😏 😶 😐 😑 😒 🙄 🤔 😳 😞 😟 😠 😔 😕 🙁 😣 😖 😯 😦 😧 😵 😲 🤐 \
😷 🤒 🤕 😴 💤 💀 👽 🤖 😺 😸 😻 😼 😽 😾 ⚽️ 🏀 🏈 🏐 🏉 🎱 🏌 🏸 🏒 🏑 \
@brennv
brennv / Vagrantfile
Created January 27, 2016 04:34 — forked from drgarcia1986/Vagrantfile
Hello World with Ansible and Vagrant
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.provision :ansible do |ansible|
@brennv
brennv / inpect-node.md
Last active May 9, 2016 17:24
Inspecting OpenShift nodes

Inspecting nodes

pprof is an extension of gperftools, a high-performance multi-threaded malloc implementation

Prerequisites

  • Add OPENSHIFT_PROFILE=web to /etc/sysconfig/atomic-openshift-node, openshift-master or origin-master
  • Restart OpenShift

In the event of a hung pod

import os
import time
from datetime import datetime, timedelta
from tzlocal import get_localzone
def check_file_time_elpased(file_path):
ctime = time.ctime(os.path.getmtime(file_path))
last_updated = datetime.strptime(ctime), "%a %b %d %H:%M:%S %Y")
tz = get_localzone()
then = tz.normalize(tz.localize(last_updated))
import ephem
def is_daytime(city):
sun = ephem.Sun()
locale = ephem.city(city)
sun.compute(locale)
twilight = -12 * ephem.degree
is_sunlight = sun.alt > twilight
return is_sunlight
@brennv
brennv / rh-openshift-error-codes.txt
Created May 24, 2016 20:04 — forked from caruccio/rh-openshift-error-codes.txt
RedHat Openshift error codes (extracted from source files - grep+python). Neither comprehensive or 100% correct, but it is a start...
SHOW_APPLICATION:
404 Not Found:
101: "Application '#{id}' not found"
127: "Domain '#{domain_id}' not found"
UPDATE_CARTRIDGE:
404 Not Found:
163: "Cartridge '#{cartridge_name}' for application '#{app_id}' not found"
101: "Application '#{app_id}' not found for domain '#{domain_id}'"
# Aggregate connection stats between source and destination apps
tshark -n -r example-file.pcap -T fields -e ip.src -e ip.dst -e tcp.dstport "tcp.flags == 0x0002" | sort | uniq -c | sort -nr
@brennv
brennv / docker-compose.yaml
Last active July 5, 2016 19:46
Example local dev setup with arangodb
# Consider adding image: jwilder/nginx-proxy for managing routes
version: '2'
services:
arangodb:
image: arangodb/arangodb:3.0.0
ports:
- "8529:8529"
environment:
- ARANGO_NO_AUTH=1
app:
@brennv
brennv / gist:fb6e167d14f3718c6dc0bafbcd43b3df
Created August 3, 2016 07:03 — forked from ehazlett/gist:9241844
OpenShift Origin AWS

OpenShift Origin in AWS

This describes deploying and running OpenShift Origin in Amazon Web Services.

This is based upon the code and installer on 2014-02-26 so YMMV.

We will be using a VPC for deployment in us-east-1 and Route53 for DNS. I will leave the VPC setup as an exercise for the reader.

Prerequisites

  • AWS Account
  • VPC
@brennv
brennv / app.py
Last active April 8, 2017 00:54
Session Interface example for url-based session max_age flip-flopping in Flask
from werkzeug.datastructures import CallbackDict
from flask.sessions import SessionInterface, SessionMixin
from itsdangerous import URLSafeTimedSerializer, BadSignature
from datetime import datetime, timedelta
class ItsdangerousSession(CallbackDict, SessionMixin):
def __init__(self, initial=None):
def on_update(self):
self.modified = True
CallbackDict.__init__(self, initial, on_update)