This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tree -L 3 | awk ' | |
BEGIN { | |
last_prefix = "" | |
count = 1 | |
} | |
{ | |
# Extract indentation | |
prefix = $0 | |
sub(/[^│├└─]+$/, "", prefix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tried and tested method | |
# First enable web interface | |
# From: https://openwrt.org/docs/guide-user/luci/luci.secure#allow_https_access_from_internet | |
uci add firewall wan_https_allow | |
uci set firewall.wan_https_allow=rule | |
uci set firewall.wan_https_allow.name='Allow HTTP, HTTPS from WAN' | |
uci set firewall.wan_https_allow.src='wan' | |
uci set firewall.wan_https_allow.proto='tcp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install opencv | |
set -e | |
ROOTDIR=${ZZROOT:-$HOME/app} | |
NAME1="opencv" | |
NAME2="opencv_contrib" | |
TYPE=".tar.gz" | |
FILE1="$NAME1$TYPE" | |
FILE2="$NAME2$TYPE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def expand_flatdict_to_tree(dict, sep = '_', to_lower = True): | |
tree = {} | |
for src, val in dict.items(): | |
ref = tree | |
if to_lower: | |
src = src.lower() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Replace `<base baseHref="/">` in `index.html` with: --> | |
<!-- Dynamic base href --> | |
<base id="baseHref"> <!-- Don't fill baseHref otherwise you'll first get a request with invalid URLs --> | |
<script> | |
document.getElementById('baseHref').href = (function() { | |
// NOTE: URI in app module does not need a / suffix. URI in index.html does! | |
uri = window.location.pathname; | |
uri = uri.replace('index.html', ''); |