We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
SELECT table, | |
formatReadableSize(sum(bytes)) as size, | |
min(min_date) as min_date, | |
max(max_date) as max_date | |
FROM system.parts | |
WHERE active | |
GROUP BY table |
# To list installed distributions | |
wsl -l | |
wsl --list | |
# To list installed distributions along with its running status and wsl config being 1 or 2 | |
wsl -l --verbose | |
wsl -l -v | |
# To run a specific distro | |
wsl -d distro_name |
# change to postgres user and open psql prompt | |
sudo -u postgres psql postgres | |
# list databases | |
postgres=# \l | |
# list roles | |
postgres=# \du | |
# create role |
import luigi | |
import time | |
class TimeTaskMixin(object): | |
''' | |
A mixin that when added to a luigi task, will print out | |
the tasks execution time to standard out, when the task is | |
finished | |
''' | |
@luigi.Task.event_handler(luigi.Event.PROCESSING_TIME) |
We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc
Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server
Use this link and get $10 free. Just select the $5 plan unless this a production app.
# Redis Cheatsheet | |
# All the commands you need to know | |
redis-server /path/redis.conf # start redis with the related configuration file | |
redis-cli # opens a redis prompt | |
# Strings. |
man COMMAND # Look up help for the given command | |
pwd # Print working directory | |
cd MYDIR # Change directory to MYDIR | |
cd ~/ # Change directory to user root (/Users/USERNAME) | |
cd .. # Change directory up a level | |
mkdir NEWDIR # Create a new directory in the current folder called NEWDIR | |
cp FROM_FILE TO_FOLDER # Copy FROM_FILE into TO_FOLDER | |
cp -r FROM_DIR TO_FOLDER # Copy FROM_DIR into TO_FOLDER |