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 | |
set -e | |
### BEGIN INIT INFO | |
# Provides: docker | |
# Required-Start: $syslog $remote_fs | |
# Required-Stop: $syslog $remote_fs | |
# Should-Start: cgroupfs-mount cgroup-lite | |
# Should-Stop: cgroupfs-mount cgroup-lite | |
# Default-Start: 2 3 4 5 |
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
for img in $(docker-compose -f some-docker-composecompose.yml images -q); do fn=$(docker inspect $img | jq -r '.[] | .RepoTags | .[-1]' | sed -r 's/[\/]+/_/g'); docker image save $img > gqip > /docker/dump/$fn.tar.gz; done |
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
docker rmi $(docker images -f 'dangling=true' -q) |
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 | |
vals="" | |
while read -r line ; do | |
val=$(echo $line | cut -d= -f2) | |
vals+="$val " | |
done < <(env | grep ENV) | |
for val in $vals ; do | |
echo "Found val $val" |
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 datetime import datetime | |
from pytz import UTC | |
from pytz import timezone | |
def utc_tz_diff(tz): | |
diff = (t1 := UTC.localize(now := datetime.utcnow())) - (t2 := timezone(tz).localize(now).astimezone(UTC)) | |
return f"{'+' if t1 > t2 else '-'}{diff.seconds // 3600:02}:{diff.seconds // 60 % 60:02}" if diff.seconds else "Z" |
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
version: '3.7' | |
services: | |
nginx: | |
image: nginx:alpine | |
command: > | |
sh -c " | |
apk add openssl && | |
mkdir -p /var/www/backend/certs/ && | |
cd /var/www/backend/certs/ && |
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/bash | |
TOKEN="..." | |
ORG="..." | |
for repo in */ ; do | |
repo_name=$(echo $repo | sed 's/\///') | |
echo "Found folder $repo_name" | |
cp LICENSE $repo_name/LICENSE |
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 aiohttp import web | |
from aiohttp_oauth2.client.contrib import oauth2_app | |
from aiohttp_session import SimpleCookieStorage, get_session, setup as session_setup | |
async def index(request: web.Request): | |
session = await get_session(request) | |
return web.json_response({"user": session.get("user")}) |
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
$ apm list --installed | |
Community Packages (15) ~/.atom/packages | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] |
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
rabbitmqctl list_queues | sort -r | awk '{if (length($1) == 36) print $1}' | while read queue ; do rabbitmqctl delete_queue $queue & done |
NewerOlder