1月 012022
 

Zint is a suite of programs to allow easy encoding of data in any of the
wide range of public domain barcode standards and to allow integration of
this capability into your own programs.

Zint is able to encode data in the following formats:

Code 11, Standard Code 2 of 5, IATA Code 2 of 5, Industrial Code 2 of 5,
Interleaved Code 2 of 5, Code 2 of 5 Data Logic, ITF-14, Deutshe Post Leitcode,
Deutshe Post Identcode, UPC-A, UPC-E, EAN-2, EAN-5, EAN-8, EAN-13, ISBN, UK
Plessey, MSI Plessey, Telepen Alpha, Telepen Numeric, Code 39, Extended Code 39,
Code 93, PZN, Code 32, LOGMARS, Codabar, Pharmacode, Code 128, GS1-128, NVE-18,
Code 16k, PDF417, MicroPDF417, Two-Track Pharmacode, POSTNET, PLANET, Australia
Post 4-State Symbols, RM4SCC, Dutch Post KIX, USPS Intelligent Mail, GS1 DataBar
Omnidirectional, GS1 DataBar Limited, GS1 DataBar Expanded, GS1 DataBar Stacked,
Composite Symbology, Data Matrix, QR Code, MaxiCode, Aztec Code, Aztec Runes,
EAN-14, Micro QR, Korea Post Barcode, HIBC Code 128, HIBC Code 39, HIBC Data
Matrix, HIBC PDF417, HIBC MicroPDF417, HIBC QR Code, HIBC Codablock-F, HIBC
Aztec Code, Japanese Postal Code, Code 49, Channel Code, Code One, Grid Matrix,
DAFT, FIM and Flattermarken, Codablock-F, DotCode, Han Xin Code, rMQR,
Ultracode, UPNQR, VIN, and DPD Code.

Output can be saved as BMP, EPS, GIF, PCX, TIF, EMF, PNG or SVG.

项目主页

http://www.sourceforge.net/projects/zint

源代码

https://github.com/zint/zint
12月 072021
 
#!/bin/bash
####################################
#
# Backup to NFS mount script.
#
####################################

# What to backup. 
backup_files="/home /var/spool/mail /etc /root /boot /opt"

# Where to backup to.
dest="/mnt/backup"

# Create archive filename.
day=$(date +%A)
hostname=$(hostname -s)
archive_file="$hostname-$day.tgz"

# Print start status message.
echo "Backing up $backup_files to $dest/$archive_file"
date
echo

# Backup the files using tar.
tar czf $dest/$archive_file $backup_files

# Print end status message.
echo
echo "Backup finished"
date

# Long listing of files in $dest to check file sizes.
ls -lh $dest

https://ubuntu.com/server/docs/backups-shell-scripts

11月 112021
 

https://www.domaindiscount24.com/faq/en/txt-record

Please note

It needs time for changes in the DNS to take effect.

In case a single TXT record is longer than 255 characters you have to split it into two parts (like "1stpart" "2ndpart") to add it into a single line. This is because Strings in DNS records have a maximum of 255 characters according to RFC.
By splitting the record with double quotes this limitation can be avoided.
9月 102021
 

获取时间戳

[root@s6 ~]# date +%s%N
1634089185225960225
[root@s6 ~]#

获取系统的唯一性ID

[root@s6 ~]# cat /etc/machine-id 
52e2104a451e6cc4c0cd3f75608ba59f
[root@s6 ~]#

通过hostnamectl查看

[root@s6 ~]# hostnamectl 
Static hostname: s6.linuxcache.com
Icon name: computer-vm
Chassis: vm
Machine ID: 52e2104a451e6cc4c0cd3f75608ba59f
Boot ID: 7b76dcb309d94c908ec297b10998cd38
Virtualization: kvm
Operating System: Fedora 34 (Server Edition)
CPE OS Name: cpe:/o:fedoraproject:fedora:34
Kernel: Linux 5.11.12-300.fc34.x86_64
Architecture: x86-64
Hardware Vendor: Vultr
Hardware Model: HFC
[root@s6 ~]#

拼接timestamp和machine-id并使用sha1算法计算校验值

printf <timestamp><machine-id> | sha1sum
printf 163408918522596022552e2104a451e6cc4c0cd3f75608ba59f | sha1sum

计算校验值

[root@s6 ~]# printf 163408918522596022552e2104a451e6cc4c0cd3f75608ba59f | sha1sum
e4819b79f35d65e8231cb7e23bf61fc76aab5571 -
[root@s6 ~]#

截取后5位16进制值

printf e4819b79f35d65e8231cb7e23bf61fc76aab5571 | cut -c 31-

截取成功

[root@s6 ~]# printf e4819b79f35d65e8231cb7e23bf61fc76aab5571 | cut -c 31-
c76aab5571
[root@s6 ~]#

拼接前缀

fd c7 6a ab 55 71
fdc7:6aab:5571::/64
使用ipcalc命令计算子网信息

[root@s6 ~]# ipcalc -6 fdc7:6aab:5571::/64
Full Network: fdc7:6aab:5571:0000:0000:0000:0000:0000/64
Network: fdc7:6aab:5571::/64
Netmask: ffff:ffff:ffff:ffff:: = 64

Address space: Unique Local Unicast
HostMin: fdc7:6aab:5571::
HostMax: fdc7:6aab:5571:0:ffff:ffff:ffff:ffff
Hosts/Net: 2^(64) = 18446744073709551616
[root@s6 ~]#

 

 

 

9月 092021
 

原文

3.2.2. Sample Code for Pseudo-Random Global ID Algorithm

The algorithm described below is intended to be used for locally
assigned Global IDs. In each case the resulting global ID will be
used in the appropriate prefix as defined in Section 3.2.

1) Obtain the current time of day in 64-bit NTP format [NTP].

2) Obtain an EUI-64 identifier from the system running this
algorithm. If an EUI-64 does not exist, one can be created from
a 48-bit MAC address as specified in [ADDARCH]. If an EUI-64
cannot be obtained or created, a suitably unique identifier,
local to the node, should be used (e.g., system serial number).

3) Concatenate the time of day with the system-specific identifier
in order to create a key.

4) Compute an SHA-1 digest on the key as specified in [FIPS, SHA1];
the resulting value is 160 bits.

5) Use the least significant 40 bits as the Global ID.

6) Concatenate FC00::/7, the L bit set to 1, and the 40-bit Global
ID to create a Local IPv6 address prefix.

This algorithm will result in a Global ID that is reasonably unique
and can be used to create a locally assigned Local IPv6 address
prefix.

内容引用:

Unique Local IPv6 Unicast Addresses