Skip to content

Instantly share code, notes, and snippets.

View stanislavb's full-sized avatar

Stanislav B stanislavb

View GitHub Profile
@stanislavb
stanislavb / .config_hadolint.yaml
Created May 18, 2021 12:01
Common config files
ignored:
- DL3018 # Pin versions in apk add
- DL3008 # Pin versions in apt-get install
@stanislavb
stanislavb / cheatsheet.md
Last active March 20, 2018 14:34
Kubernetes cheat sheet
@stanislavb
stanislavb / keybase.md
Created August 1, 2016 22:20
keybase.md

Keybase proof

I hereby claim:

  • I am stanislavb on github.
  • I am stanislavb (https://keybase.io/stanislavb) on keybase.
  • I have a public key ASAlfTIARWCXGdQpt-mPKIjzVh_ha7IA3OB61mBeaDDbKgo

To claim this, I am signing this object:

@stanislavb
stanislavb / ghost-footer.html
Created May 26, 2016 13:41
Ghost blog - better code tags
@stanislavb
stanislavb / nginx-vhost-docker-cloud.yml
Last active April 14, 2016 13:27
roleTerminal Docker Cloud stack file with vhost proxy
nginx-proxy:
image: 'jwilder/nginx-proxy:latest'
deployment_strategy: every_node
ports:
- '80:80'
restart: always
volumes:
- '/var/run/docker.sock:/tmp/docker.sock:ro'
@stanislavb
stanislavb / docker-cleanup.sh
Created April 12, 2016 11:12
Docker clean-up script for cron
#!/bin/bash
# Do not run if removal already in progress.
pgrep "docker rm" && exit 0
# Remove Dead and Exited containers.
docker rm $(docker ps -a | grep "Dead\|Exited" | awk '{print $1}'); true
# It will fail to remove images currently in use.
docker rmi $(docker images -qf dangling=true); true
@stanislavb
stanislavb / s3sign.py
Last active September 14, 2015 14:30
Generate pre-signed URL for S3 upload
#!/usr/bin/env python3
import boto3
import argparse
import os.path
import logging
import sys
logger = logging.getLogger()
s3 = boto3.resource('s3')
@stanislavb
stanislavb / mongoconsole.sh
Last active February 10, 2023 16:34
Backup and restore MongoDB running in a Docker container
#!/bin/bash
usage() {
echo "Usage $0 -c mongo_docker_container_name"
}
while [[ $# > 1 ]]
do
key="$1"
@stanislavb
stanislavb / rolehaven-compose.yml
Last active August 29, 2015 14:25
Rolehaven docker hosting
db:
image: mongo
volumes:
- /data/db
rolehaven:
image: yxeri/rolehaven:stable
environment:
- DBHOST=db
- VIRTUAL_HOST=terminal.example.com
@stanislavb
stanislavb / get_docker_image_json.py
Created July 11, 2015 22:21
Get Docker image object
#!/usr/bin/env python
import argparse
from docker import Client
import json
if __name__ == "__main__":
c = Client(base_url='unix://var/run/docker.sock')
parser = argparse.ArgumentParser()
parser.add_argument('image')