Before you start
Install packages on your Synology with the Package Manager
- Docker
- Git
import numpy as np | |
def find_runs(x): | |
"""Find runs of consecutive items in an array.""" | |
# ensure array | |
x = np.asanyarray(x) | |
if x.ndim != 1: | |
raise ValueError('only 1D array supported') |
#!/bin/shell | |
set -euo pipefail | |
HERE="$(pwd)" | |
RELEASE=${1:-"lts"} | |
usage() { | |
cat <<EOF | |
Usage: $1 [lts | weekly] | |
EOF |
""" | |
Copyright (C) 2017 Michael von den Driesch | |
This file is just a simple implementation of a python class allowing for various | |
*booking* types (LIFO, FIFO, AVCO) | |
This *GIST* is free software: you can redistribute it and/or modify it | |
under the terms of the BSD-2-Clause (https://opensource.org/licenses/bsd-license.html). | |
This program is distributed in the hope that it will be useful, but WITHOUT |
main() { | |
# Use colors, but only if connected to a terminal, and that terminal | |
# supports them. | |
if which tput >/dev/null 2>&1; then | |
ncolors=$(tput colors) | |
fi | |
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then | |
RED="$(tput setaf 1)" | |
GREEN="$(tput setaf 2)" | |
YELLOW="$(tput setaf 3)" |
The connection failed because by default psql
connects over UNIX sockets using peer
authentication, that requires the current UNIX user to have the same user name as psql
. So you will have to create the UNIX user postgres
and then login as postgres
or use sudo -u postgres psql database-name
for accessing the database (and psql
should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres
(as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf
* line:
from
curl
to get the JSON response for the latest releasegrep
to find the line containing file URLcut
and tr
to extract the URLwget
to download itcurl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
localhost:80 | |
gzip | |
ext .html | |
root /home/deploy/current/build/www | |
proxy /graphql localhost:3000 | |
rewrite /login { | |
to {path} /login | |
} |
import os, os.path | |
for root, _, files in os.walk("C:/some/dir"): | |
for f in files: | |
fullpath = os.path.join(root, f) | |
try: | |
if os.path.getsize(fullpath) < 10 * 1024: #set file size in kb | |
print fullpath | |
os.remove(fullpath) | |
except WindowsError: |