start new:
tmux
start new with session name:
tmux new -s myname
# Upsert function for pandas to_sql with postgres | |
# https://stackoverflow.com/questions/1109061/insert-on-duplicate-update-in-postgresql/8702291#8702291 | |
# https://www.postgresql.org/docs/devel/sql-insert.html#SQL-ON-CONFLICT | |
import pandas as pd | |
import sqlalchemy | |
import uuid | |
import os | |
def upsert_df(df: pd.DataFrame, table_name: str, engine: sqlalchemy.engine.Engine): |
""" | |
Export a Conda environment with --from-history, but also append | |
Pip-installed dependencies | |
Exports only manually-installed dependencies, excluding build versions, but | |
including Pip-installed dependencies. | |
Lots of issues requesting this functionality in the Conda issue tracker, | |
e.g. https://github.com/conda/conda/issues/9628 |
# Make Ctrl+\ the tmux leader combination | |
unbind C-b | |
set -g prefix "C-\\" | |
bind "C-\\" send-prefix | |
setw -g xterm-keys on | |
set -g default-terminal "screen-256color" | |
set -sg escape-time 0 | |
set -g base-index 1 | |
#!/usr/bin/env python | |
# An exponential backoff around Boto3 DynamoDB, whose own backoff eventually | |
# fails on long multipage scans. We'd like to use this as a wrapper somehow, | |
# see: https://gist.github.com/numberoverzero/cec21b8ca715401c5662 | |
from time import sleep | |
import boto3 | |
from boto3.dynamodb.conditions import Attr |
#!/usr/bin/env bash | |
# Put this file in the `bin` directory at the root of your project | |
source $BIN_DIR/utils | |
echo "-----> Starting corpora installation" | |
# Assumes NLTK_DATA environment variable is already set | |
# $ heroku config:set NLTK_DATA='/app/nltk_data' |
<VirtualHost *> | |
ServerName example.com | |
WSGIDaemonProcess www user=max group=max threads=5 | |
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi | |
<Directory /home/max/Projekte/flask-upload> | |
WSGIProcessGroup www | |
WSGIApplicationGroup %{GLOBAL} | |
Order deny,allow |