{
"markdown-pdf.styles": ["./markdown-pdf.css"]
}
markdown-pdf.css mix css
sueboy
markdown-pdf
https://github.com/hanggrian/markdown-pdf-styles/tree/main
samples includes css
.vscode/setting.json
nuxt3 build .env !!
You want Build time use .env setting context. Two way:
1. source .env
package.json > "build": "source .env && nuxt build"
2. eval $(grep '^NUXT_' .env)
package.json > "build": "eval $(grep '^PROD_' .env) && nuxt build"
^RROD_ can replace by yourself
.env file inside
PROD_API_URL=https://ooxxooxx
nuxt 3 $fetch x-www-form-urlencode blob
file download
const pdf = async () => {
const download_url = new URL("/api/pdf")
download_url.search = new URLSearchParams({'order_id': '20241101001'}).toString();
try {
const blob = await $fetch(download_url.toString(), {
method: 'GET',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.setAttribute('download', '20241101001.pdf');
document.body.appendChild(link);
link.click()
document.body.removeChild(link);
} catch (error) {
console.log(error)
}
}
file print
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
iframe.src = url;
document.body.appendChild(iframe);
iframe.contentWindow.focus();
iframe.contentWindow.print();
Alpine qemu-guest-agent no such package
> apk add qemu-guest-agent
ERROR: unable to select packages:
qemu-guest-agent (no such package):
required by: world[qemu-guest-agent]
Only way: Change Alpine repositores.
# https://wiki.alpinelinux.org/wiki/Repositories
> setup-apkrepos -cf
or
http://alpine.ccns.ncku.edu.tw/alpine/v3.20/main #http://dl-cdn.alpinelinux.org/alpine/v3.20/community http://alpine.cs.nycu.edu.tw/v3.20/main http://alpine.cs.nycu.edu.tw/v3.20/communityAlpine Linux image with Cloud-Init ready for Proxmox
[轉]How to prepare Alpine Linux image with Cloud-Init ready for Proxmox
https://5wire.co.uk/how-to-prepare-alpine-linux-image-with-cloud-init-ready-for-proxmox/
[轉]Enable cloud-init for a Alpine VM on proxmox
https://gist.github.com/longtian/499261f4c68f0fb40b481bb1e74aa8ca
systemd wstunnel
Create /etc/systemd/system/wstunnel.service
[Unit]
Description=Wstunnel Server Service
After=network.target
[Service]
Type=simple
Restart=on-failure
RestartSec=5s
LimitNOFILE=1048576
ExecStart=/usr/bin/wstunnel server wss://[::]:1234 -r aabbccddeeff
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable wstunnel.service
systemctl start wstunnel.service
systemctl status wstunnel.service
[轉]Debian: fail2ban + nftables
https://blog.cyberfront.org/index.php/2021/10/27/debian-fail2ban/
=====
https://github.com/fail2ban/fail2ban/issues/3292
# /etc/fail2ban/jail.local
[DEFAULT]
default_backend = systemd
logtarget = SYSTEMD-JOURNAL
# /etc/fail2ban/jail.d/named.conf
[named-refused-tcp]
backend = systemd
How to check
1. journalctl -r
2. less /var/log/fail2ban.log
3. fail2ban-client status or fail2ban-client status sshd or fail2ban-client status ooxxooxx
2 files in one command Create SSL for wildcard domain selfsigned
https://gist.github.com/dasgoll/5c7c02f363e7aeaff2837d650d985cc7
EX: *.ccdd.com
openssl req -subj "/C=cd/CN=*.ccdd.com" -x509 -nodes -days 365 -newkey rsa:2048 -keyout ccdd-wildcard-selfsigned.key -out ccdd-wildcard-selfsigned.crt
訂閱:
文章 (Atom)