这里到底发生了什么?
root@bob-p7-1298c:/# ls -l /tmp/report.csv && lsof | grep "report.csv"
-rw-r--r-- 1 mysql mysql 1430 Dec 4 12:34 /tmp/report.csv
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
Run Code Online (Sandbox Code Playgroud) 如何以“[AZ][0-9]*”或例如:“A000001”的形式迭代字符串?
收到变量后我拆分:
current_=$(mysql -h"$mysqlhost" -u"$mysqluser" -p"$PASS" "$DBNAME" -se "SELECT current_ FROM $GLOBALDB;")
current_number=$(echo $current_ | grep -oh "[0-9]*")
current_letter=$(echo $current_ | grep -oh "[A-Z]*")
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试添加 1 时:
# add 1 & keep all leading zeros "000001"
next_number=$(printf %06d $(($current_number + 1)))
Run Code Online (Sandbox Code Playgroud)
它计数到“000009”并回滚到“000000”。
我加入如下:
next_=$(echo "$current_letter$next_number")
Run Code Online (Sandbox Code Playgroud)
关于字母迭代,我正在考虑使用关联数组?或大括号扩展{A..Z},但这是一个完全不同的问题。
使用systemd-resolved如何阻止、路由或解析域名到黑洞或无处地址。子域的奖励积分也是如此。
我在 中尝试了一个域/etc/hosts:
127.0.0.1 google.com
::1 google.com
Run Code Online (Sandbox Code Playgroud)
我也试过/etc/systemd/network/100-blocked.network:
[Match]
Name=wlp113s0
[Network]
Description="Just block the domain, and sub domains"
DNS=127.0.0.255
DNS=::1
[Resolve]
Domains=google.com
Run Code Online (Sandbox Code Playgroud)
sudo systemd-resolve --status:
Link 3 (wlp113s0)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 127.0.0.255
::1
2001:4888:3a:ff00:304:d::
2001:4888:39:ff00:308:d::
Run Code Online (Sandbox Code Playgroud)
例如使用dnsmasq我能够做到:
server=192.168.43.1
address=/google.com/0.0.0.0
# a very long list of "address=/domain/0"
Run Code Online (Sandbox Code Playgroud)
有关的: