sudo apt-get install python3-pip
sudo pip3 install virtualenv
#!/bin/bash | |
set -euo pipefail | |
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem | |
openssl rsa -in privkey.pem -passin pass:abcd -out server.key | |
openssl req -x509 -in server.req -text -key server.key -out server.crt | |
chmod 600 server.key | |
test $(uname -s) = Linux && chown 70 server.key | |
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key |
import numpy as np | |
def whiten(X, method='zca'): | |
""" | |
Whitens the input matrix X using specified whitening method. | |
Inputs: | |
X: Input data matrix with data examples along the first dimension | |
method: Whitening method. Must be one of 'zca', 'zca_cor', 'pca', |
function gmailAutoarchive() { | |
var delayDays = 2; // will only impact emails more than 48h old | |
var maxDate = new Date(); | |
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time? | |
// Get all the threads labelled 'autoarchive' | |
var label = GmailApp.getUserLabelByName("autoarchive"); | |
var threads = label.getThreads(0, 400); | |
<?php | |
/** | |
* Plugin Name: Registration Order Link for WooCommerce | |
* Plugin URI: http://skyver.ge/5S | |
* Description: Automatically links previous orders to new customer accounts upon WooCommerce registration. | |
* Author: SkyVerge | |
* Author URI: http://www.skyverge.com/ | |
* Version: 1.0.0 | |
* Text Domain: link-wc-orders | |
* |
from dictalchemy import make_class_dictable | |
from flask import Flask, request, jsonify, json | |
from flask_sqlalchemy import SQLAlchemy | |
from jsonpatch import JsonPatch, JsonPatchException | |
app = Flask(__name__) | |
app.debug = True | |
db = SQLAlchemy(app) | |
make_class_dictable(db.Model) |
# Install dependencies | |
# | |
# * checkinstall: package the .deb | |
# * libpcre3, libpcre3-dev: required for HTTP rewrite module | |
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module | |
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \ | |
mkdir -p ~/sources/ && \ | |
# Compile against OpenSSL to enable NPN |