Skip to content

Instantly share code, notes, and snippets.

@Wavefarer42
Wavefarer42 / docker-compose.yml
Created January 22, 2019 10:04
MongoDB Charts (docker-compose)
version: "3.3"
services:
mongo:
image: mongo:4.1.1
restart: on-failure
command: --wiredTigerCacheSizeGB 3
ports:
# Charts db is available under port 27018 to not block the default mongo port
- "8082:8081"
@caraboides
caraboides / backup-mongodb-to-s3.sh
Last active August 2, 2023 06:11
Simple script to backup MongoDB to S3, without waste diskspace for temp files. And a way to restore from the latest snapshot.
#!/bin/sh
set -e
HOST=localhost
DB=test-entd-products
COL=asimproducts
S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/"
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz
S3LATEST=$S3PATH"latest".dump.gz
/usr/bin/aws s3 mb $S3PATH
@alferov
alferov / docker-rm-images.md
Last active July 24, 2023 08:33
Remove all (untagged) images and containers from Docker
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")

References:

from botocore.credentials import RefreshableCredentials
from botocore.session import get_session
from boto3 import Session
def assumed_session(role_arn, session_name, session=None):
"""STS Role assume a boto3.Session
With automatic credential renewal.
@andrewsomething
andrewsomething / assign-ip.py
Last active May 18, 2021 10:38
Assign a DigitalOcean Floating IP to a Droplet
#!/usr/bin/python
import os
import sys
import requests
import json
api_base = 'https://api.digitalocean.com/v2'
@christopheranderton
christopheranderton / github-brand-colors-aug-2015.css
Last active April 28, 2020 19:30
Official Github Brand Colors (August 20, 2015) from the GitHub internal CSS framework (Primer) version 2.3.3 at: http://primercss.io/colors/ [Note: Photoshop users. You can download the raw file (.css) and import the swatches just like a .aco file (more recent versions of Photoshop).
/* # OFFICIAL GITHUB BRAND COLORS
--------------------------------------------------------------------
Official Github Brand Colors (August 20, 2015) from the
GitHub internal CSS framework (Primer) version 2.3.3
Source URI: http://primercss.io/colors/
1.a = Github Branding Color Swatches
-------------------------------------------------------------------- */
.swatch-github-blue {
background-color:#4078c0;
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@msurguy
msurguy / List.md
Last active April 30, 2024 15:14
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: