frequently miss this
This commit is contained in:
parent
48a23232bc
commit
8cb57df218
16 changed files with 551 additions and 43 deletions
|
@ -4,7 +4,6 @@
|
|||
# a fetch in pure POSIX shell
|
||||
#
|
||||
|
||||
[ "$1" = "" ] && mode=""
|
||||
[ "$1" = "min" ] && mode="min"
|
||||
|
||||
# supress errors
|
||||
|
@ -71,13 +70,13 @@ if [ -e /proc/$$/comm ]; then
|
|||
## Memory
|
||||
# loop over lines in /proc/meminfo until it reaches MemTotal,
|
||||
# then convert the amount (second word) from KB to MB
|
||||
while read -r line; do
|
||||
while read -r line; [ "$mode" != "min" ]; do
|
||||
eq "$line" 'MemTotal*' && set -- $line && break
|
||||
done < /proc/meminfo
|
||||
mem="$(( $2 / 1000 ))MB"
|
||||
[ "$mode" != "min" ] && mem="$(( $2 / 1000 ))MB"
|
||||
|
||||
## Processor
|
||||
while read -r line; do
|
||||
while read -r line; [ "$mode" != "min" ] ; do
|
||||
case $line in
|
||||
vendor_id*) vendor="${line##*: } ";;
|
||||
model\ name*) cpu=${line##*: }; break;;
|
||||
|
@ -98,9 +97,9 @@ if [ -e /proc/$$/comm ]; then
|
|||
eq "$version" '*Microsoft*' && ID="fake $ID"
|
||||
|
||||
## Motherboard // laptop
|
||||
read -r model < /sys/devices/virtual/dmi/id/product_name
|
||||
[ "$mode" != "min" ] && read -r model < /sys/devices/virtual/dmi/id/product_name
|
||||
# invalid model handling
|
||||
case $model in
|
||||
[ "$mode" != "min" ] && case $model in
|
||||
# alternate file with slightly different info
|
||||
# on my laptop it has the device model (instead of 'hp notebook')
|
||||
# on my desktop it has the extended motherboard model
|
||||
|
@ -227,13 +226,11 @@ elif v=/System/Library/CoreServices/SystemVersion.plist; [ -f "$v" ]; then
|
|||
done < "$v"
|
||||
fi
|
||||
|
||||
eq "$0" '*fetish' && printf 'Step on me daddy\n' && exit
|
||||
|
||||
# help i dont know if it's a capital consistently
|
||||
eq "$wm" '*[Gg][Nn][Oo][Mm][Ee]*' && wm='foot DE'
|
||||
|
||||
## GTK
|
||||
while read -r line; do
|
||||
while read -r line; [ "$mode" != "min" ]; do
|
||||
eq "$line" 'gtk-theme*' && gtk=${line##*=} && break
|
||||
done < "${XDG_CONFIG_HOME:=$HOME/.config}/gtk-3.0/settings.ini"
|
||||
|
||||
|
@ -250,47 +247,55 @@ cpu=${cpu%% with*}
|
|||
cpu=${cpu% *-Core*}
|
||||
|
||||
col() {
|
||||
printf ' '
|
||||
for i in 1 2 3 4 5 6; do
|
||||
printf '\033[9%sm%s' "$i" "${colourblocks:- ●}"
|
||||
done
|
||||
printf '\033[0m\n'
|
||||
char="●"
|
||||
printf ' \033[91m%s \033[92m%s \033[93m%s \033[94m%s \033[95m%s \033[96m%s
|
||||
\033[0m' "$char" "$char" "$char" "$char" "$char" "$char"
|
||||
}
|
||||
|
||||
|
||||
print() {
|
||||
[ "$2" ] && printf '\033[1m %b\033[0m %b%s\n' \
|
||||
"$1" "$2"
|
||||
}
|
||||
|
||||
|
||||
full() {
|
||||
echo
|
||||
print DIST "$ID"
|
||||
print KERN "$kernel"
|
||||
print PKGS "$pkgs"
|
||||
print TERM "$term"
|
||||
print SHLL "${SHELL##*/}"
|
||||
print WDMG "${wm##*/}"
|
||||
print THME "${gtk# }"
|
||||
print HOST "$model"
|
||||
print PCSR "$vendor$cpu"
|
||||
print MMRY "$mem"
|
||||
print UPTM "$up"
|
||||
printf '
|
||||
\033[1mDIST\033[0m %s
|
||||
\033[1mKERN\033[0m %s
|
||||
\033[1mPKGS\033[0m %s
|
||||
\033[1mTERM\033[0m %s
|
||||
\033[1mSHLL\033[0m %s
|
||||
\033[1mWDMG\033[0m %s
|
||||
\033[1mTHME\033[0m %s
|
||||
\033[1mHOST\033[0m %s
|
||||
\033[1mPCSR\033[0m %s
|
||||
\033[1mMMRY\033[0m %s
|
||||
\033[1mUPTM\033[0m %s
|
||||
' "$ID" \
|
||||
"$kernel" \
|
||||
"$pkgs" \
|
||||
"$term" \
|
||||
"${SHELL##*/}" \
|
||||
"${wm##*/}" \
|
||||
"${gtk# }" \
|
||||
"$model" \
|
||||
"$vendor$cpu" \
|
||||
"$mem" \
|
||||
"$up"
|
||||
col
|
||||
}
|
||||
|
||||
min() {
|
||||
echo
|
||||
print DIST "$ID"
|
||||
print KERN "$kernel"
|
||||
print PKGS "$pkgs"
|
||||
print TERM "$term"
|
||||
print SHLL "${SHELL##*/}"
|
||||
print WDMG "${wm##*/}"
|
||||
print UPTM "$up"
|
||||
printf '
|
||||
\033[1mDIST\033[0m %s
|
||||
\033[1mKERN\033[0m %s
|
||||
\033[1mPKGS\033[0m %s
|
||||
\033[1mTERM\033[0m %s
|
||||
\033[1mSHLL\033[0m %s
|
||||
\033[1mWDMG\033[0m %s
|
||||
\033[1mUPTM\033[0m %s
|
||||
' "$ID" \
|
||||
"$kernel" \
|
||||
"$pkgs" \
|
||||
"$term" \
|
||||
"${SHELL##*/}" \
|
||||
"${wm##*/}" \
|
||||
"$up"
|
||||
col
|
||||
}
|
||||
|
||||
[ "$mode" = "" ] && full
|
||||
[ "$mode" = "min" ] && min
|
||||
[ "$mode" = "min" ] && min || full
|
||||
|
|
26
snippets/blog.txt
Normal file
26
snippets/blog.txt
Normal file
|
@ -0,0 +1,26 @@
|
|||
⠀⠀⢀⣠⠤⠶⠖⠒⠒⠶⠦⠤⣄⠀⠀⠀⣀⡤⠤⠤⠤⠤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⣦⠞⠁⠀⠀⠀⠀⠀⠀⠉⠳⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⡾⠁⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⣀⣘⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⢀⡴⠚⠉⠁⠀⠀⠀⠀⠈⠉⠙⠲⣄⣤⠤⠶⠒⠒⠲⠦⢤⣜⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ███████████ ██
|
||||
⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⡄⠀⠀⠀⠀⠀⠀⠀⠉⠳⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ░█░░░███░░░█ ███
|
||||
⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⠹⣆⠀⠀⠀⠀⠀⠀⣀⣀⣀⣹⣄⠀⠀⠀⠀⠀⠀⠀⠀ ░ ░███ ░ ██████ █████ █████ ██████ ░░░ █████
|
||||
⠀⠀⠀⠀⣠⠞⣉⣡⠤⠴⠿⠗⠳⠶⣬⣙⠓⢦⡈⠙⢿⡀⠀⠀⢀⣼⣿⣿⣿⣿⣿⡿⣷⣤⡀⠀⠀⠀⠀⠀ ░███ ░░░░░███ ░░███ ░░███ ███░░███ ███░░
|
||||
⠀⠀⠀⣾⣡⠞⣁⣀⣀⣀⣠⣤⣤⣤⣄⣭⣷⣦⣽⣦⡀⢻⡄⠰⢟⣥⣾⣿⣏⣉⡙⠓⢦⣻⠃⠀⠀⠀⠀⠀ ░███ ███████ ░███ ░███ ░███ ░███ ░░█████
|
||||
⠀⠀⠀⠉⠉⠙⠻⢤⣄⣼⣿⣽⣿⠟⠻⣿⠄⠀⠀⢻⡝⢿⡇⣠⣿⣿⣻⣿⠿⣿⡉⠓⠮⣿⠀⠀⠀⠀⠀⠀ ░███ ███░░███ ░░███ ███ ░███ ░███ ░░░░███
|
||||
⠀⠀⠀⠀⠀⠀⠙⢦⡈⠛⠿⣾⣿⣶⣾⡿⠀⠀⠀⢀⣳⣘⢻⣇⣿⣿⣽⣿⣶⣾⠃⣀⡴⣿⠀⠀⠀⠀⠀⠀ █████ ░░████████ ░░█████ ░░██████ ██████
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠙⠲⠤⢄⣈⣉⣙⣓⣒⣒⣚⣉⣥⠟⠀⢯⣉⡉⠉⠉⠛⢉⣉⣡⡾⠁⠀⠀⠀⠀⠀⠀ ░░░░░ ░░░░░░░░ ░░░░░ ░░░░░░ ░░░░░░
|
||||
⠀⠀⣠⣤⡤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢈⡿⠋⠀⠀⠀⠀⠈⠻⣍⠉⠀⠺⠿⠋⠙⣦⠀⠀⠀⠀⠀⠀ ███████████ ████
|
||||
⠀⣀⣥⣤⠴⠆⠀⠀⠀⠀⠀⠀⠀⣀⣠⠤⠖⠋⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⠀⠀⠀⠀⠀⢸⣧⠀⠀⠀⠀⠀ ░░███░░░░░███░░███
|
||||
⠸⢫⡟⠙⣛⠲⠤⣄⣀⣀⠀⠈⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠏⣨⠇⠀⠀⠀⠀ ░███ ░███ ░███ ██████ ███████
|
||||
⠀⠀⠻⢦⣈⠓⠶⠤⣄⣉⠉⠉⠛⠒⠲⠦⠤⠤⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣠⠴⢋⡴⠋⠀⠀⠀⠀⠀ ░██████████ ░███ ███░░███ ███░░███
|
||||
⠀⠀⠀⠀⠉⠓⠦⣄⡀⠈⠙⠓⠒⠶⠶⠶⠶⠤⣤⣀⣀⣀⣀⣀⣉⣉⣉⣉⣉⣀⣠⠴⠋⣿⠀⠀⠀⠀⠀⠀ ░███░░░░░███ ░███ ░███ ░███░███ ░███
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠉⠓⠦⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡼⠁⠀⠀⠀⠀⠀⠀ ░███ ░███ ░███ ░███ ░███░███ ░███
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠙⠛⠒⠒⠒⠒⠒⠤⠤⠤⠒⠒⠒⠒⠒⠒⠚⢉⡇⠀⠀⠀⠀⠀⠀⠀ ███████████ █████░░██████ ░░███████
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠴⠚⠛⠳⣤⠞⠁⠀⠀⠀⠀⠀⠀⠀ ░░░░░░░░░░░ ░░░░░ ░░░░░░ ░░░░░███
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⠚⠁⠀⠀⠀⠀⠘⠲⣄⡀⠀⠀⠀⠀⠀⠀ ███ ░███
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⠋⠙⢷⡋⢙⡇⢀⡴⢒⡿⢶⣄⡴⠀⠙⠳⣄⠀⠀⠀⠀ ░░██████
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠈⠛⢻⠛⢉⡴⣋⡴⠟⠁⠀⠀⠀⠀⠈⢧⡀⠀⠀ ░░░░░░
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡄⠀⠘⣶⢋⡞⠁⠀⠀⢀⡴⠂⠀⠀⠀⠀⠹⣄⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠈⠻⢦⡀⠀⣰⠏⠀⠀⢀⡴⠃⢀⡄⠙⣆⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⡾⢷⡄⠀⠀⠀⠀⠉⠙⠯⠀⠀⡴⠋⠀⢠⠟⠀⠀⢹⡄
|
||||
|
162
snippets/emailwiz_add_domains.md
Normal file
162
snippets/emailwiz_add_domains.md
Normal file
|
@ -0,0 +1,162 @@
|
|||
# Steps:
|
||||
Note:
|
||||
- "$maildomain" = mail.example.org
|
||||
- "$domain" = example.org
|
||||
- "$subdom" = mail
|
||||
|
||||
# Run `emailwiz.sh`
|
||||
|
||||
Set it up normally for your first domain, check that it works fine.
|
||||
Then continue with the next step
|
||||
|
||||
# Generate new certificate
|
||||
|
||||
Not totally necessary for mail to "just work" but it will help, in this case I specified --standalone but do use --nginx or --apache instead, if your email service depends on one of those, if not sure, leave it as standalone.
|
||||
This is the line from the script:
|
||||
|
||||
```sh
|
||||
certbot -d "$maildomain" certonly --standalone --register-unsafely-without-email --agree-tos
|
||||
```
|
||||
|
||||
Note: Redirect at least your mail subdomain from your OTHER domain(s). Later on you'll have to also add other records for emails to work! See DNS Records step.
|
||||
|
||||
# Dovecot
|
||||
Dovecot is easier, you should be good by just adding these lines to `/etc/dovecot/dovecot.conf`
|
||||
Note: Remember to actually generate the keys with certbot, like in the "Generate new certificate" step below.
|
||||
Note: Uses TLS SNI, according to [Dovecot's docs](https://doc.dovecot.org/configuration_manual/dovecot_ssl_configuration/), it is tested in clients:
|
||||
- Thunderbird (Linux)
|
||||
- K-9 on Android (merged Sept 2015 - https://github.com/k9mail/k-9/pull/718)
|
||||
- Apple Mail (according to https://forums.cpanel.net/threads/mail-ssl-sni.454592/ )
|
||||
- Mutt (ticket https://dev.mutt.org/trac/ticket/3923)
|
||||
- NeoMutt (since 2016-03-07 according to https://www.neomutt.org/feature/tls-sni )
|
||||
|
||||
```
|
||||
# mail.domain.org
|
||||
local_name mail.domain.org {
|
||||
ssl_cert = </etc/letsencrypt/live/mail.domain.org/fullchain.pem
|
||||
ssl_key = </etc/letsencrypt/live/mail.domain.org/privkey.pem
|
||||
}
|
||||
|
||||
# mail.otherdomain.org
|
||||
local_name mail.otherdomain.org {
|
||||
ssl_cert = </etc/letsencrypt/live/mail.otherdomain.org/fullchain.pem
|
||||
ssl_key = </etc/letsencrypt/live/mail.otherdomain.org/privkey.pem
|
||||
}
|
||||
```
|
||||
|
||||
# Create vmail map for the certificates
|
||||
Add these entries in the vmail map to specify the certificate for each domain you need. You have to add them also for your already configred domain.
|
||||
This file is in `/etc/postfix/vmail_ssl.map`
|
||||
```
|
||||
mail.domain.org /etc/letsencrypt/live/mail.domain.org/privkey.pem /etc/letsencrypt/live/mail.domain.org/fullchain.pem
|
||||
mail.otherdomain.org /etc/letsencrypt/live/mail.otherdomain.org/privkey.pem /etc/letsencrypt/live/mail.otherdomain.org/fullchain.pem
|
||||
|
||||
```
|
||||
|
||||
# Generate a new DKIM key
|
||||
Technically this is not necessary either since you can use the same key as your main domain, generated by emailwiz. However, some email clients and/or recipients might complain.
|
||||
Note: These lines are totally ripped off from the emailwiz script, I didn't come up with this I just found it useful to share the steps to reproduce my setup for multiple domains.
|
||||
Note: Obviously use your second domain name, first one is already generated.
|
||||
|
||||
```sh
|
||||
mkdir -p "/etc/postfix/dkim/$domain"
|
||||
opendkim-genkey -D "/etc/postfix/dkim/$domain" -d "$domain" -s "$subdom"
|
||||
chgrp -R opendkim /etc/postfix/dkim/*
|
||||
chmod -R g+r /etc/postfix/dkim/*
|
||||
```
|
||||
|
||||
# Add DKIM key to keytable
|
||||
This file is in `/etc/postfix/dkim/keytable`
|
||||
The first one should already be filled out.
|
||||
```
|
||||
mail._domainkey.domain.org domain.org:mail:/etc/postfix/dkim/domain.org/mail.private
|
||||
+ mail._domainkey.otherdomain.org otherdomain.org:mail:/etc/postfix/dkim/otherdomain.org/mail.private
|
||||
```
|
||||
|
||||
# Add entry in signing table
|
||||
This file is in `/etc/postfix/dkim/signingtable`
|
||||
Again, first one should already be there.
|
||||
```
|
||||
*@domain.org mail._domainkey.domain.org
|
||||
+ *@otherdomain.org mail._domainkey.otherdomain.org
|
||||
```
|
||||
|
||||
Make sure both signing and keytable paths are present in `/etc/opendkim.conf`, like this:
|
||||
```
|
||||
KeyTable file:/etc/postfix/dkim/keytable
|
||||
SigningTable refile:/etc/postfix/dkim/signingtable
|
||||
```
|
||||
|
||||
# Virtual alias
|
||||
Add your desired email address, followed by the user the mail should be sent to.
|
||||
As stated before, you will need to do this for existing and new users.
|
||||
This file is in `/etc/postfix/virtual`
|
||||
```
|
||||
exampleuser@domain.org exampleuser
|
||||
eggsample@domain.org eggsample
|
||||
otheruser@otherdomain.org otheruser
|
||||
yetanother@otherdomain.org yetanother
|
||||
```
|
||||
|
||||
# Tell postfix about it
|
||||
Add these lines at the end of your postfix configuration.
|
||||
This file is in `/etc/postfix/main.cf`
|
||||
```
|
||||
virtual_alias_domains = otherdomain.org
|
||||
virtual_alias_maps = hash:/etc/postfix/virtual
|
||||
|
||||
# provide the map to be used when SNI support is enabled
|
||||
tls_server_sni_maps = hash:/etc/postfix/vmail_ssl.map
|
||||
```
|
||||
|
||||
# Apply and restart
|
||||
|
||||
Run these to apply the new configs and
|
||||
restart the services.
|
||||
|
||||
Note (edit): I had some issues when NOT using the `-F` option
|
||||
in `postmap -F /etc/postfix/vmail_ssl.map`, it references files, so make sure to use it.
|
||||
|
||||
```sh
|
||||
postmap /etc/postfix/virtual
|
||||
postmap -F /etc/postfix/vmail_ssl.map
|
||||
systemctl restart postfix
|
||||
systemctl restart dovecot
|
||||
systemctl restart opendkim
|
||||
```
|
||||
# DNS Records
|
||||
In your second domain's panel, point the mail subdomain to the VPS, as usual, then add the same DNS records in `dns_emailwizard`, but do swap the domain name, for example:
|
||||
```
|
||||
domain.org TXT v=spf1 mx a:mail.domain.org -all
|
||||
```
|
||||
Would be
|
||||
```
|
||||
otherdomain.org TXT v=spf1 mx a:mail.otherdomain.org -all
|
||||
```
|
||||
|
||||
Also, the output of the following commands is the TXT record for the new DKIM key (generated in the "Generate a new DKIM key" step).
|
||||
```
|
||||
pval="$(tr -d '\n' <"/etc/postfix/dkim/$domain/$subdom.txt" | sed "s/k=rsa.* \"p=/k=rsa; p=/;s/\"\s*\"//;s/\"\s*).*//" | grep -o 'p=.*')"
|
||||
echo "$subdom._domainkey.$domain TXT v=DKIM1; k=rsa; $pval"
|
||||
```
|
||||
|
||||
# For new accounts
|
||||
|
||||
- Add unix user as explained in the main emailwiz documentation.
|
||||
- Add new entry in /etc/postfix/virtual
|
||||
- `postmap /etc/postfix/virtual`
|
||||
- `systemctl restart postfix`
|
||||
|
||||
# References:
|
||||
[Dovecot SSL configuration - TLS SNI Support](https://doc.dovecot.org/configuration_manual/dovecot_ssl_configuration/)
|
||||
[Set up certs for multiple domains in Postfix and Dovecot](https://serverfault.com/questions/920436/set-up-certs-for-multiple-domains-in-postfix-and-dovecot)
|
||||
|
||||
# Notes & edits
|
||||
|
||||
Note: I had an issue with thunderbird where it could not verify server configuration. Checking `systemctl status dovecot`, it was a login issue even though I'm not trying to log in. I just clicked "done" when adding new email account without checking for server configuration and it works just fine.
|
||||
|
||||
Note (edit 2023-07-20): I noticed when using **Thunderbird**, for whatever reason it grabs OTHER domain names if you have multiple subdomains, for example, Thunderbird would get turn.example.org's cert instead of the appropriate mail.example.org. I noticed this because I was getting flagged mail when sending to corporate or institutions mail, BUT when using claws-mail (based, lightweight, simple client), it would actually get the mail.example.org cert. I don't know how to fix this since I'm not a Thunderbird user and I couldn't find any obvious way to do it. But note that it might happen :)
|
||||
|
||||
Note: (edit 2023-07-21): Gmail will complain about PTR records:
|
||||
"_Gmail does not accept messages from IPs with missing PTR records._"
|
||||
This is expected since you have (ideally) only one reverse DNS record for IPv4 (A) and IPv6 (AAAA), which is probably for your main domain. According to what I looked up online you COULD have multiple reverse DNS addresses but people say it might be worse than having one or even none. I don't exactly know the implications of this approach because I'm no expert, but receiving mail should work just fine.
|
8
snippets/gen.qr
Normal file
8
snippets/gen.qr
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Use google charts
|
||||
zbarimg <(wget -qO - "https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=STRING")
|
||||
|
||||
# Use qrencode like a normal person
|
||||
printf 'STRING' | qrencode -t ansiutf8 # Ansi output
|
||||
printf 'STRING' | qrencode -s 16 -o qr.png # .png file
|
3
snippets/groff_bottomnum.ms
Normal file
3
snippets/groff_bottomnum.ms
Normal file
|
@ -0,0 +1,3 @@
|
|||
.\" Page numbers at the bottom
|
||||
.ds CH
|
||||
.ds CF -\En[PN]-
|
2
snippets/groff_color.ms
Normal file
2
snippets/groff_color.ms
Normal file
|
@ -0,0 +1,2 @@
|
|||
.defcolor col_name rgb #ffffff
|
||||
\m[col_name]Text\m[]
|
5
snippets/groff_eqn.ms
Normal file
5
snippets/groff_eqn.ms
Normal file
|
@ -0,0 +1,5 @@
|
|||
.\" Equation
|
||||
.\" Requires .so utils for auto-numbering
|
||||
.EQ \\n+[eqnnum]
|
||||
x sup 2
|
||||
.EN
|
2
snippets/groff_font.ms
Normal file
2
snippets/groff_font.ms
Normal file
|
@ -0,0 +1,2 @@
|
|||
.LP
|
||||
<indented \f[CW]paragraph\f[] \m[blue]with\m[] \f[B]some\f[] \f[I]formatting\f[]>
|
31
snippets/groff_grap.ms
Normal file
31
snippets/groff_grap.ms
Normal file
|
@ -0,0 +1,31 @@
|
|||
.\" Graph
|
||||
.\" copy "file.tsv" will source data entries
|
||||
.G1
|
||||
|
||||
label left "Frequency (Hz)"
|
||||
label bottom "Time (s)"
|
||||
|
||||
coord x 0,6 y 0,25
|
||||
|
||||
frame wid 5
|
||||
frame top invis
|
||||
frame right invis
|
||||
|
||||
grid left from 0 to 25 by 5
|
||||
|
||||
draw solid
|
||||
0 5.6
|
||||
1 10.2
|
||||
2 11.4
|
||||
3 17.2
|
||||
4 22.9
|
||||
5 22.2
|
||||
6 23.8
|
||||
|
||||
bullet size 20 at 1,9.8
|
||||
|
||||
"(1 , 10.2)" size 12 above at 1,11
|
||||
|
||||
line dashed from 4,0 to 4,22.9
|
||||
|
||||
.G2
|
9
snippets/groff_rmheadfoot.ms
Normal file
9
snippets/groff_rmheadfoot.ms
Normal file
|
@ -0,0 +1,9 @@
|
|||
.\" Remove page headers and footers
|
||||
.\" or customize them this way:
|
||||
.\" .ds LH Text in left header
|
||||
.ds LH
|
||||
.ds CH
|
||||
.ds RH
|
||||
.ds LF
|
||||
.ds CF
|
||||
.ds RF
|
25
snippets/groff_tbl.ms
Normal file
25
snippets/groff_tbl.ms
Normal file
|
@ -0,0 +1,25 @@
|
|||
.\" Table
|
||||
.\" Requires .so utils for auto-numbering
|
||||
.ad c
|
||||
.B "Table \\n+[tblnum]:"
|
||||
Title
|
||||
.TS
|
||||
box center tab(|) nospaces decimalpoint(.) ;
|
||||
cb s ci s
|
||||
_ _ _ _
|
||||
c n l n
|
||||
c n l n
|
||||
c c c c
|
||||
c ^ c c
|
||||
c c c
|
||||
.
|
||||
One | Two
|
||||
Numbers | 3.14159 | Left-align | 10000.2
|
||||
Numbers | 3.14 | Left-align | 100.2
|
||||
This | is | \\f[I]centered\\f[P] | text
|
||||
This | | centered | too
|
||||
_
|
||||
U | | T{
|
||||
This entry will be wrapped to fit
|
||||
T}|V
|
||||
.TE
|
4
snippets/groff_var.ms
Normal file
4
snippets/groff_var.ms
Normal file
|
@ -0,0 +1,4 @@
|
|||
.\" Save and print variable
|
||||
.ds VAR foobar
|
||||
.LP
|
||||
\*[VAR]
|
1
snippets/shell_array.sh
Normal file
1
snippets/shell_array.sh
Normal file
|
@ -0,0 +1 @@
|
|||
: "${info:=item1 item2 item3}"
|
3
snippets/shell_counter.sh
Normal file
3
snippets/shell_counter.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
i=0 # Start in 0
|
||||
i=$((i+1)) # 0+1 = 1
|
||||
echo $i
|
217
snippets/urlutf8
Normal file
217
snippets/urlutf8
Normal file
|
@ -0,0 +1,217 @@
|
|||
space %20
|
||||
! %21
|
||||
" %22
|
||||
# %23
|
||||
$ %24
|
||||
% %25
|
||||
& %26
|
||||
' %27
|
||||
( %28
|
||||
) %29
|
||||
* %2A
|
||||
+ %2B
|
||||
, %2C
|
||||
- %2D
|
||||
. %2E
|
||||
/ %2F
|
||||
0 %30
|
||||
1 %31
|
||||
2 %32
|
||||
3 %33
|
||||
4 %34
|
||||
5 %35
|
||||
6 %36
|
||||
7 %37
|
||||
8 %38
|
||||
9 %39
|
||||
: %3A
|
||||
; %3B
|
||||
< %3C
|
||||
= %3D
|
||||
> %3E
|
||||
? %3F
|
||||
@ %40
|
||||
A %41
|
||||
B %42
|
||||
C %43
|
||||
D %44
|
||||
E %45
|
||||
F %46
|
||||
G %47
|
||||
H %48
|
||||
I %49
|
||||
J %4A
|
||||
K %4B
|
||||
L %4C
|
||||
M %4D
|
||||
N %4E
|
||||
O %4F
|
||||
P %50
|
||||
Q %51
|
||||
R %52
|
||||
S %53
|
||||
T %54
|
||||
U %55
|
||||
V %56
|
||||
W %57
|
||||
X %58
|
||||
Y %59
|
||||
Z %5A
|
||||
[ %5B
|
||||
\ %5C
|
||||
] %5D
|
||||
^ %5E
|
||||
_ %5F
|
||||
` %60
|
||||
a %61
|
||||
b %62
|
||||
c %63
|
||||
d %64
|
||||
e %65
|
||||
f %66
|
||||
g %67
|
||||
h %68
|
||||
i %69
|
||||
j %6A
|
||||
k %6B
|
||||
l %6C
|
||||
m %6D
|
||||
n %6E
|
||||
o %6F
|
||||
p %70
|
||||
q %71
|
||||
r %72
|
||||
s %73
|
||||
t %74
|
||||
u %75
|
||||
v %76
|
||||
w %77
|
||||
x %78
|
||||
y %79
|
||||
z %7A
|
||||
{ %7B
|
||||
| %7C
|
||||
} %7D
|
||||
~ %7E
|
||||
€ %E2%82%AC
|
||||
‚ %E2%80%9A
|
||||
ƒ %C6%92
|
||||
„ %E2%80%9E
|
||||
… %E2%80%A6
|
||||
† %E2%80%A0
|
||||
‡ %E2%80%A1
|
||||
ˆ %CB%86
|
||||
‰ %E2%80%B0
|
||||
Š %C5%A0
|
||||
‹ %E2%80%B9
|
||||
Œ %C5%92
|
||||
Ž %C5%BD
|
||||
‘ %E2%80%98
|
||||
’ %E2%80%99
|
||||
“ %E2%80%9C
|
||||
” %E2%80%9D
|
||||
• %E2%80%A2
|
||||
– %E2%80%93
|
||||
— %E2%80%94
|
||||
˜ %CB%9C
|
||||
™ %E2%84
|
||||
š %C5%A1
|
||||
› %E2%80
|
||||
œ %C5%93
|
||||
ž %C5%BE
|
||||
Ÿ %C5%B8
|
||||
¡ %C2%A1
|
||||
¢ %C2%A2
|
||||
£ %C2%A3
|
||||
¤ %C2%A4
|
||||
¥ %C2%A5
|
||||
¦ %C2%A6
|
||||
§ %C2%A7
|
||||
¨ %C2%A8
|
||||
© %C2%A9
|
||||
ª %C2%AA
|
||||
« %C2%AB
|
||||
¬ %C2%AC
|
||||
%C2%AD
|
||||
® %C2%AE
|
||||
¯ %C2%AF
|
||||
° %C2%B0
|
||||
± %C2%B1
|
||||
² %C2%B2
|
||||
³ %C2%B3
|
||||
´ %C2%B4
|
||||
µ %C2%B5
|
||||
¶ %C2%B6
|
||||
· %C2%B7
|
||||
¸ %C2%B8
|
||||
¹ %C2%B9
|
||||
º %C2%BA
|
||||
» %C2%BB
|
||||
¼ %C2%BC
|
||||
½ %C2%BD
|
||||
¾ %C2%BE
|
||||
¿ %C2%BF
|
||||
À %C3%80
|
||||
Á %C3%81
|
||||
 %C3%82
|
||||
à %C3%83
|
||||
Ä %C3%84
|
||||
Å %C3%85
|
||||
Æ %C3%86
|
||||
Ç %C3%87
|
||||
È %C3%88
|
||||
É %C3%89
|
||||
Ê %C3%8A
|
||||
Ë %C3%8B
|
||||
Ì %C3%8C
|
||||
Í %C3%8D
|
||||
Î %C3%8E
|
||||
Ï %C3%8F
|
||||
Ð %C3%90
|
||||
Ñ %C3%91
|
||||
Ò %C3%92
|
||||
Ó %C3%93
|
||||
Ô %C3%94
|
||||
Õ %C3%95
|
||||
Ö %C3%96
|
||||
× %C3%97
|
||||
Ø %C3%98
|
||||
Ù %C3%99
|
||||
Ú %C3%9A
|
||||
Û %C3%9B
|
||||
Ü %C3%9C
|
||||
Ý %C3%9D
|
||||
Þ %C3%9E
|
||||
ß %C3%9F
|
||||
à %C3%A0
|
||||
á %C3%A1
|
||||
â %C3%A2
|
||||
ã %C3%A3
|
||||
ä %C3%A4
|
||||
å %C3%A5
|
||||
æ %C3%A6
|
||||
ç %C3%A7
|
||||
è %C3%A8
|
||||
é %C3%A9
|
||||
ê %C3%AA
|
||||
ë %C3%AB
|
||||
ì %C3%AC
|
||||
í %C3%AD
|
||||
î %C3%AE
|
||||
ï %C3%AF
|
||||
ð %C3%B0
|
||||
ñ %C3%B1
|
||||
ò %C3%B2
|
||||
ó %C3%B3
|
||||
ô %C3%B4
|
||||
õ %C3%B5
|
||||
ö %C3%B6
|
||||
÷ %C3%B7
|
||||
ø %C3%B8
|
||||
ù %C3%B9
|
||||
ú %C3%BA
|
||||
û %C3%BB
|
||||
ü %C3%BC
|
||||
ý %C3%BD
|
||||
þ %C3%BE
|
||||
ÿ %C3%BF
|
5
snippets/welcome.txt
Normal file
5
snippets/welcome.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
__ __ _ _
|
||||
\ \ / /__| | ___ ___ _ __ ___ ___| |
|
||||
\ \ /\ / / _ \ |/ __/ _ \| '_ ` _ \ / _ \ |
|
||||
\ V V / __/ | (_| (_) | | | | | | __/_|
|
||||
\_/\_/ \___|_|\___\___/|_| |_| |_|\___(_)
|
Loading…
Reference in a new issue