Skip to content

Instantly share code, notes, and snippets.

Working from home

Diego Quintana diegoquintanav

Working from home
View GitHub Profile
import argparse
import json
import os
import re
import threading
from pathlib import Path
import numpy as np
import pandas as pd
import requests
diegoquintanav /
Created Mar 19, 2021
change mount point for docker containers

I want docker to stop using my root partition for storing docker containers, and use a different partition instead, e.g. /home

These steps worked for me:

  1. Stop all containers sudo docker stop $(docker ps -a -q)
  2. Stop docker sudo service docker stop
  3. Copy docker directory cp -r /var/lib/docker/* /home/docker/
  4. Unmount all old docker overlays umount -f /var/lib/docker/overlay/ and umount -f /var/lib/docker/containers/*/mounts/shm
  5. Change in/etc/docker/daemon.json graph to new path
diegoquintanav / convert-to-pdf
Last active Jan 17, 2021
shrink slides or pdfs to nxm sheets per page
View convert-to-pdf
# converts to pdf all txt files in a folder
# and produces a single pdf of all of them together
for filename in $(ls *.txt); do
libreoffice --convert-to "pdf" "$filename"
diegoquintanav /
Last active Dec 3, 2020
docker-compose for graph-tool
View news-count.csv
We can't make this file beautiful and searchable because it's too large.
5785, 0
11, 0,0
1, 0,0,0
1, 0,0,100,100
8, 0,1
1, 0,24
1, 0,8192
87, 0.0
49, 0.00
diegoquintanav /
Created Sep 21, 2019
Toy postgres instance with `pgadmin4` and docker compose

Getting a postgres instance with pgadmin4 🐘 and docker-compose 🐳

  1. Use Linux and have docker and docker-compose installed.
  2. Create a folder
  3. Put docker-compose.yml and servers.json
  • Optional: Put a SQL script to be executed at first run from the db service.
  1. docker-compose up -d
  2. Go to and login with and test as password
  3. Access the database with the test password
  4. You have a database to play!
diegoquintanav /
Last active Sep 21, 2019
working around Jutge's evaluation method

Given the requirements.txt file


Consider the palindrome problem in

diegoquintanav /
Last active Aug 30, 2019
events describing error using an interactive rebase, and going back

So I messed up with git


  1. Everything is under control
  2. Did an interactive rebase to move a commit to the base of my branch, forgot to include merge commits
  3. Lost my merge commits
  4. Tried to go back with git reset --hard and reflog
  5. Ended up at the base of my branch, with my unrebased commits dangling after it
  6. Want to move back to step 0, and hopefully do step 1 again, but including merge commits.
diegoquintanav /
Last active Oct 15, 2020
Defining a footer with flask-bootstrap
import sys [0/6141]
"""A simple python implementation of the FizzBuzz problem.
*caveat*: It considers zero as divisible by three and five