Skip to content

Instantly share code, notes, and snippets.

View clifton's full-sized avatar
🎯

Clifton King clifton

🎯
View GitHub Profile
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
run-ci:
runs-on: ubuntu-latest
class EnumDirectValueMeta(EnumMeta):
def __getattribute__(cls, name):
value = super().__getattribute__(name)
if isinstance(value, cls):
value = value.value
return value
def __iter__(self):
for item in super().__iter__():
yield item
version: "3.7"
services:
traefik:
image: traefik:v2.4
container_name: traefik
networks:
- web
ports:
#!/bin/bash
# sudo crontab -e
# insert at top of crontab: SHELL=/bin/bash
# */1 * * * * /bin/check-net >> /var/log/check-net.log 2>&1
if ! (/usr/bin/dig +short myip.opendns.com @resolver1.opendns.com > /dev/null) ; then
echo $(date) - check-net failed. restarting...
killall wpa_supplicant
sleep 2
/usr/sbin/netplan apply
@clifton
clifton / robbyrussell-hostname.zsh-theme
Last active May 5, 2022 17:53 — forked from SteelPangolin/robbyrussell-hostname.zsh-theme
Tweak robbyrussell ZSH theme to prepend hostname
if [[ -n $SSH_CONNECTION ]]; then
local hostname="%{$fg_bold[black]%}%m "
else
local hostname=""
fi
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
PROMPT='${hostname}${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
@clifton
clifton / docker-compose.yml
Last active January 31, 2021 00:35
lighthouse beacon + validator
version: "3.8"
services:
lighthouse-base:
image: sigp/lighthouse
volumes:
- .lighthouse:/root/.lighthouse
- ./validator_keys:/root/validator_keys
command: echo ok
beacon:
extends: lighthouse-base
@clifton
clifton / Dockerfile
Last active January 5, 2020 17:59
ue4 dockerfile
# place in ./Docker in project folder with other resources (ie steamclient.so) / start scripts
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu18.04
# Add a sentinel label so we can easily identify all derived images, including intermediate images
LABEL com.clifton.ue4.sentinel="1"
# Disable interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install our build prerequisites
const _ = require('lodash');
export default class MemcachedStore {
constructor (memcached, { keyPrefix, ttl = 15 * 60 }) {
this.memcached = memcached;
this.keyPrefix = keyPrefix;
this.ttl = ttl;
this.queuedGets = {};
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.