Skip to content

Instantly share code, notes, and snippets.

View mrprompt's full-sized avatar
🏠
Working from home

Thiago Paes mrprompt

🏠
Working from home
View GitHub Profile
@mrprompt
mrprompt / docker-cleanup-resources.md
Created June 4, 2018 19:23 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mrprompt
mrprompt / gist:65fbdd2135a2c5b2bebbfd2e9ffef69b
Last active May 15, 2018 17:02
Automatic update configuration for dyndns

Automatic update configuration for dyndns

Get dynamic DNS account

DLink offers free dyn.com dynamic DNS accounts for any user for a single hostname on dlinkddns.com domain (it's still possible to get a similar account directly from dyn, but more complex). Create the account and the host on https://www.dlinkddns.com/login.

Hostname : xxxxx.dlinkddns.com username : dlinkusername password ! dlinkpassword

Download ddclient

#!/usr/bin/env python
import hashlib
import hmac
import time
import requests
import datetime
# Q. Do you have A Websocket API?
# A. Yes, and we strongly recommend you to use it. Please, check our JavaScript websocket implementation for our WebSocket API here:
# https://github.com/blinktrade/frontend/blob/master/jsdev/bitex/api/bitex.js
@mrprompt
mrprompt / Config file for sSMTP sendmail
Last active October 19, 2017 14:53 — forked from apisznasdin/Config file for sSMTP sendmail
Config file for sSMTP sendmail using Mandrill
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=user@domain.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.mandrillapp.com:587
@mrprompt
mrprompt / schema_clone.py
Created August 4, 2017 16:03 — forked from rabbitt/schema_clone.py
PostgreSQL schema cloner (including data).
import psycopg2 as pg
from io import BytesIO
from collections import defaultdict
from contextlib import contextmanager
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED
READ_COMMIT = ISOLATION_LEVEL_READ_COMMITTED
AUTO_COMMIT = ISOLATION_LEVEL_AUTOCOMMIT