Shells that support process substitution such as bash
and zsh
allow to run shell script on gist as follows.
# With curl:
bash <(curl -sL ${GIST_URL}) args...
# With wget:
QTS 4.5.1.1495 | |
Example looks like: | |
"Operating_Status = 4:0:41309:0" | |
first field: 4 if QPKG has been stopped (using the qpkg_service utility) and 3 if started | |
second field: always 0 | |
third field: NAS uptime in seconds when this entry was last updated | |
fourth field: always 0 |
#!/usr/bin/env bash | |
target_pathfile="$1" | |
target_func='' | |
for target_func in $(grep '()$' "$target_pathfile" | grep -v '=\|\$' | sed 's|()||g'); do | |
[[ $(grep -ow "$target_func" < "$target_pathfile" | wc -l) -eq 1 ]] && echo "$target_func()" | |
done |
for d in $(ls -d */); do cd $d; qbuild; cd ..; done; |
openwrt opkg
install not support specify package version.
ref:
https://stackoverflow.com/a/37938130/4896468
https://forum.openwrt.org/t/opkg-install-a-specific-package-version/33158/21
here is a workgroud to implement install specified version of package with opkg.
principle:
#!/bin/bash | |
err_report() { | |
echo "error in inner script: $(caller):$1" | |
} | |
trap 'err_report $LINENO' ERR | |
echo "INNER SCRIPT" |
packages=($(grep '^\[.*\]$' /etc/config/qpkg.conf | sed 's|[][]||g')) | |
for package in ${packages[*]}; do setcfg $package Enable FALSE -f /etc/config/qpkg.conf; done |
sudo apt install software-properties-common dirmngr gnupg-agent | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AD5F235DF639B041 | |
echo 'deb http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial main' | sudo tee /etc/apt/sources.list.d/alessandro-strada-ubuntu-ppa.list >/dev/null | |
sudo apt update | |
sudo apt install google-drive-ocamlfuse |
$HOME/.config/mimeapps.list | |
[Added Associations] | |
inode/directory=org.kde.dolphin.desktop;kde4-kfind.desktop;baobab.desktop;k4dirstat.desktop; |