Skip to content

Instantly share code, notes, and snippets.

View fierroformo's full-sized avatar

Alejandro Betancourt fierroformo

  • Yoconciente
  • Valparaíso Zacatecas
View GitHub Profile
@fierroformo
fierroformo / SchemaSpy-HOWTO.md
Created June 6, 2017 16:54 — forked from dpapathanasiou/SchemaSpy-HOWTO.md
How to use SchemaSpy to generate the db schema diagram for a PostgreSQL database

SchemaSpy is a neat tool to produce visual diagrams for most relational databases.

Here's how to use it to generate schema relationship diagrams for PostgreSQL databases:

  1. Download the jar file from here (the current version is schemaSpy_5.0.0.jar)

  2. Get the PostgreSQL JDBC driver (either the JDBC3 or JDBC4 jar file is fine)

  3. Run the command against an existing database. For most databases, the schema (-s option) we are interested in is the public one:

@fierroformo
fierroformo / gist:ae536bc4b312c142cb40d96fca243a47
Created June 10, 2020 05:16 — forked from sweenzor/gist:2933958
Kill all celery tasks (redis)
# nuke the queue
redis-cli FLUSHALL
# nuke anything currently running
pkill -9 celeryd
@fierroformo
fierroformo / log_db_queries.py
Created September 18, 2023 18:17 — forked from bak1an/log_db_queries.py
django decorator for logging db queries
# simple decorator for logging out django db queries
# just put it along with other decorators before view or
# db-loading stuff. than go to your console and see whats going on.
# example:
#
# @log_db_queries
# @login_required
# def your_view(request, args...):
# your stuff
def log_db_queries(f):