Skip to content

Instantly share code, notes, and snippets.

View diegoquintanav's full-sized avatar
🐢
Working from home

Diego Quintana diegoquintanav

🐢
Working from home
View GitHub Profile
@diegoquintanav
diegoquintanav / mountdocker.md
Last active May 20, 2023 12:01
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. Add or update /etc/docker/daemon.json with
@taiwotman
taiwotman / flasks_py2neo.py
Last active December 31, 2022 15:45
FlaskLogin Neo4j
from __future__ import absolute_import
from flask import current_app
from py2neo import Graph
import os
username = os.environ.get('NEO4J_USERNAME')
password = os.environ.get('NEO4J_PASSWORD')
class Py2Neo(object):
def __init__(self, app=None):
@deehzee
deehzee / autoreload.md
Last active December 1, 2021 19:48
Auto reload of modules in jupyter notebook

Module autoreload

To auto-reload modules in jupyter notebook (so that changes in files *.py doesn't require manual reloading):

# for auto-reloading external modules
# see http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython
%load_ext autoreload
%autoreload 2
@first087
first087 / README.md
Created December 29, 2016 02:21
Script for attach drive D: into Docker Toolbox for Windows

How to use script

  1. Run Docker Toolbox from shortcut Docker Quickstart Terminal
  2. Shutdown boot2docker docker-machine stop
  3. Open VirtualBox and goto Settings of default machine
  4. At Shared Folders menu, click + icon, Select folder path to drive D: and set folder name is d, checked all options
  5. Copy attach-drive-d.sh script to Docker Toolbox folder (C:\Program Files\Docker Toolbox)
  6. Edit start.sh add command sh attach-drive-d.sh before finalize step
  7. Run Docker Toolbox from shortcut Docker Quickstart Terminal again
  8. Have fun!!!
@ivanleoncz
ivanleoncz / flask_app_logging.py
Last active May 23, 2021 07:25
Demonstration of logging feature for a Flask App.
#/usr/bin/python3
""" Demonstration of logging feature for a Flask App. """
from logging.handlers import RotatingFileHandler
from flask import Flask, request, jsonify
from time import strftime
__author__ = "@ivanleoncz"
import logging
@barseghyanartur
barseghyanartur / install-xapian.sh
Last active November 16, 2024 17:25 — forked from areski/install-xapian
Install xapian Core and Bindings with Python support on Ubuntu 14.04 LTS
# *****************************************************
# ***************** Install xapian Core ***************
# *****************************************************
sudo apt-get install zlib1g-dev
sudo apt-get install g++
sudo apt-get install uuid-dev
curl -O http://oligarchy.co.uk/xapian/1.2.18/xapian-core-1.2.18.tar.xz
curl -O http://oligarchy.co.uk/xapian/1.2.18/xapian-bindings-1.2.18.tar.xz
@freakboy3742
freakboy3742 / rapid-mobile-development.rst
Last active December 8, 2022 11:22
Rapid Mobile Application Development with Python

Rapid mobile application development with Python

While there are examples of Python-based apps in mobile App stores, the knowledge of how to actually create a mobile app in Python hasn't been well documented, or simplified for mass use - until now.

In this talk, Dr Russell Keith-Magee will demonstrate a collection of tools from the BeeWare Project that enable you to build a cross-platform mobile app using Python in a matter of minutes.

Audience

@brock
brock / psql-with-gzip-cheatsheet.sh
Last active September 5, 2024 23:48
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@Bekbolatov
Bekbolatov / tmux.md
Last active October 7, 2024 04:03
Clean tmux cheat-sheet

Clean tmux cheat-sheet

By resources

sessions

list-sessions        ls         -- List sessions managed by server
new-session          new        -- Create a new session