This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from base64 import b64encode | |
class AsgiLazySecure: | |
def __init__(self, app, key, ignore_paths=[]): | |
self.app = app | |
self.bearer = f"Bearer {key}" | |
_basic = b64encode(f"{key}:".encode()).decode() | |
self.basic = f"Basic {_basic}" | |
self.ignore_paths = ignore_paths |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM _ | |
LABEL maintainer="_" | |
# > Install and check versions | |
# > Install | |
# > Install jq | |
# > Install packages | |
# > Copy file | |
# > Build Args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
from __future__ import absolute_import | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
import json | |
import uuid | |
import time | |
import gevent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: be fe | |
be: | |
git -C backend pull | |
docker build -t be backend | |
BUILD_ID=$(shell docker image inspect be | jq .[0].Id) | |
UPLOADED_ID=$(shell ssh DESTINATION docker image inspect be | jq .[0].Id) | |
if [ "$$BUILD_ID" != "$$UPLOADED_ID" ]; then \ | |
docker save be | bzip2 | pv | ssh DESTINATION docker load; \ | |
fi | |
fe: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _package = require('./package') | |
let docker | |
try { | |
docker = require('./.version.json') | |
} catch (_) { | |
// NOTE(minho): Try to get the labels from docker.sock? | |
// https://stackoverflow.com/questions/37439887/how-to-access-the-metadata-of-a-docker-container-from-a-script-running-inside-th | |
docker = {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
{ set +x; } 2>/dev/null | |
IFS=$'\n' | |
set "$@" $(find ~ -name ".*" ! -name ".CFUserTextEncoding" ! -type l -mindepth 1 -maxdepth 1) # dotfiles | |
set "$@" $(find ~ -name "Google *" -mindepth 1 -maxdepth 1) # Google Drive | |
set "$@" ~/git # store on github/etc :) | |
set "$@" ~/node_modules | |
set "$@" ~/Applications # install apps with brew cask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Script to (selectively) save/load multiple Docker images to/from a directory. | |
# Run ./save-load-docker-images.sh for help. | |
set -e | |
directory=$PWD | |
filter="" | |
compress=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
info: reading kernel config from defconfig.x86_64 ... | |
Generally Necessary: | |
- cgroup hierarchy: properly mounted [/sys/fs/cgroup] | |
- CONFIG_NAMESPACES: enabled | |
- CONFIG_NET_NS: enabled | |
- CONFIG_PID_NS: enabled | |
- CONFIG_IPC_NS: enabled | |
- CONFIG_UTS_NS: enabled | |
- CONFIG_CGROUPS: enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74,75c74 | |
< CONFIG_POSIX_MQUEUE=y | |
< CONFIG_POSIX_MQUEUE_SYSCTL=y | |
--- | |
> # CONFIG_POSIX_MQUEUE is not set | |
143,145c142,143 | |
< CONFIG_BUILD_BIN2C=y | |
< CONFIG_IKCONFIG=m | |
< CONFIG_IKCONFIG_PROC=y | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d | |
# delete all evicted pods from all namespaces | |
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
# delete all containers in ImagePullBackOff state from all namespaces | |
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces |
NewerOlder