python -m pip install wsgidav cheroot lxml
python -m wsgidav.server.server_cli -p60012 --root=/ --auth=anonymous -Hlocalhost
#!/bin/bash | |
SSH_DIR="${HOME}/.ssh" | |
chmod 700 "${SSH_DIR}" | |
find "${SSH_DIR}" -type f \( -name 'id_rsa' -o -name 'id_dsa' -o -name 'id_ecdsa' -o -name 'id_ed25519' \) -exec chmod 600 {} \; | |
find "${SSH_DIR}" -type f \( -name '*.pub' -o -name 'known_hosts' -o -name 'authorized_keys' \) -exec chmod 644 {} \; | |
#include <iostream> | |
#include <functional> | |
#include <unordered_map> | |
#include <tuple> | |
// Define a hash function for std::tuple so that it can be used as a key in std::unordered_map | |
namespace std { | |
template <typename... T> | |
struct hash<std::tuple<T...>> { | |
size_t operator()(const std::tuple<T...>& t) const { |
# FLASK Webapp for Image Segmentation Model | |
import os, sys, io | |
sys.path.append(".") | |
import webapp | |
from flask import Flask | |
import flask | |
import numpy as np | |
import pandas as pd |
#!/usr/bin/env python3 | |
from pathlib import Path | |
import os | |
import sys | |
from subprocess import Popen, PIPE, getoutput | |
from shlex import split | |
from contextlib import redirect_stdout | |
import argparse |
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from functools import partial | |
from shutil import copy | |
from subprocess import Popen, PIPE | |
from shlex import split | |
import os | |
import re | |
import atexit |
The tutorial Use OpenCL in Android camera preview based CV application show us how we can use the Transparent API to dramatically increase the performance of some expensive operations.
The first step in order to be able to execute the tutorial example is to re-compile opencv with the correct flags:
# Export your NDK, it will be looked for OpenCV to compile your project. In my case
export ANDROID_NDK=~/graffter/libs/android-ndk-r10d/
# Download the necessary code
from pathlib import Path | |
import logging | |
import sys | |
def set_logger(error_file: Path, info_file: Path): | |
error_file = Path(error_file).expanduser().resolve() | |
error_file.parent.mkdir(exist_ok=True, parents=True) | |
info_file = Path(info_file).expanduser().resolve() | |
info_file.parent.mkdir(exist_ok=True, parents=True) |
# To use geoip | |
sudo apt install geoip-database libgeoip-dev | |
py_ver=`python -c "from sys import version_info as vi; print(f'{vi[0]}.{vi[1]}')"` | |
sudo apt install python${py_ver}-venv | |
pip install pipx | |
pipx install deluge | |
pipx inject deluge libtorrent GeoIP |