Compare commits
143 Commits
es/text-su
...
ea27c632b5
Author | SHA1 | Date | |
---|---|---|---|
ea27c632b5
|
|||
9e4e72c711
|
|||
80ecf66cbe
|
|||
3d69f686d5
|
|||
7315daf89c
|
|||
e942d3ca4f
|
|||
a899d617be
|
|||
5d8afcca7e
|
|||
5f44c05e57
|
|||
0e67adf41c
|
|||
b4c695aeb4
|
|||
cdfcf3c372
|
|||
6d7dfa6c5d
|
|||
ef8dda9657
|
|||
f6b27235f3
|
|||
1ce61b8260
|
|||
f719cadd1e
|
|||
43d4f47e29
|
|||
510e3e9bf9
|
|||
685a9ed8f4
|
|||
66fac8058f
|
|||
e93871c923
|
|||
07f586e5b0
|
|||
d21feef5b9
|
|||
e49b0aa583
|
|||
91bc38bdd4
|
|||
b80bd5732d
|
|||
b863f577ae
|
|||
c1806338e5
|
|||
f9c4fd8a9a
|
|||
fb0e45d7cd
|
|||
a0165e8569
|
|||
100a86b85f
|
|||
8321945015
|
|||
48ed6eae21
|
|||
795be223eb
|
|||
0e2a26fe56
|
|||
c228d5c903
|
|||
f2494e515f
|
|||
4cd6632799
|
|||
bde9df2aa6
|
|||
87c5d4f1b3
|
|||
31a72c92fa
|
|||
bc76fb5458
|
|||
ddb0045088
|
|||
2fb0d17df1
|
|||
060d3ecd84
|
|||
fd6eb50399
|
|||
87688ef6b3
|
|||
01c2b34920
|
|||
c014da3fe3
|
|||
7d5309862e
|
|||
cef5fe28dc
|
|||
7a529fb1ac
|
|||
852aafb2e7
|
|||
c50d3fda88
|
|||
6f1c5a883f
|
|||
6a941cef7c
|
|||
44c1291fa4
|
|||
dba36c5105
|
|||
6145d4e8d7
|
|||
c5a2e84050
|
|||
94a2404a83
|
|||
fec8bd1933
|
|||
27bc4e28a8
|
|||
e9ad2abd55
|
|||
f0036f20b9
|
|||
2fc8e4646e
|
|||
da8dc12957
|
|||
86f4b102d7
|
|||
d7e219d331 | |||
5b0c092bc0
|
|||
2ce66a14d4 | |||
8a330b59b0
|
|||
de888c1adc
|
|||
927e775439
|
|||
9c572a706b
|
|||
05c8e0da9d
|
|||
191c9a5185
|
|||
c11c9178e0
|
|||
5719a11e8b
|
|||
bacddbfe42
|
|||
4e6f0c7614
|
|||
20abaffc3a
|
|||
3668b6cfb1
|
|||
f3cf22ae33
|
|||
dde5162907
|
|||
90d640bd12
|
|||
904d8928b7
|
|||
827a049946
|
|||
db65e9fc23
|
|||
bd9d294fc1
|
|||
9de4d26b6a
|
|||
f14c1568f7 | |||
1e650ed79b
|
|||
ba9c62ed4f
|
|||
c3632c40ce | |||
02201e806f
|
|||
d27f095c1a
|
|||
2b38b143b1
|
|||
26ccc90cff
|
|||
d5ef788e78
|
|||
8e2673b4ff
|
|||
c58164f1f2
|
|||
4fb9dbaa30
|
|||
359bfbf1b6
|
|||
d011efd2a1
|
|||
98ef3386f5
|
|||
a170885ff8
|
|||
17af722f4d
|
|||
62c62b344c
|
|||
f50665786b
|
|||
57fac4d945
|
|||
f6602dfff0
|
|||
db6fc9e977
|
|||
86a90f907a
|
|||
3838d2d44a
|
|||
ac05117647
|
|||
355d180f6c
|
|||
0bc3f3145e
|
|||
cbe6a1e12a
|
|||
e1dd193bf1
|
|||
0bb3dce6e9
|
|||
6ad002b319
|
|||
1e20d0e943
|
|||
375b90fb07
|
|||
81fa2f6b41
|
|||
fb7b5913c0
|
|||
d8134587e9
|
|||
4db3d24349
|
|||
4017855c29
|
|||
859537be01
|
|||
164565cecb
|
|||
5d08b75f71
|
|||
5782a6a002
|
|||
e21a4b948e
|
|||
9de124a586
|
|||
4a4361dcb5
|
|||
a449933ffe
|
|||
a57715c4fa
|
|||
3ec98f019c
|
|||
fd4a7a7bc2
|
|||
1f263b3a3a
|
95
.github/workflows/audit.yml
vendored
@ -2,13 +2,104 @@ name: Audit
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
lighthouse:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Setup Hugo
|
||||||
|
uses: peaceiris/actions-hugo@v2
|
||||||
|
with:
|
||||||
|
hugo-version: latest
|
||||||
|
extended: true
|
||||||
|
|
||||||
|
- name: Checkout (pull_request)
|
||||||
|
if: github.event.pull_request
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.base.ref }}
|
||||||
|
|
||||||
|
- name: Checkout (push)
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.before }}
|
||||||
|
|
||||||
|
- name: Build previous commit
|
||||||
|
run: |
|
||||||
|
hugo --buildDrafts --printI18nWarnings --printPathWarnings --baseURL https://localhost -d old/
|
||||||
|
|
||||||
|
- name: Checkout current commit
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
fetch-depth: 0
|
||||||
|
clean: false
|
||||||
|
|
||||||
|
- name: Build current commit
|
||||||
|
run: |
|
||||||
|
hugo --buildDrafts --printI18nWarnings --printPathWarnings --baseURL https://localhost
|
||||||
|
cp -r public/ new/
|
||||||
|
# copy, so that public/ stays, it will be needed for Caddy to serve
|
||||||
|
|
||||||
|
- name: Save full diff
|
||||||
|
run: diff -r old/ new/ | tee changes.diff || true
|
||||||
|
|
||||||
|
- name: Upload full diff
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: diff
|
||||||
|
path: changes.diff
|
||||||
|
|
||||||
|
- name: Find changed URLs
|
||||||
|
id: changed_urls
|
||||||
|
env:
|
||||||
|
SCHEME: https
|
||||||
|
DOMAIN: localhost
|
||||||
|
run: |
|
||||||
|
urls="$(./changed-urls.sh)"
|
||||||
|
echo "urls<<EOM" >> $GITHUB_OUTPUT
|
||||||
|
echo "$urls" >> $GITHUB_OUTPUT
|
||||||
|
echo "EOM" >> $GITHUB_OUTPUT
|
||||||
|
echo -e "CHANGED:\n$urls"
|
||||||
|
|
||||||
|
- name: Install Caddy
|
||||||
|
if: "${{ steps.changed_urls.outputs.urls != '' }}"
|
||||||
|
run: |
|
||||||
|
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
||||||
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
||||||
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install caddy
|
||||||
|
sudo systemctl disable --now caddy
|
||||||
|
|
||||||
|
- name: Compress
|
||||||
|
if: "${{ steps.changed_urls.outputs.urls != '' }}"
|
||||||
|
run: time ./compress.sh
|
||||||
|
|
||||||
|
- name: Audit using Lighthouse
|
||||||
|
if: "${{ steps.changed_urls.outputs.urls != '' }}"
|
||||||
|
uses: treosh/lighthouse-ci-action@v9
|
||||||
|
with:
|
||||||
|
uploadArtifacts: true
|
||||||
|
configPath: ./lighthouserc.yaml
|
||||||
|
runs: 3
|
||||||
|
serverBaseUrl: https://lhci.bbaovanc.com/
|
||||||
|
# this should be safe since it only allows adding (not deleting) data
|
||||||
|
serverToken: 2fca0410-95ae-4ea9-8dc6-687ed7843a3a
|
||||||
|
urls: ${{ steps.changed_urls.outputs.urls }}
|
||||||
|
|
||||||
|
|
||||||
audit:
|
audit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@ -23,7 +114,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
HUGO_MINIFY_TDEWOLFF_HTML_KEEPCOMMENTS=true HUGO_ENABLEMISSINGTRANSLATIONPLACEHOLDERS=true hugo --printI18nWarnings --printPathWarnings
|
HUGO_MINIFY_TDEWOLFF_HTML_KEEPCOMMENTS=true HUGO_ENABLEMISSINGTRANSLATIONPLACEHOLDERS=true hugo --buildDrafts --printI18nWarnings --printPathWarnings
|
||||||
|
|
||||||
# For the following steps, see
|
# For the following steps, see
|
||||||
# https://discourse.gohugo.io/t/audit-your-published-site-for-problems/35184
|
# https://discourse.gohugo.io/t/audit-your-published-site-for-problems/35184
|
||||||
|
2
.github/workflows/deploy.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
url: https://bbaovanc.com
|
url: https://bbaovanc.com
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
5
.github/workflows/pull_request.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@ -36,7 +36,7 @@ jobs:
|
|||||||
extended: true
|
extended: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo --printI18nWarnings --printPathWarnings --baseURL "https://demo.bbaovanc.com/pull_request/${{ github.event.number }}"
|
run: hugo --printI18nWarnings --printPathWarnings --baseURL "https://demo.bbaovanc.com/pull_request/${{ github.event.number }}" --buildDrafts
|
||||||
|
|
||||||
- name: Compress
|
- name: Compress
|
||||||
run: |
|
run: |
|
||||||
@ -91,5 +91,4 @@ jobs:
|
|||||||
A preview of this pull request is ready!
|
A preview of this pull request is ready!
|
||||||
See it at https://demo.bbaovanc.com/pull_request/${{ github.event.number }}/
|
See it at https://demo.bbaovanc.com/pull_request/${{ github.event.number }}/
|
||||||
View the deploy log at https://github.com/BBaoVanC/bbaovanc.com/actions/runs/${{ github.run_id}}
|
View the deploy log at https://github.com/BBaoVanC/bbaovanc.com/actions/runs/${{ github.run_id}}
|
||||||
Please note that currently the comment system is only operational on real deploys on bbaovanc.com. If you see an error, it's probably not your fault.
|
|
||||||
edit-mode: replace
|
edit-mode: replace
|
||||||
|
2
.github/workflows/pull_request_cleanup.yml
vendored
@ -1,7 +1,7 @@
|
|||||||
name: Pull Request Cleanup
|
name: Pull Request Cleanup
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request_target:
|
||||||
types:
|
types:
|
||||||
- closed
|
- closed
|
||||||
|
|
||||||
|
@ -1,57 +1,16 @@
|
|||||||
# Contributing to bobatheme
|
# Contributing to bobatheme
|
||||||
|
|
||||||
## Where to put stuff
|
## Where to put questions/issues/etc
|
||||||
|
|
||||||
### Discussions
|
Use the [GitHub Discussions forum][github-discussions-url] for any questions,
|
||||||
|
or ideas. Use the "Q&A" section for both questions and issues as well.
|
||||||
|
|
||||||
The best place to ask questions or have discussions is the (relatively new)
|
[github-discussions-url]: https://github.com/BBaoVanC/bbaovanc.com/discussions
|
||||||
discussions feature on GitHub, available
|
|
||||||
[here](https://github.com/BBaoVanC/bbaovanc.com/discussions). It's not too big
|
|
||||||
of an issue though because discussions and issues can easily be converted
|
|
||||||
between eachother.
|
|
||||||
|
|
||||||
### Issues
|
|
||||||
|
|
||||||
Issues should be used only for, well, issues. Ignore all the placeholder ones
|
|
||||||
prefixed with "Translate:" and tagged with the "translation" tag as they are
|
|
||||||
placeholders used in the projects tab. I might mark them as closed in the future
|
|
||||||
to clean it up but I'll worry about that later.
|
|
||||||
|
|
||||||
### Translations
|
|
||||||
|
|
||||||
Discussion relating to translations should either go as comments or reviews on
|
|
||||||
the pull request adding the translation, or as a discussion under the
|
|
||||||
[Translations category](https://github.com/BBaoVanC/bbaovanc.com/discussions/categories/translations).
|
|
||||||
|
|
||||||
## Writing translations
|
|
||||||
|
|
||||||
Translations should aim to get the meaning as close as possible to original
|
|
||||||
document. The changes in a translation pull request *should*:
|
|
||||||
|
|
||||||
- only update one page (multiple pages should be split into separate pull
|
|
||||||
requests)
|
|
||||||
- only contain changes for a single new file (no changes unrelated to
|
|
||||||
translation)
|
|
||||||
- thoroughly compared to the original text in order to get the same meaning
|
|
||||||
across
|
|
||||||
|
|
||||||
## Pull requests
|
|
||||||
|
|
||||||
### Commit messages
|
|
||||||
|
|
||||||
It's not too big of a deal what you put in your commit messages, but try to give
|
|
||||||
each commit a rough description of what it changes. I'll use squash merges most
|
|
||||||
of the time anyways.
|
|
||||||
|
|
||||||
### Description
|
|
||||||
|
|
||||||
If the pull request doesn't require any extra information in addition to the
|
|
||||||
title, you can probably leave the description blank. Otherwise you can put some
|
|
||||||
information, just try to keep it concise; it's better to read a couple sentences
|
|
||||||
than an entire essay with the same amount of information.
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
|
Just in case you need it.
|
||||||
|
|
||||||
## Automatic deploy previews with GitHub Actions
|
## Automatic deploy previews with GitHub Actions
|
||||||
|
|
||||||
My GitHub Actions workflows will automatically build each pull request into a
|
My GitHub Actions workflows will automatically build each pull request into a
|
||||||
@ -61,9 +20,10 @@ public deploy preview on demo.bbaovanc.com, and will link it in a comment.
|
|||||||
|
|
||||||
You can also build the site yourself using Hugo, including a live local preview.
|
You can also build the site yourself using Hugo, including a live local preview.
|
||||||
|
|
||||||
1. Make sure you install the latest version of Hugo, or at least the
|
1. Make sure you install the latest version of Hugo, or hopefully at least the
|
||||||
`min_version` listed in
|
`min_version` listed in
|
||||||
[theme.toml](https://github.com/BBaoVanC/bobatheme/blob/master/theme.toml#L11).
|
[theme.toml](https://github.com/BBaoVanC/bobatheme/blob/master/theme.toml#L11).
|
||||||
|
Let me know if that minimum version isn't enough and I'll fix it.
|
||||||
2. Clone the repo
|
2. Clone the repo
|
||||||
3. Make sure to download and checkout the submodules (use `git submodule update
|
3. Make sure to download and checkout the submodules (use `git submodule update
|
||||||
--init --recursive`). The `--recursive` flag is especially important because
|
--init --recursive`). The `--recursive` flag is especially important because
|
||||||
|
9
Caddyfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# vim: ft=caddyfile
|
||||||
|
|
||||||
|
https://localhost {
|
||||||
|
header Cache-Control no-cache
|
||||||
|
root * public/
|
||||||
|
file_server {
|
||||||
|
precompressed br gzip
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,8 @@
|
|||||||
# bbaovanc.com
|
# bbaovanc.com
|
||||||
|
|
||||||
My personal website, generated using [Hugo](https://gohugo.io)
|
My personal website, generated using [Hugo](https://gohugo.io)
|
||||||
|
|
||||||
|
## Discussions
|
||||||
|
|
||||||
|
Use [GitHub Discussions](https://github.com/BBaoVanC/bbaovanc.com/discussions)
|
||||||
|
for questions, ideas, discussions, etc. relating to me or my website.
|
||||||
|
121
assets/css/comments.css
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
/* Isso styling */
|
||||||
|
h4.isso-thread-heading {
|
||||||
|
color: var(--text-0);
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-comment:not(:first-of-type),
|
||||||
|
.isso-follow-up .isso-comment {
|
||||||
|
border-color: var(--background-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-author,
|
||||||
|
.isso-page-author-suffix,
|
||||||
|
.isso-comment-footer,
|
||||||
|
.isso-comment-footer .isso-votes {
|
||||||
|
color: var(--text-gray-0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-comment-header .isso-spacer,
|
||||||
|
.isso-spacer:hover,
|
||||||
|
.isso-permalink,
|
||||||
|
.isso-permalink:hover {
|
||||||
|
color: var(--text-gray-1) !important;
|
||||||
|
}
|
||||||
|
a.isso-author:hover,
|
||||||
|
.isso-permalink:hover {
|
||||||
|
text-decoration: underline !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-comment.isso-is-page-author > .isso-text-wrapper {
|
||||||
|
background-color: var(--background-accent-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-feedlink:hover,
|
||||||
|
.isso-reply {
|
||||||
|
color: var(--link-0) !important;
|
||||||
|
text-shadow: unset !important;
|
||||||
|
}
|
||||||
|
.isso-reply:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-text pre,
|
||||||
|
.isso-text :not(pre) > code {
|
||||||
|
background-color: var(--background-2);
|
||||||
|
border: none;
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 5px;
|
||||||
|
/* thanks isso.css for setting this to 85% for whatever reason */
|
||||||
|
font-size: 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-input-wrapper input,
|
||||||
|
.isso-post-action > input,
|
||||||
|
.isso-textarea,
|
||||||
|
.isso-preview {
|
||||||
|
color: var(--text-1);
|
||||||
|
background-color: var(--background-1);
|
||||||
|
border-color: var(--background-2) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-input-wrapper input:focus,
|
||||||
|
.isso-textarea:focus {
|
||||||
|
border-color: var(--background-3) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-post-action > input:hover {
|
||||||
|
background-color: var(--background-2);
|
||||||
|
}
|
||||||
|
.isso-post-action > input:focus,
|
||||||
|
.isso-post-action > input:active {
|
||||||
|
background-color: var(--background-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-textarea {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.isso-input-wrapper {
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-right: 4px;
|
||||||
|
max-width: 25%;
|
||||||
|
}
|
||||||
|
.isso-input-wrapper input {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
.isso-input-wrapper label {
|
||||||
|
order: 2;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
.isso-post-action {
|
||||||
|
margin-left: 4px;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
.isso-input-wrapper {
|
||||||
|
display: block;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.comments {
|
||||||
|
break-before: always;
|
||||||
|
}
|
||||||
|
.isso-comment {
|
||||||
|
max-width: unset;
|
||||||
|
}
|
||||||
|
.isso-text-wrapper {
|
||||||
|
break-inside: avoid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-postbox,
|
||||||
|
.isso-feedlink {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-target {
|
||||||
|
animation: target-fade 10s ease-out; /* defined in bobatheme */
|
||||||
|
}
|
3
assets/js/share-event.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
function share_event(service) {
|
||||||
|
plausible("Share", {props: {Network: service}});
|
||||||
|
}
|
8
changed-urls.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
diff -qrNtbB old/ new/ |
|
||||||
|
grep -oP '(?<=\s)new\/\S*' |
|
||||||
|
xargs -d '\n' ls -1d 2>/dev/null |
|
||||||
|
grep 'index.html$' |
|
||||||
|
sed 's/index.html$//' |
|
||||||
|
sed "s/^new/${SCHEME:=http}:\/\/${DOMAIN:=example.com}/"
|
57
config.yaml
@ -1,7 +1,7 @@
|
|||||||
baseURL: https://bbaovanc.com
|
baseURL: https://bbaovanc.com
|
||||||
theme: bobatheme
|
theme: bobatheme
|
||||||
defaultContentLanguage: en
|
defaultContentLanguage: en
|
||||||
copyright: '© 2021 bbaovanc <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>'
|
copyright: '© 2021-2023 bbaovanc <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>'
|
||||||
sectionPagesMenu: main
|
sectionPagesMenu: main
|
||||||
enableRobotsTXT: true
|
enableRobotsTXT: true
|
||||||
paginate: 10
|
paginate: 10
|
||||||
@ -16,13 +16,27 @@ author:
|
|||||||
markup: # this just keeps the bobatheme markup styling
|
markup: # this just keeps the bobatheme markup styling
|
||||||
_merge: deep
|
_merge: deep
|
||||||
|
|
||||||
|
related:
|
||||||
|
includeNewer: true
|
||||||
|
indices:
|
||||||
|
#- name: keywords
|
||||||
|
# weight: 100
|
||||||
|
- name: categories
|
||||||
|
weight: 80
|
||||||
|
- name: tags
|
||||||
|
weight: 80
|
||||||
|
- name: date
|
||||||
|
weight: 10
|
||||||
|
threshold: 80
|
||||||
|
toLower: true
|
||||||
|
|
||||||
params:
|
params:
|
||||||
# these are for the OpenGraph/Twitter embeds in Hugo
|
# these are for the OpenGraph/Twitter embeds in Hugo
|
||||||
description: My personal website
|
description: My personal website
|
||||||
|
|
||||||
# these are for favicons in bobatheme (unset by default)
|
# these are for favicons in bobatheme (disabled by default)
|
||||||
faviconICO: favicon.ico
|
faviconSVG: favicon.svg
|
||||||
faviconPNG: favicon.png
|
appleTouchPNG: apple-touch-icon.png
|
||||||
|
|
||||||
# show reading time (enabled by default)
|
# show reading time (enabled by default)
|
||||||
readingtime: true
|
readingtime: true
|
||||||
@ -30,9 +44,28 @@ params:
|
|||||||
# used for "View source" (unset by default)
|
# used for "View source" (unset by default)
|
||||||
gitFileURL: https://github.com/BBaoVanC/bbaovanc.com/blob/master
|
gitFileURL: https://github.com/BBaoVanC/bbaovanc.com/blob/master
|
||||||
gitFileIcon: code
|
gitFileIcon: code
|
||||||
|
gitHistoryURL: https://github.com/BBaoVanC/bbaovanc.com/commits/master
|
||||||
|
|
||||||
talkyardServerUrl: "https://talkyard.bbaovanc.com"
|
# display a "Latest Posts" section on the homepage below its content
|
||||||
talkyardScriptUrl: "https://talkyard.bbaovanc.com/-/talkyard-comments.min.js"
|
homepageLatestPosts: true
|
||||||
|
|
||||||
|
# social media share icons
|
||||||
|
shareButtons:
|
||||||
|
twitter: true
|
||||||
|
facebook: true
|
||||||
|
linkedin: true
|
||||||
|
reddit: true
|
||||||
|
telegram: true
|
||||||
|
print: true
|
||||||
|
|
||||||
|
# show "Latest Posts" section at bottom of content pages
|
||||||
|
# latestPostsOnContent: true
|
||||||
|
|
||||||
|
|
||||||
|
footer: >-
|
||||||
|
See the [anonymous and privacy-friendly
|
||||||
|
analytics](https://plausible.bbaovanc.com/bbaovanc.com) for this site,
|
||||||
|
powered by [Plausible](https://plausible.io).
|
||||||
|
|
||||||
# see https://gohugo.io/about/hugo-and-gdpr/#all-privacy-settings
|
# see https://gohugo.io/about/hugo-and-gdpr/#all-privacy-settings
|
||||||
# you probably want to keep this default
|
# you probably want to keep this default
|
||||||
@ -44,10 +77,8 @@ languages:
|
|||||||
languageName: English
|
languageName: English
|
||||||
title: bbaovanc's Website
|
title: bbaovanc's Website
|
||||||
weight: 1
|
weight: 1
|
||||||
|
menu:
|
||||||
es:
|
main:
|
||||||
languageName: Español
|
- identifier: status-page
|
||||||
title: sitio web de bbaovanc
|
name: Status Page
|
||||||
weight: 2
|
url: https://status.bbaovanc.com
|
||||||
params:
|
|
||||||
description: Mi sitio web personal
|
|
||||||
|
@ -3,22 +3,31 @@
|
|||||||
title: Home
|
title: Home
|
||||||
|
|
||||||
description: >-
|
description: >-
|
||||||
This is my website, home to my blog and other personal pages. It's powered by
|
This is my personal website, home to my blog. It's powered by my own custom
|
||||||
my own custom theme named bobatheme, available at
|
theme named bobatheme, which is available at
|
||||||
https://github.com/BBaoVanC/bobatheme.
|
https://github.com/BBaoVanC/bobatheme.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## My Website
|
## My Website
|
||||||
|
|
||||||
This is my website. Pretty self-explanatory.
|
This is my personal website. I wrote it myself from scratch using [my own
|
||||||
|
theme][bobatheme-github] and a static site generator named [Hugo][hugo-website].
|
||||||
|
I occasionally write blog posts under the [blog section][blog-section].
|
||||||
|
|
||||||
## A fresh new theme
|
[bobatheme-github]: https://github.com/BBaoVanC/bobatheme
|
||||||
|
[hugo-website]: https://gohugo.io
|
||||||
|
[blog-section]: {{< ref "/blog/" >}}
|
||||||
|
|
||||||
My website uses my own custom theme named
|
## Topics I write about
|
||||||
[bobatheme](https://github.com/BBaoVanC/bobatheme). Although it's not quite
|
|
||||||
finished yet, the current style will probably stay for the forseeable future.
|
|
||||||
|
|
||||||
## Another website
|
I write mostly about technology, including:
|
||||||
|
|
||||||
|
- Linux
|
||||||
|
- Open Source Software
|
||||||
|
- Programming
|
||||||
|
- Web Development
|
||||||
|
|
||||||
|
## My other website
|
||||||
|
|
||||||
I also run another website: https://boba.best.
|
I also run another website: https://boba.best.
|
||||||
|
8
content/authors/_index.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Authors
|
||||||
|
|
||||||
|
description: >-
|
||||||
|
List of authors on my website.
|
||||||
|
|
||||||
|
---
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
title: bbaovanc
|
title: bbaovanc
|
||||||
|
issoUserID: 284513e38f5c
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
title: Github Copilot
|
title: GitHub Copilot
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
title: Blog
|
|
||||||
|
|
||||||
description: >-
|
|
||||||
El hogar de mi blog.
|
|
||||||
|
|
||||||
---
|
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
title: Allow non root processes to bind to privileged ports in Linux
|
title: Allow non root processes to bind to privileged ports in Linux
|
||||||
date: 2021-03-28T21:29:52-05:00
|
date: 2021-03-28T21:29:52-05:00
|
||||||
|
lastmod: 2022-05-02T01:05:44-05:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
@ -11,20 +12,24 @@ authors:
|
|||||||
aliases:
|
aliases:
|
||||||
- posts/allow-non-root-processes-to-bind-to-privileged-ports/
|
- posts/allow-non-root-processes-to-bind-to-privileged-ports/
|
||||||
|
|
||||||
tags:
|
categories:
|
||||||
- guide
|
- guides
|
||||||
- linux
|
- linux
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- gitea
|
||||||
|
- systemd
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
In Linux, processes cannot bind to privileged ports (<=1024) unless they are
|
In Linux, processes cannot bind to privileged ports (<=1024) unless they are
|
||||||
running as root. Here's how to allow any process to bind to privileged ports.
|
running as root. Here's how to allow any process to bind to privileged ports.
|
||||||
|
|
||||||
<!--more-->
|
<!--more-->
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
In Linux, processes cannot bind to privileged ports (<=1024) unless they are
|
In Linux, processes cannot bind to privileged ports (<=1024) unless they are
|
||||||
running as root. I learned about this when I was trying to add SSH cloning to my
|
running as root. I learned about this when I was trying to add SSH cloning to my
|
||||||
[Gitea](https://gitea.io) instance. This can be bypassed by giving
|
[Gitea](https://gitea.io) instance. This can be bypassed by giving
|
||||||
`CAP_NET_BIND_SERVICE` capabilities to either the systemd service, or the
|
`CAP_NET_BIND_SERVICE` capabilities to either the systemd service, or the
|
||||||
@ -34,9 +39,9 @@ executable itself.
|
|||||||
|
|
||||||
### Using systemd (preferred)
|
### Using systemd (preferred)
|
||||||
|
|
||||||
The best way is to tell systemd to give `CAP_NET_BIND_SERVICE`
|
The best way is to tell systemd to give `CAP_NET_BIND_SERVICE` capabilities to
|
||||||
capabilities to the service. In fact, the Gitea systemd service has two
|
the service. In fact, the Gitea systemd service has two
|
||||||
lines[^1] that are commented out:
|
lines[^systemd-set-capabilities] that are commented out:
|
||||||
|
|
||||||
```systemd
|
```systemd
|
||||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||||
@ -48,7 +53,7 @@ Uncommenting these two lines was all I had to do for Gitea.
|
|||||||
### Using `setcap`
|
### Using `setcap`
|
||||||
|
|
||||||
You can add `CAP_NET_BIND_SERVICE` to the executable directly using `setcap`,
|
You can add `CAP_NET_BIND_SERVICE` to the executable directly using `setcap`,
|
||||||
allowing it to bind to any port. Run the following command[^2]:
|
allowing it to bind to any port. Run the following command[^setcap-command]:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
setcap 'cap_net_bind_service=+ep' /path/to/program
|
setcap 'cap_net_bind_service=+ep' /path/to/program
|
||||||
@ -57,7 +62,7 @@ setcap 'cap_net_bind_service=+ep' /path/to/program
|
|||||||
Note that this means that anyone with permission to run this program will be
|
Note that this means that anyone with permission to run this program will be
|
||||||
able to run it and bind to any privileged ports.
|
able to run it and bind to any privileged ports.
|
||||||
|
|
||||||
Other caveats[^2]:
|
Other caveats[^caveats-quote]:
|
||||||
|
|
||||||
> 1. You will need at least a 2.6.24 kernel
|
> 1. You will need at least a 2.6.24 kernel
|
||||||
> 2. This won't work if your file is a script. (ie, uses a #! line to launch an
|
> 2. This won't work if your file is a script. (ie, uses a #! line to launch an
|
||||||
@ -70,6 +75,10 @@ Other caveats[^2]:
|
|||||||
> privileges like setcap or suid. So if your program uses its own .../lib/,
|
> privileges like setcap or suid. So if your program uses its own .../lib/,
|
||||||
> you might have to look into another option like port forwarding.
|
> you might have to look into another option like port forwarding.
|
||||||
|
|
||||||
[^1]: https://github.com/go-gitea/gitea/blob/3416e2a82586fca4cd452b93237b979300f55d62/contrib/systemd/gitea.service#L69
|
|
||||||
and https://stackoverflow.com/a/47065825
|
[^systemd-set-capabilities]: See [these two lines in the Gitea systemd service
|
||||||
[^2]: https://stackoverflow.com/a/414258
|
file](https://github.com/go-gitea/gitea/blob/3416e2a82586fca4cd452b93237b979300f55d62/contrib/systemd/gitea.service#L69)
|
||||||
|
and [this Stack Overflow answer](https://stackoverflow.com/a/47065825).
|
||||||
|
|
||||||
|
[^setcap-command]: https://stackoverflow.com/a/414258
|
||||||
|
[^caveats-quote]: https://stackoverflow.com/a/414258
|
||||||
|
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,144 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Using GitHub Actions to audit my website with Google Chrome Lighthouse
|
||||||
|
date: 2022-05-07T00:54:11-05:00
|
||||||
|
lastmod: 2022-05-08T16:16:02-05:00
|
||||||
|
toc: true
|
||||||
|
comments: true
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- bbaovanc
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- devops
|
||||||
|
- meta
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- caddy
|
||||||
|
- github-actions
|
||||||
|
- google-lighthouse
|
||||||
|
|
||||||
|
# this will be shown for the article in list pages and in the page metadata
|
||||||
|
# it can be either an image or video (this might change in the future, however)
|
||||||
|
resources:
|
||||||
|
- name: feature
|
||||||
|
src: dashboard-performance-graph.webp
|
||||||
|
title: Picture of the `Performance` section on the Lighthouse CI dashboard
|
||||||
|
|
||||||
|
- name: youtube-embed-performance-comparison
|
||||||
|
src: youtube-embed-performance-comparison.webp
|
||||||
|
title: >-
|
||||||
|
Performance hit caused by adding a YouTube embed. You can see the
|
||||||
|
comparison itself [on this comparison
|
||||||
|
page](https://lhci.bbaovanc.com/app/projects/bbaovanc.com/compare/01d2064b6fac?baseUrl=https%3A%2F%2Flocalhost%2Fblog%2Fthe-redesign-of-my-website%2F&compareUrl=https%3A%2F%2Flocalhost%2Fblog%2Fyoutube-url-structures-you-should-know%2F&baseBuild=01d2064b-6fac-40df-b4e6-373037ae1f9e).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
The other day I set up automatic testing of my website using [Google Chrome
|
||||||
|
Lighthouse][google-lighthouse]. I'm also running my own Lighthouse CI server to
|
||||||
|
store test result history and show trends. Here's an outline of what this means,
|
||||||
|
some of the results I've obtained so far, and my thoughts on the usefulness of
|
||||||
|
Lighthouse.
|
||||||
|
|
||||||
|
[google-lighthouse]: https://developers.google.com/web/tools/lighthouse
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
## What is Lighthouse?
|
||||||
|
|
||||||
|
Lighthouse is a tool developed by Google which audits websites and gives them a
|
||||||
|
score in four categories: *Performance*, *Accessibility*, *Best Practices*, and
|
||||||
|
*SEO (search engine optimization)*. It's also built into the developer console
|
||||||
|
in Chrome, so you can run it manually on any website you want directly inside
|
||||||
|
your browser.
|
||||||
|
|
||||||
|
I have already been using Lighthouse manually to do occasional tests on my
|
||||||
|
website and its theme, [bobatheme][bobatheme]. However, I recently came across
|
||||||
|
[this GitHub Action][lhci-action]. It caught my eye because I was [already using
|
||||||
|
GitHub Actions][old-audit-workflow] to perform a few basic Hugo[^hugo]-related
|
||||||
|
audits found [in a thread on the Hugo forum][hugo-audits-thread].
|
||||||
|
|
||||||
|
[^hugo]: [Hugo](https://gohugo.io) is the framework that my website is built on. It's
|
||||||
|
a static site generator which generates my site according to my own custom
|
||||||
|
templates that make up my theme.
|
||||||
|
|
||||||
|
[bobatheme]: https://github.com/BBaoVanC/bobatheme
|
||||||
|
[lhci-action]: https://github.com/marketplace/actions/lighthouse-ci-action
|
||||||
|
[old-audit-workflow]: https://github.com/BBaoVanC/bbaovanc.com/blob/31e25c2578a789afe71ce90352747eb427ca3c0e/.github/workflows/audit.yml#L31-L59
|
||||||
|
[hugo-audits-thread]: https://discourse.gohugo.io/t/audit-your-published-site-for-problems/35184
|
||||||
|
|
||||||
|
## Setting it all up
|
||||||
|
|
||||||
|
My goal is to run Lighthouse's audits on an environment as similar to my real
|
||||||
|
website's deployment as possible.
|
||||||
|
|
||||||
|
First, I [created a separate `lighthouse` job on my audit
|
||||||
|
workflow][lighthouse-actions-job] on GitHub Actions. This job will do all of the
|
||||||
|
testing. Since it's a separate job, it runs in parallel with my existing audit
|
||||||
|
task.
|
||||||
|
|
||||||
|
[lighthouse-actions-job]: https://github.com/BBaoVanC/bbaovanc.com/blob/3668b6cfb11d09149b5da347219cdc75d0ce0985/.github/workflows/audit.yml#L7
|
||||||
|
|
||||||
|
Next, I copied [my existing build steps verbatim][production-build-steps]. This
|
||||||
|
makes the site effectively identical to my real deployment on bbaovanc.com. One
|
||||||
|
of the crucial steps is to pre-compress all the files so their compressed
|
||||||
|
versions can be served without the server having to compress them on-the-fly,
|
||||||
|
saving valuable processing power.
|
||||||
|
|
||||||
|
[production-build-steps]: https://github.com/BBaoVanC/bbaovanc.com/blob/db65e9fc23b840429f5c9ad2b43d7dd01a024f36/.github/workflows/deploy.yml#L22-L33
|
||||||
|
|
||||||
|
Serving the compressed files is crucial because it simulates the real world
|
||||||
|
transfer size of the files. In addition, Lighthouse will recommend that you
|
||||||
|
serve the files compressed.
|
||||||
|
|
||||||
|
Inside the audit environment I use the same webserver (Caddy) and a [similar
|
||||||
|
configuration][audit-caddy-config] (compared to the [one running on
|
||||||
|
bbaovanc.com][production-caddy-config]) to what I have running on bbaovanc.com.
|
||||||
|
Caddy also is able to easily run the demo site with HTTPS, even on localhost.
|
||||||
|
That allows it to test certain elements (such as the comment section) that
|
||||||
|
wouldn't be allowed to load if it were plain, unsecured HTTP.
|
||||||
|
|
||||||
|
[audit-caddy-config]: https://github.com/BBaoVanC/bbaovanc.com/blob/3668b6cfb11d09149b5da347219cdc75d0ce0985/Caddyfile
|
||||||
|
[production-caddy-config]: https://git.bbaovanc.com/configs/caddy/src/commit/e3227eb2a2679e27545c2417c2565941f03fb744/conf.d/bbaovanc.com
|
||||||
|
|
||||||
|
{{< see-also "/blog/caddy-is-the-best-webserver" >}}
|
||||||
|
|
||||||
|
I selected [a few significant pages on my website][lighthouse-urls] so
|
||||||
|
Lighthouse can test a wide range of the features in my website's theme. The
|
||||||
|
results of these tests are then uploaded to [my Lighthouse CI
|
||||||
|
server][lhci-dashboard]. There you can view the audit history and see
|
||||||
|
differences in results between builds.
|
||||||
|
|
||||||
|
[lighthouse-urls]: https://github.com/BBaoVanC/bbaovanc.com/blob/3668b6cfb11d09149b5da347219cdc75d0ce0985/lighthouserc.yaml#L4-L19
|
||||||
|
[lhci-dashboard]: https://lhci.bbaovanc.com/app/projects/bbaovanc.com/dashboard
|
||||||
|
|
||||||
|
## What I found from the tests
|
||||||
|
|
||||||
|
### Performance impact of a YouTube video
|
||||||
|
|
||||||
|
I found that embedding a YouTube video using the built-in shortcode in Hugo
|
||||||
|
made the website drastically slower. It's a lot clearer in the audit environment
|
||||||
|
where everything is throttled down a bunch, so the performance impact is more
|
||||||
|
clear. Below is a screenshot of the difference in score between my blog post
|
||||||
|
with a YouTube embed and a similarly sized blog post which has no video.
|
||||||
|
|
||||||
|
{{< figure src="youtube-embed-performance-comparison" >}}
|
||||||
|
|
||||||
|
I can probably optimize this a little by making a copy of the built-in Hugo
|
||||||
|
YouTube shortcode, and modifying it to defer the loading of the remote scripts.
|
||||||
|
That will have to be a future project, and I'll probably write a post if I ever
|
||||||
|
end up testing it.
|
||||||
|
|
||||||
|
## My thoughts on Lighthouse
|
||||||
|
|
||||||
|
You can make the argument that the results from Lighthouse don't really mean
|
||||||
|
much in the real world. On modern devices and a decent internet speed most
|
||||||
|
websites will load just fine.
|
||||||
|
|
||||||
|
Although most pages on my site have a perfect score from Lighthouse, I'm not
|
||||||
|
going to go way out of my way in order to keep it that way. After all,
|
||||||
|
Lighthouse is just a tool intended for "improving the quality of web
|
||||||
|
pages."[^improve-quality-quote] That doesn't mean it needs to be perfect.
|
||||||
|
|
||||||
|
[^improve-quality-quote]: Source: [Google
|
||||||
|
Developers](https://developers.google.com/web/tools/lighthouse)
|
After Width: | Height: | Size: 33 KiB |
105
content/blog/blog-post-newsletter/index.md
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Newsletter for my blog posts
|
||||||
|
date: 2022-04-30T01:00:14-05:00
|
||||||
|
lastmod: 2022-05-23T02:17:47-05:00
|
||||||
|
toc: true
|
||||||
|
comments: true
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- bbaovanc
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- meta
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- bobanews
|
||||||
|
- listmonk
|
||||||
|
- newsletter
|
||||||
|
|
||||||
|
# this will be shown for the article in list pages and in the page metadata
|
||||||
|
# it can be either an image or video (this might change in the future, however)
|
||||||
|
resources:
|
||||||
|
- name: feature
|
||||||
|
src: listmonk-bobatheme-template.webp
|
||||||
|
title: My custom newsletter template based on my website's custom theme.
|
||||||
|
|
||||||
|
- name: listmonk-splash
|
||||||
|
src: listmonk-splash.webp
|
||||||
|
title: >-
|
||||||
|
Dashboard on listmonk ---
|
||||||
|
[source](https://listmonk.app/static/images/splash.png)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
I created a newsletter for blog posts on my website so you can sign up for email
|
||||||
|
notifications when I post new ones, so I have more than just an RSS feed.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
{{< aside warning >}}
|
||||||
|
I decided that I didn't really want to deal with the extra work of managing a
|
||||||
|
newsletter so I've removed it. (I didn't actually get any sign-ups).
|
||||||
|
{{< /aside >}}
|
||||||
|
|
||||||
|
**See the ["Signing Up" section]({{< ref "#signing-up" >}}) for instructions on
|
||||||
|
how to sign up for the newsletter.**
|
||||||
|
|
||||||
|
## Choosing the right mailing list manager
|
||||||
|
|
||||||
|
For my newsletter manager, I chose [listmonk](https://listmonk.app/). As I was
|
||||||
|
searching for self-hosted newsletter managers, it caught my eye because of how
|
||||||
|
modern and beautiful its interface looks. In fact, it was the only self-hosted
|
||||||
|
newsletter/mailing list manager I looked at that doesn't have an overall old and
|
||||||
|
ugly interface. Additionally, it has a live demo, so I was able to test it out
|
||||||
|
and see if it would be able to meet my (relatively low) requirements.
|
||||||
|
|
||||||
|
{{< figure src="listmonk-splash" >}}
|
||||||
|
|
||||||
|
I also tried out [GNU Mailman 3](https://www.list.org/) about a year ago.
|
||||||
|
However, I could not get it to integrate cleanly with my email
|
||||||
|
server[^mailman-mailcow]. listmonk can operate over SMTP, just like any other
|
||||||
|
program that sends mail. That makes the setup much less complicated, and I was
|
||||||
|
also able to set up the [official Docker
|
||||||
|
image](https://listmonk.app/docs/installation/#docker) using Docker Compose
|
||||||
|
setup just like the other programs I use.
|
||||||
|
|
||||||
|
If you're interested, the Docker Compose configuration files I ended up writing
|
||||||
|
are available at [configs/listmonk on my Gitea
|
||||||
|
instance](https://git.bbaovanc.com/configs/listmonk).
|
||||||
|
|
||||||
|
## Newsletter formatting
|
||||||
|
|
||||||
|
I ended up writing my own template for listmonk from scratch, based on the CSS
|
||||||
|
used in [bobatheme](https://github.com/BBaoVanC/bobatheme), the theme that my
|
||||||
|
website uses. Here's a screenshot of how it currently looks:
|
||||||
|
|
||||||
|
{{< figure src="feature" >}}
|
||||||
|
|
||||||
|
## Signing up
|
||||||
|
|
||||||
|
{{< aside warning >}}
|
||||||
|
I decided that I didn't really want to deal with the extra work of managing a
|
||||||
|
newsletter so I've removed it. (I didn't actually get any sign-ups anyways.)
|
||||||
|
{{< /aside >}}
|
||||||
|
|
||||||
|
You can sign up to get emails about new posts on the [newsletter signup form
|
||||||
|
here](https://lists.bbaovanc.com/subscription/form). Make sure the box next to
|
||||||
|
the list labeled `bbaovanc.com Blog Posts` is checked. You'll need to provide an
|
||||||
|
email address, and optionally a nickname (or your real name if you want).
|
||||||
|
|
||||||
|
Right now there's only one list with public signup enabled, but that may change
|
||||||
|
if you're reading this in the future. In that case, you can sign up for as many
|
||||||
|
or as few lists as you want.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[^mailman-mailcow]: Mailman requires access to the mail server over
|
||||||
|
[LMTP](https://en.wikipedia.org/wiki/Local_Mail_Transfer_Protocol). However,
|
||||||
|
giving it access to my mail server over LMTP is not very easy because of the
|
||||||
|
setup that [Mailcow](https://mailcow.email) (my email server) uses. There *is*
|
||||||
|
an existing project called
|
||||||
|
[dockerized-mailcow-mailman](https://github.com/g4rf/dockerized-mailcow-mailman),
|
||||||
|
but it uses the Apache web server to serve the frontend. I'm not familiar with
|
||||||
|
Apache, and also I don't really want to complicate my Mailcow setup switching
|
||||||
|
to an almost completely different setup just for one little program.
|
After Width: | Height: | Size: 13 KiB |
BIN
content/blog/blog-post-newsletter/listmonk-splash.webp
Normal file
After Width: | Height: | Size: 24 KiB |
@ -2,16 +2,21 @@
|
|||||||
|
|
||||||
title: Caddy is literally the best webserver
|
title: Caddy is literally the best webserver
|
||||||
date: 2021-11-13T00:43:35-06:00
|
date: 2021-11-13T00:43:35-06:00
|
||||||
|
lastmod: 2023-01-16T20:57:00-06:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- bbaovanc
|
- bbaovanc
|
||||||
|
|
||||||
tags:
|
categories:
|
||||||
- linux
|
- linux
|
||||||
- webserver
|
- sysadmin
|
||||||
|
- software
|
||||||
|
|
||||||
|
tags:
|
||||||
- caddy
|
- caddy
|
||||||
|
- webserver
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- name: feature
|
- name: feature
|
||||||
@ -37,14 +42,14 @@ for general use.
|
|||||||
## Built-in automatic HTTPS
|
## Built-in automatic HTTPS
|
||||||
|
|
||||||
Caddy can fetch certificates from Let's Encrypt and ZeroSSL out of the box.
|
Caddy can fetch certificates from Let's Encrypt and ZeroSSL out of the box.
|
||||||
HTTPS is enabled by default for eligible domains[^1], unless you explicitly tell
|
HTTPS is enabled by default for eligible domains[^hostname-requirements], unless
|
||||||
it not to.
|
you explicitly tell it not to.
|
||||||
|
|
||||||
### Incredible cipher security
|
### Incredible cipher security
|
||||||
|
|
||||||
Caddy has incredible defaults for TLS/SSL ciphers. Any site you host on Caddy
|
Caddy has incredible defaults for TLS/SSL ciphers. Any site you host on Caddy
|
||||||
gets a perfect score from [Qualys SSL Labs](https://www.ssllabs.com/ssltest/)
|
gets a perfect score from [Qualys SSL Labs](https://www.ssllabs.com/ssltest/)
|
||||||
out of the box.[^2]
|
out of the box.[^caddy-qualys-score]
|
||||||
|
|
||||||
## Dead simple configuration files: Caddy vs NGINX
|
## Dead simple configuration files: Caddy vs NGINX
|
||||||
|
|
||||||
@ -90,9 +95,9 @@ configs.
|
|||||||
### PHP (PrivateBin)
|
### PHP (PrivateBin)
|
||||||
|
|
||||||
The Caddy config for this example is the same as the [one used for
|
The Caddy config for this example is the same as the [one used for
|
||||||
bin.boba.best](https://git.boba.best/configs/caddy/src/commit/cd00151fbdd784979a8a181980cc36061be68c7d/conf.d/bin.boba.best).
|
bin.boba.best](https://git.boba.best/boba.best/caddy/src/commit/cd00151fbdd784979a8a181980cc36061be68c7d/conf.d/bin.boba.best).
|
||||||
I've stripped it down a bit by removing the [custom error
|
I've stripped it down a bit by removing the [custom error
|
||||||
pages](https://git.boba.best/configs/caddy/src/commit/cd00151fbdd784979a8a181980cc36061be68c7d/Caddyfile#L15-L24),
|
pages](https://git.boba.best/boba.best/caddy/src/commit/cd00151fbdd784979a8a181980cc36061be68c7d/Caddyfile#L15-L24),
|
||||||
[HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security), [zstd
|
[HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security), [zstd
|
||||||
compression](https://github.com/facebook/zstd), and logging.
|
compression](https://github.com/facebook/zstd), and logging.
|
||||||
|
|
||||||
@ -132,7 +137,7 @@ server {
|
|||||||
### Reverse proxy + static files (Gitea)
|
### Reverse proxy + static files (Gitea)
|
||||||
|
|
||||||
This last example is based on
|
This last example is based on
|
||||||
[git.bbaovanc.com](https://git.bbaovanc.com/configs/caddy/src/commit/57c9f0011eae92ef5fa2992d99f01b0956802d64/conf.d/git.bbaovanc.com).
|
[git.bbaovanc.com](https://git.bbaovanc.com/boba.best/caddy/src/commit/57c9f0011eae92ef5fa2992d99f01b0956802d64/conf.d/git.bbaovanc.com).
|
||||||
Just like the last example, I've stripped off the custom error pages, HSTS, zstd
|
Just like the last example, I've stripped off the custom error pages, HSTS, zstd
|
||||||
compression, and logging.
|
compression, and logging.
|
||||||
|
|
||||||
@ -194,12 +199,12 @@ templates](https://pkg.go.dev/text/template). This means you can make simple
|
|||||||
dynamic content while only using Caddy!
|
dynamic content while only using Caddy!
|
||||||
|
|
||||||
In fact, the [official Caddy website](https://caddyserver.com) is generated
|
In fact, the [official Caddy website](https://caddyserver.com) is generated
|
||||||
entirely using Caddy's and Go templates![^3]
|
entirely using Caddy's and Go templates![^caddy-templating]
|
||||||
|
|
||||||
#### Error pages using HTTP Cats
|
#### Error pages using HTTP Cats
|
||||||
|
|
||||||
I use [this
|
I use [this
|
||||||
snippet](https://git.bbaovanc.com/configs/caddy/src/commit/57c9f0011eae92ef5fa2992d99f01b0956802d64/Caddyfile#L8-L15)
|
snippet](https://git.bbaovanc.com/boba.best/caddy/src/commit/57c9f0011eae92ef5fa2992d99f01b0956802d64/Caddyfile#L8-L15)
|
||||||
on both bbaovanc.com and boba.best to make custom error pages using images from
|
on both bbaovanc.com and boba.best to make custom error pages using images from
|
||||||
[HTTP Cats](https://http.cat). It uses Caddy's template support to generate some
|
[HTTP Cats](https://http.cat). It uses Caddy's template support to generate some
|
||||||
simple HTML to show the error code, name, and cat image.
|
simple HTML to show the error code, name, and cat image.
|
||||||
@ -217,12 +222,14 @@ border around the image.
|
|||||||
{{< figure src="caddy-browse" >}}
|
{{< figure src="caddy-browse" >}}
|
||||||
|
|
||||||
|
|
||||||
[^1]: The rules for what domains have automatic HTTPS by default are
|
[^hostname-requirements]: For the rules on what domains have automatic HTTPS by
|
||||||
[here](https://caddyserver.com/docs/automatic-https#hostname-requirements)
|
default, see ["Hostname requirements" on the Caddy
|
||||||
|
documentation](https://caddyserver.com/docs/automatic-https#hostname-requirements).
|
||||||
|
|
||||||
[^2]: SSL Labs caps the score to an A if HSTS isn't enabled. After enabling it,
|
[^caddy-qualys-score]: SSL Labs caps the score to an A if HSTS isn't enabled.
|
||||||
then you get a perfect A+ score. See
|
After enabling it, then you get a perfect A+ score. See [my website's
|
||||||
https://www.ssllabs.com/ssltest/analyze.html?d=bbaovanc.com&latest
|
score](https://www.ssllabs.com/ssltest/analyze.html?d=bbaovanc.com&latest)
|
||||||
([archived](https://archive.today/4JJDN)) for an example (bbaovanc.com).
|
([archived](https://archive.today/4JJDN)) for an example (bbaovanc.com).
|
||||||
|
|
||||||
[^3]: See more info [on the Caddy docs](https://caddyserver.com/docs/caddyfile/directives/templates#examples)
|
[^caddy-templating]: See more info about templating [on the Caddy
|
||||||
|
docs](https://caddyserver.com/docs/caddyfile/directives/templates#examples)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
title: Checkra1n GUI on other Linux distros
|
title: Checkra1n GUI on other Linux distros
|
||||||
date: 2021-03-25T21:19:51-05:00
|
date: 2021-03-25T21:19:51-05:00
|
||||||
|
lastmod: 2021-10-16T21:25:38-05:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
@ -11,11 +12,13 @@ authors:
|
|||||||
aliases:
|
aliases:
|
||||||
- posts/checkra1n-gui-on-other-distros/
|
- posts/checkra1n-gui-on-other-distros/
|
||||||
|
|
||||||
tags:
|
categories:
|
||||||
- guide
|
- guides
|
||||||
- linux
|
|
||||||
- archlinux
|
|
||||||
- jailbreak
|
- jailbreak
|
||||||
|
- linux
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- arch-linux
|
||||||
- checkra1n
|
- checkra1n
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
@ -2,19 +2,24 @@
|
|||||||
|
|
||||||
# this is the title it generated. not even joking
|
# this is the title it generated. not even joking
|
||||||
title: Copilot
|
title: Copilot
|
||||||
date: 2021-11-07T16:17:15-06:00
|
date: 2021-11-07T16:20:15-06:00
|
||||||
|
lastmod: 2021-11-07T16:20:15-06:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- GitHub Copilot
|
- GitHub Copilot
|
||||||
- bbaovanc
|
|
||||||
|
categories:
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- github-copilot
|
- github-copilot
|
||||||
|
|
||||||
series:
|
series:
|
||||||
- GitHub Copilot Experiments
|
- github-copilot-experiments
|
||||||
|
|
||||||
|
_build:
|
||||||
|
list: never
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
BIN
content/blog/discord-sex-hack/6969th.webp
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
content/blog/discord-sex-hack/chess.webp
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
content/blog/discord-sex-hack/default-sex.webp
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
content/blog/discord-sex-hack/double-sex.webp
Normal file
After Width: | Height: | Size: 139 KiB |
BIN
content/blog/discord-sex-hack/example.webp
Normal file
After Width: | Height: | Size: 56 KiB |
295
content/blog/discord-sex-hack/index.md
Normal file
@ -0,0 +1,295 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: How the "Discord sex" (`s/e/x`) hack works
|
||||||
|
date: 2022-05-11T21:11:17-05:00
|
||||||
|
lastmod: 2022-09-24T14:56:05-05:00
|
||||||
|
toc: true
|
||||||
|
comments: true
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- bbaovanc
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- tips-and-tricks
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- discord
|
||||||
|
- discord-tricks
|
||||||
|
- sed
|
||||||
|
|
||||||
|
_build:
|
||||||
|
# won't appear on main Home page, but will in Blog
|
||||||
|
list: local
|
||||||
|
|
||||||
|
# this will be shown for the article in list pages and in the page metadata
|
||||||
|
# it can be either an image or video (this might change in the future, however)
|
||||||
|
resources:
|
||||||
|
- name: feature
|
||||||
|
src: example.webp
|
||||||
|
title: Result after sending a GIF and then sending `s/e/x`.
|
||||||
|
|
||||||
|
- name: default-sex
|
||||||
|
src: default-sex.webp
|
||||||
|
title: Fallback image on `txnor.com`
|
||||||
|
|
||||||
|
- name: double-sex
|
||||||
|
src: double-sex.webp
|
||||||
|
title: Resulting image after typing `s/e/x` a second time.
|
||||||
|
|
||||||
|
- name: chess
|
||||||
|
src: chess.webp
|
||||||
|
title: This happens once you type `s/w/ag` after having done `s/e/x`.
|
||||||
|
|
||||||
|
- name: sword
|
||||||
|
src: sword.webp
|
||||||
|
title: This happens when you type `s/w/ord` after having done `s/e/x`.
|
||||||
|
- name: sword-atk
|
||||||
|
src: sword-atk.webp
|
||||||
|
title: This happens when you type `s/d/dATK`
|
||||||
|
- name: sword-def
|
||||||
|
src: sword-def.webp
|
||||||
|
title: This happens when you type `s/d/dDEF`
|
||||||
|
- name: sword-hug
|
||||||
|
src: sword-hug.webp
|
||||||
|
title: This happens when you type `s/d/dHUG`
|
||||||
|
- name: sword-win
|
||||||
|
src: sword-win.webp
|
||||||
|
title: Win screen on the `s/w/ord` game.
|
||||||
|
- name: sword-lose
|
||||||
|
src: sword-lose.webp
|
||||||
|
title: Lose screen on the `s/w/ord` game.
|
||||||
|
|
||||||
|
- name: 6969th
|
||||||
|
src: 6969th.webp
|
||||||
|
title: This happens on average (since it's randomized) every 6070th use.
|
||||||
|
|
||||||
|
- name: math-challenge
|
||||||
|
src: math-challenge.webp
|
||||||
|
title: Math challenge example
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
There's this trick going around on Discord recently where if you send any GIF
|
||||||
|
from Tenor, and then type `s/e/x`, then it turns it into a different meme GIF.
|
||||||
|
Here's how it works.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
{{< aside info >}}
|
||||||
|
Credit goes to Rebane2001 (not me) for making this trick, and setting it up on
|
||||||
|
`txnor.com`.
|
||||||
|
{{< /aside >}}
|
||||||
|
|
||||||
|
## The `sed` syntax
|
||||||
|
|
||||||
|
For operating systems based on Unix or Linux, there's usually a simple terminal
|
||||||
|
command included called [`sed`][sed-wikipedia], which is most commonly used to
|
||||||
|
run text replacement commands. Here's a very simple example of what a basic
|
||||||
|
`sed` command looks like:
|
||||||
|
|
||||||
|
[sed-wikipedia]: https://en.wikipedia.org/wiki/Sed
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
$ sed 's/hello/goodbye/'
|
||||||
|
```
|
||||||
|
|
||||||
|
Discord likely implemented this in order to appeal to
|
||||||
|
[IRC][irc-wikipedia][^irc-definition] users. Since IRC doesn't support editing
|
||||||
|
messages, it's common for people to send messages in that format to tell people
|
||||||
|
about changes to their previous message. Discord implemented this into both
|
||||||
|
their web/desktop client and their iOS app, excluding the Android app.
|
||||||
|
|
||||||
|
[irc-wikipedia]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
|
||||||
|
|
||||||
|
[^irc-definition]: IRC (Internet Relay Chat) is a simple text-based chat system.
|
||||||
|
It's a very old protocol, however its simplicity and minimalism is the main
|
||||||
|
reason people choose it. It's not very popular anymore.
|
||||||
|
|
||||||
|
Note that while real `sed` commands can get much more complicated, Discord's
|
||||||
|
implementation doesn't support those advanced features[^trailing-slash-note].
|
||||||
|
|
||||||
|
[^trailing-slash-note]: Also note that in Discord's implementation, the trailing
|
||||||
|
slash (after `goodbye`) can be ommitted (making it just `s/hello/goodbye`),
|
||||||
|
but with the real `sed` command, it's required.
|
||||||
|
|
||||||
|
{{< see-also "/blog/text-substitution-in-discord-using-sed" >}}
|
||||||
|
|
||||||
|
## What does `s/e/x` do?
|
||||||
|
|
||||||
|
When you send a GIF using the GIF picker on Discord, it actually sends the link
|
||||||
|
to the GIF, which is served by [Tenor][tenor-website]. For example, here's a GIF
|
||||||
|
sent from Tenor:
|
||||||
|
|
||||||
|
[tenor-website]: https://tenor.com
|
||||||
|
|
||||||
|
https://tenor.com/view/cat-massage-gif-24282757
|
||||||
|
|
||||||
|
Running `s/e/x` will take the first occurrence of `e` and replace it with `x`.
|
||||||
|
The link becomes the following (notice the bolded letter `x`):
|
||||||
|
|
||||||
|
[https://t**x**nor.com/view/cat-massage-gif-24282757][example-1]
|
||||||
|
|
||||||
|
[example-1]: https://txnor.com/view/cat-massage-gif-24282757
|
||||||
|
|
||||||
|
Then, all that's left to do is to buy the domain `txnor.com`, and write a simple
|
||||||
|
program to run on it. In fact, it looks like that domain was purchased purely in
|
||||||
|
order to make this trick possible[^txnor-domain-date].
|
||||||
|
|
||||||
|
[^txnor-domain-date]: According to [a quick WHOIS lookup][txnor-whois], the
|
||||||
|
domain was registered on May 3, 2022. That's the same day that [@Rebane
|
||||||
|
tweeted about the new feature][rebane-tweet] (~~going to https://txnor.com
|
||||||
|
redirects to this tweet~~ now the domain redirects to [Rebane's YouTube video
|
||||||
|
about the hack]({{< ref "#youtube-video" >}})), so I assume that this is the
|
||||||
|
only reason they bought the domain.
|
||||||
|
|
||||||
|
[txnor-whois]: https://www.whois.com/whois/txnor.com
|
||||||
|
[rebane-tweet]: https://twitter.com/rebane2001/status/1521544722875142145
|
||||||
|
|
||||||
|
## How does it display on Discord without redirecting?
|
||||||
|
|
||||||
|
When viewing any of the URLs on `txnor.com` in a normal web browser, you get
|
||||||
|
[redirected to a tweet][rebane-tweet]. However, Discord is able to display the
|
||||||
|
image without being redirected.
|
||||||
|
|
||||||
|
When Discord loads a website to generate an embed, it uses a user
|
||||||
|
agent[^user-agent-definition] (which is a little piece of text which tells the
|
||||||
|
server what your browser is) which looks something like this:
|
||||||
|
|
||||||
|
[^user-agent-definition]: If you actually care, there's a [Wikipedia
|
||||||
|
article](https://en.wikipedia.org/wiki/User_agent), and a [page on
|
||||||
|
WhatIsMyIPAddress.com](https://whatismyipaddress.com/user-agent) which also
|
||||||
|
explain what a user agent is.
|
||||||
|
|
||||||
|
```text
|
||||||
|
User-Agent: Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com/)
|
||||||
|
```
|
||||||
|
|
||||||
|
The important part here is the word `Discord`. If you visit the website with
|
||||||
|
your user agent set to anything containing `Discord`
|
||||||
|
(case-insensitive)[^discord-user-agent], then it serves the image directly.
|
||||||
|
|
||||||
|
[^discord-user-agent]: [According to the source code][user-agent-source-code],
|
||||||
|
it looks like `Intel Mac OS X 11.6; rv:92.0` also triggers the same response.
|
||||||
|
|
||||||
|
[user-agent-source-code]: https://github.com/rebane2001/txnor-server/blob/26c7c279b0b4668c8a3b061692d83c507aeac7c5/txnor.nginx#L23-L27
|
||||||
|
|
||||||
|
## Default image
|
||||||
|
|
||||||
|
If you go to any URL on `txnor.com` that doesn't fit one of the existing
|
||||||
|
patterns/games, then it returns this fallback image:
|
||||||
|
|
||||||
|
{{< figure src="default-sex" >}}
|
||||||
|
|
||||||
|
## Extra features
|
||||||
|
|
||||||
|
### Double sex
|
||||||
|
|
||||||
|
If you then run `s/e/x` a second time, then it changes to a different image:
|
||||||
|
|
||||||
|
{{< figure src="double-sex" >}}
|
||||||
|
|
||||||
|
This works in a simple way as well. The next `e` that appears in the URL is
|
||||||
|
inside `/view/`. So, after typing `s/e/x` a second time, the URL becomes:
|
||||||
|
|
||||||
|
[https://txnor.com/vi**x**w/cat-massage-gif-24282757][example-2]
|
||||||
|
|
||||||
|
[example-2]: https://txnor.com/vixw/cat-massage-gif-24282757
|
||||||
|
|
||||||
|
### Chess (`s/w/ag`)
|
||||||
|
|
||||||
|
Another cool feature is that you can play chess by typing `s/w/ag` after typing
|
||||||
|
the initial message of `s/e/x`.
|
||||||
|
|
||||||
|
{{< figure src="chess" >}}
|
||||||
|
|
||||||
|
### `s/w/ord`
|
||||||
|
|
||||||
|
If you do `s/w/ord` after `s/e/x`, then it starts a fighting game (titled
|
||||||
|
"Wumpagotchi Adventures". You can use three commands: s/d/d**ATK**,
|
||||||
|
s/d/d**DEF**, and s/d/d**HUG**.
|
||||||
|
|
||||||
|
Here are a few example images:
|
||||||
|
|
||||||
|
#### Main `s/w/ord` screen
|
||||||
|
|
||||||
|
{{< figure src="sword" >}}
|
||||||
|
|
||||||
|
#### ATK command
|
||||||
|
|
||||||
|
{{< figure src="sword-atk" >}}
|
||||||
|
|
||||||
|
#### DEF command
|
||||||
|
|
||||||
|
{{< figure src="sword-def" >}}
|
||||||
|
|
||||||
|
#### HUG command
|
||||||
|
|
||||||
|
{{< figure src="sword-hug" >}}
|
||||||
|
|
||||||
|
#### Win screen
|
||||||
|
|
||||||
|
{{< figure src="sword-win" >}}
|
||||||
|
|
||||||
|
#### Lose screen
|
||||||
|
|
||||||
|
{{< figure src="sword-lose" >}}
|
||||||
|
|
||||||
|
### 6969th Discord Sexer
|
||||||
|
|
||||||
|
If you happen to get a one in 6970 chance, it will instead return
|
||||||
|
a special image:
|
||||||
|
|
||||||
|
{{< figure src="6969th" >}}
|
||||||
|
|
||||||
|
[6969th-source]: https://github.com/rebane2001/txnor-server/blob/26c7c279b0b4668c8a3b061692d83c507aeac7c5/sex.py#L130-L133
|
||||||
|
|
||||||
|
Here's a [snippet of the code that handles this chance][6969th-source]:
|
||||||
|
|
||||||
|
```python
|
||||||
|
# 6969th winner image (disable for chess)
|
||||||
|
if random.randint(0, 6969) == 6969 and "ag" not in name:
|
||||||
|
web.header('Cache-Control', 'no-store')
|
||||||
|
return six_nine
|
||||||
|
```
|
||||||
|
|
||||||
|
I believe it's supposed to be a 1/6969 chance, but `random.randint` in Python
|
||||||
|
[includes both numbers][randint-inclusive]. That means that the possible numbers that it could pick
|
||||||
|
would be 0, 1, ... 6968, 6969. If you were to count the numbers included in that
|
||||||
|
sequence, it would total 6970.
|
||||||
|
|
||||||
|
[randint-inclusive]: https://docs.python.org/3/library/random.html#random.randint
|
||||||
|
|
||||||
|
### Math challenge
|
||||||
|
|
||||||
|
Any URL that matches [this regular expression][math-challenge-regex] will
|
||||||
|
instead return a randomized math challenge:
|
||||||
|
|
||||||
|
[math-challenge-regex]: https://regex101.com/r/ddEkML/1
|
||||||
|
|
||||||
|
{{< figure src="math-challenge" >}}
|
||||||
|
|
||||||
|
What's special is that the math challenge is [set to not be
|
||||||
|
cached][math-challenge-caching].
|
||||||
|
|
||||||
|
[math-challenge-caching]: https://github.com/rebane2001/txnor-server/blob/26c7c279b0b4668c8a3b061692d83c507aeac7c5/sex.py#L137
|
||||||
|
|
||||||
|
How it works is that when each person's Discord client sends a request to the
|
||||||
|
Discord CDN to get the image, the client caches that image. That means each
|
||||||
|
client will see the same challenge problem, even if the user restarts the
|
||||||
|
client. But separate clients will not have it cached, so they'll request it
|
||||||
|
again themselves, and different numbers will be generated.
|
||||||
|
|
||||||
|
## Discord sex is open source
|
||||||
|
|
||||||
|
Thanks to a [comment from Rebane on this post](#isso-16), I now know that the
|
||||||
|
server running on `txnor.com` is open source. See
|
||||||
|
[rebane2001/txnor-server][txnor-server-github].
|
||||||
|
|
||||||
|
[txnor-server-github]: https://github.com/rebane2001/txnor-server
|
||||||
|
|
||||||
|
## YouTube video
|
||||||
|
|
||||||
|
Rebane also [made a YouTube video][txnor-youtube-video] about this trick. Make
|
||||||
|
sure to check it out too!
|
||||||
|
|
||||||
|
[txnor-youtube-video]: https://www.youtube.com/watch?v=km8CR-fdB7o
|
BIN
content/blog/discord-sex-hack/math-challenge.webp
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
content/blog/discord-sex-hack/sword-atk.webp
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
content/blog/discord-sex-hack/sword-def.webp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
content/blog/discord-sex-hack/sword-hug.webp
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
content/blog/discord-sex-hack/sword-lose.webp
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
content/blog/discord-sex-hack/sword-win.webp
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
content/blog/discord-sex-hack/sword.webp
Normal file
After Width: | Height: | Size: 47 KiB |
@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
title: Put `(edited)` in the middle of a message in Discord
|
title: How to put `(edited)` in the middle of a message in Discord
|
||||||
date: 2021-03-25T18:48:34-05:00
|
date: 2021-03-25T18:48:34-05:00
|
||||||
|
lastmod: 2022-12-06T19:59:22-06:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
@ -11,8 +12,11 @@ authors:
|
|||||||
aliases:
|
aliases:
|
||||||
- posts/edited-in-middle-of-message-discord/
|
- posts/edited-in-middle-of-message-discord/
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- guides
|
||||||
|
- tips-and-tricks
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- tutorial
|
|
||||||
- discord
|
- discord
|
||||||
- discord-tricks
|
- discord-tricks
|
||||||
|
|
||||||
@ -23,12 +27,19 @@ resources:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
With a bit of trickery using the RLE character (U+202B), you can get the
|
You might have seen a trick on Discord where the little `(edited)` caption
|
||||||
`(edited)` text on a message to be somewhere other than at the end of the
|
appears in the middle of a message instead of at the end. With a small hack
|
||||||
message.
|
involving the [right-to-left embedding character
|
||||||
|
(U+202B)](https://unicode-explorer.com/c/202B), the `(edited)` text can be moved
|
||||||
|
to any location inside the message.
|
||||||
|
|
||||||
<!--more-->
|
<!--more-->
|
||||||
|
|
||||||
|
{{< aside note >}}
|
||||||
|
This trick only works if you're on desktop/web, and will also only show to
|
||||||
|
people on desktop/web.
|
||||||
|
{{< /aside >}}
|
||||||
|
|
||||||
## Tutorial
|
## Tutorial
|
||||||
|
|
||||||
Before you start, copy the "right-to-left embedding" character
|
Before you start, copy the "right-to-left embedding" character
|
||||||
@ -36,24 +47,23 @@ Before you start, copy the "right-to-left embedding" character
|
|||||||
|
|
||||||
### Method 1
|
### Method 1
|
||||||
|
|
||||||
This method allows you to create a placeholder message, and then replace it with
|
With this method you write a placeholder message, and then replace it completely
|
||||||
a new message with the `(edited)` text inside it all at once.
|
with a new message containing the `(edited)` text inside it all at once.
|
||||||
|
|
||||||
1. Send a message with some random text since you have to edit an existing
|
1. Send a message with some random text (this text will be replaced entirely)
|
||||||
message for the trick to work.
|
|
||||||
2. Start editing the message you just created and delete all the text inside
|
2. Start editing the message you just created and delete all the text inside
|
||||||
3. Type the text you want on the left of `(edited)`.
|
3. Type the text you want on the left of `(edited)`.
|
||||||
4. Type a space, then paste the character twice, and type another space.
|
4. Type a space, then paste the character twice, and type another space.
|
||||||
5. Type the text you want on the right of `(edited)`.
|
5. Type the text you want on the right of `(edited)`.
|
||||||
6. Save the message.
|
6. Save the message.
|
||||||
|
|
||||||
You can also start at step 3 instead, send the message, and then edit the
|
You can also start at step 3 instead, send the message, and then perform any
|
||||||
message afterwards to add the `(edited)` text.
|
edit on the message afterwards to add the `(edited)` text.
|
||||||
|
|
||||||
### Method 2
|
### Method 2
|
||||||
|
|
||||||
This method allows you to add `(edited)` to the end of an existing message, and
|
This method works by adding `(edited)` to the end of an existing message, and
|
||||||
then add even more text to the right of that.
|
then extra text to the right.
|
||||||
|
|
||||||
1. Send a message containing the text you want on the left of `(edited)`.
|
1. Send a message containing the text you want on the left of `(edited)`.
|
||||||
2. Start editing the message you just created
|
2. Start editing the message you just created
|
||||||
|
@ -1,18 +1,23 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
title: GitHub Copilot experiments
|
title: Experimenting with GitHub Copilot
|
||||||
date: 2021-11-06T23:56:47-05:00
|
date: 2021-11-06T23:56:47-05:00
|
||||||
|
lastmod: 2021-11-08T21:46:39-06:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- bbaovanc
|
- bbaovanc
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- programming
|
||||||
|
- tinkering
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- github-copilot
|
- github-copilot
|
||||||
|
|
||||||
series:
|
series:
|
||||||
- GitHub Copilot Experiments
|
- github-copilot-experiments
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- name: feature
|
- name: feature
|
||||||
|
53
content/blog/swapfile-guide-explained/index.md
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Swapfile guide explained
|
||||||
|
date: 2023-01-23T20:26:18-06:00
|
||||||
|
lastmod: 2023-01-23T20:26:18-06:00
|
||||||
|
toc: true
|
||||||
|
comments: true
|
||||||
|
draft: true
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- bbaovanc
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- linux
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- linux-swap
|
||||||
|
- swapfile
|
||||||
|
|
||||||
|
series:
|
||||||
|
- swapfile-guide
|
||||||
|
|
||||||
|
# this will be shown for the article in list pages and in the page metadata
|
||||||
|
# it can be either an image or video (this might change in the future, however)
|
||||||
|
resources:
|
||||||
|
- name: feature
|
||||||
|
src: something.webp
|
||||||
|
title: Some image (image format can be anything; webp is just an example)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
This page is about something. All the content before the "more" HTML comment
|
||||||
|
below will become the summary, which will be used in list pages and in the meta
|
||||||
|
tags on the article.
|
||||||
|
|
||||||
|
Or, if you don't want your description to be at the top of the article, you can
|
||||||
|
set your own `description` in the front matter and it will override this. See
|
||||||
|
the [Content Summaries](https://gohugo.io/content-management/summaries/) page on
|
||||||
|
the Hugo docs for more information.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
## Allocating the file
|
||||||
|
|
||||||
|
- use `dd` instead of `fallocate`
|
||||||
|
- https://man7.org/linux/man-pages/man8/swapon.8.html#NOTES
|
||||||
|
- https://man.archlinux.org/man/core/util-linux/swapon.8.en#Files_with_holes
|
||||||
|
|
||||||
|
## Options field
|
||||||
|
|
||||||
|
- https://unix.stackexchange.com/a/365961/525130
|
||||||
|
- https://unix.stackexchange.com/a/365954/525130
|
||||||
|
- https://github.com/util-linux/util-linux/blob/2ea397239683270a0fc8cd3b72ed5457f52dbda8/sys-utils/swapon.c#L699
|
253
content/blog/swapfile-guide/index.md
Normal file
@ -0,0 +1,253 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: How to create (or remove) a swapfile on Linux
|
||||||
|
date: 2023-01-23T20:26:18-06:00
|
||||||
|
lastmod: 2023-01-23T20:26:18-06:00
|
||||||
|
toc: true
|
||||||
|
comments: true
|
||||||
|
draft: true
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- bbaovanc
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- guides
|
||||||
|
- linux
|
||||||
|
- tips-and-tricks
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- linux-swap
|
||||||
|
- swapfile
|
||||||
|
|
||||||
|
series:
|
||||||
|
- swapfile-guide
|
||||||
|
|
||||||
|
# this will be shown for the article in list pages and in the page metadata
|
||||||
|
# it can be either an image or video (this might change in the future, however)
|
||||||
|
resources:
|
||||||
|
- name: feature
|
||||||
|
src: something.webp
|
||||||
|
title: Some image (image format can be anything; webp is just an example)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
This is a step-by-step tutorial on how to create or remove a swapfile on a Linux
|
||||||
|
machine. Also included is the correct `fstab` entry (most articles get this
|
||||||
|
"wrong", though it doesn't really make a difference) and reasons to use
|
||||||
|
swap(file) in the first place.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
## Should you use swap?
|
||||||
|
|
||||||
|
A common misconception is that adding swap to your system can reduce
|
||||||
|
performance. In reality, even if you aren't running out of RAM, it can still be
|
||||||
|
beneficial to add swap.
|
||||||
|
|
||||||
|
See these points according to [an article by Hayden James][always-add-swap]:
|
||||||
|
|
||||||
|
> - Even if there is still available RAM, the Linux Kernel will **move memory
|
||||||
|
> pages that are hardly ever used** into swap space.
|
||||||
|
>
|
||||||
|
> - It’s better to swap out memory pages that have been inactive for a while,
|
||||||
|
> **keeping often-used data in cache**, and this should happen when the server
|
||||||
|
> is most idle, which is the aim of the Kernel.
|
||||||
|
>
|
||||||
|
> - Avoid setting your swap space too large if it will result in prolonging
|
||||||
|
> performance issues, outages, or your response time (without proper
|
||||||
|
> monitoring/alerts).
|
||||||
|
|
||||||
|
[always-add-swap]: https://haydenjames.io/linux-performance-almost-always-add-swap-space/
|
||||||
|
|
||||||
|
### Should you use a swapfile?
|
||||||
|
|
||||||
|
Swap partitions should be preferred because swapfiles tend to be slower and more
|
||||||
|
complex, especially if hibernating. A swapfile might be preferred due to its
|
||||||
|
flexibility (easy to resize), but if you use [LVM][lvm-archwiki] then you can
|
||||||
|
easily resize the swap partition anyways.
|
||||||
|
|
||||||
|
[lvm-archwiki]: https://wiki.archlinux.org/title/LVM
|
||||||
|
|
||||||
|
## Tutorial
|
||||||
|
|
||||||
|
{{< include path="include/bashsession.md" markdown=true >}}
|
||||||
|
|
||||||
|
### Step 1: Create the file
|
||||||
|
|
||||||
|
The first step is to allocate the file.
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
# dd if=/dev/zero of=/swapfile bs=1M count=[size in MiB] status=progress
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace `[size in MiB]` with the size of your swapfile in Mebibytes (MiB). You
|
||||||
|
can use [this online converter](https://www.convertunits.com/from/GiB/to/MiB) to
|
||||||
|
convert from Gibibytes (GiB, often confused with Gigabytes, but that's a
|
||||||
|
misconception for another time) to MiB, which you can put in the command.
|
||||||
|
|
||||||
|
Or you can look at this table for common sizes:
|
||||||
|
|
||||||
|
{{< table >}}
|
||||||
|
| GiB | MiB |
|
||||||
|
|-----|-------------|
|
||||||
|
| 1 | count=1024 |
|
||||||
|
| 2 | count=2048 |
|
||||||
|
| 3 | count=3072 |
|
||||||
|
| 4 | count=4096 |
|
||||||
|
| 8 | count=8192 |
|
||||||
|
| 16 | count=16384 |
|
||||||
|
{{< /table >}}
|
||||||
|
|
||||||
|
If you aren't sure how big your swapfile should be, take a look at [Table 15.1
|
||||||
|
on this Red Hat documentation page][redhat-swap-table]. Remember that if your
|
||||||
|
first swapfile isn't large enough, you can create another one.
|
||||||
|
|
||||||
|
[redhat-swap-table]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-swapspace#tb-recommended-system-swap-space
|
||||||
|
|
||||||
|
On my computer I have 32 GiB of RAM and a 16 GiB swap partition, rather than
|
||||||
|
swapfile, because I can flexibly expand the swap partition using
|
||||||
|
[LVM][lvm-archwiki].
|
||||||
|
|
||||||
|
{{< aside example >}}
|
||||||
|
|
||||||
|
To create a swapfile 4 GiB in size, you would run:
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
# dd if=/dev/zero of=/swapfile bs=1M count=4096 status=progress
|
||||||
|
4096+0 records in
|
||||||
|
4096+0 records out
|
||||||
|
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 0.960183 s, 4.5 GB/s
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< /aside >}}
|
||||||
|
|
||||||
|
### Step 2: Change swapfile permissions
|
||||||
|
|
||||||
|
The swapfile should only be readable by the system (`root` user). Run this
|
||||||
|
command to change it:
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
# chmod 600 /swapfile
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 3: Format the swapfile
|
||||||
|
|
||||||
|
Use the `mkswap` command to format the file to be used as swap (basically just
|
||||||
|
add a header to identify it):
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
# mkswap /swapfile
|
||||||
|
Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
|
||||||
|
no label, UUID=a0b87eca-b951-4344-be2d-020d77cdef48
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 4: Create an entry in `/etc/fstab`
|
||||||
|
|
||||||
|
An entry needs to be added to `/etc/fstab` for the swapfile to be enabled during
|
||||||
|
bootup. Open `/etc/fstab` in a text editor, and add this line to the end (add
|
||||||
|
spaces to line up with other entries if you want, whitespace is ignored):
|
||||||
|
|
||||||
|
```text
|
||||||
|
/swapfile none swap sw 0 0
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< aside note >}}
|
||||||
|
|
||||||
|
Above, I have filled the "options" field with `sw`. This is actually a result of
|
||||||
|
[cargo culting](https://en.wiktionary.org/wiki/cargo_culting). On Linux, the
|
||||||
|
`sw` option (and the [options specified by the commonly used
|
||||||
|
`defaults`][fstab-defaults-man]) [isn't valid for `swapon` and is
|
||||||
|
ignored][swapon-options-source]. However, the field does need to be filled out
|
||||||
|
with something, so feel free to put something funny (do let me know in the
|
||||||
|
comments if this somehow breaks something though).
|
||||||
|
|
||||||
|
[fstab-defaults-man]: https://man.archlinux.org/man/fstab.5#The_fourth_field_(%3Ci%3Efs_mntops%3C/i%3E).
|
||||||
|
[swapon-options-source]: https://github.com/util-linux/util-linux/blob/2ea397239683270a0fc8cd3b72ed5457f52dbda8/sys-utils/swapon.c#L699
|
||||||
|
|
||||||
|
If you're curious, this is my `fstab` entry (`UUID` is because I use a swap
|
||||||
|
partition, rather than swapfile):
|
||||||
|
|
||||||
|
```text
|
||||||
|
# /dev/mapper/bobavg0-swap
|
||||||
|
UUID=4f7c3ae8-839b-4474-b8a5-96bd78db06f8 none swap bobaswap 0 0
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< /aside >}}
|
||||||
|
|
||||||
|
### Step 5: Enable the swapfile
|
||||||
|
|
||||||
|
Adding the `fstab` entry won't enable the swapfile until a reboot. To enable it
|
||||||
|
now, use the `swapon` command.
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
# swapon /swapfile
|
||||||
|
```
|
||||||
|
|
||||||
|
### Finally: check the swap status
|
||||||
|
|
||||||
|
Use `swapon` and `free` to verify that your new swapfile has been added:
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
$ swapon --show
|
||||||
|
NAME TYPE SIZE USED PRIO
|
||||||
|
/swapfile file 4G 0B -2
|
||||||
|
|
||||||
|
$ free -h
|
||||||
|
total used free shared buff/cache available
|
||||||
|
Mem: 31Gi 3.6Gi 20Gi 233Mi 6.9Gi 26Gi
|
||||||
|
Swap: 4.0Gi 0B 4.0Gi
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< aside note >}}
|
||||||
|
|
||||||
|
If you get an error saying that the `swapon` command was not found, try running
|
||||||
|
it as `root` (using `sudo`). On Debian-based distributions the `swapon` command
|
||||||
|
is not available to regular users.
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
$ swapon --show
|
||||||
|
bash: swapon: command not found
|
||||||
|
|
||||||
|
# swapon --show
|
||||||
|
NAME TYPE SIZE USED PRIO
|
||||||
|
/swapfile file 4G 0B -2
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< /aside >}}
|
||||||
|
|
||||||
|
## Removing a swapfile
|
||||||
|
|
||||||
|
{{< aside warning >}}
|
||||||
|
|
||||||
|
Be careful that the swapfile isn't being highly used because once you run
|
||||||
|
`swapoff`, it will dump the entire contents back into RAM and may cause you to
|
||||||
|
run out of memory.
|
||||||
|
|
||||||
|
{{< /aside >}}
|
||||||
|
|
||||||
|
### Step 1: Disable/unload the swapfile
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
$ swapon --show
|
||||||
|
NAME TYPE SIZE USED PRIO
|
||||||
|
/swapfile file 4G 0B -2
|
||||||
|
|
||||||
|
$ # the path to the swapfile I want to remove is `/swapfile`
|
||||||
|
|
||||||
|
# swapoff /swapfile
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 2: Remove the entry from `fstab`
|
||||||
|
|
||||||
|
Open `/etc/fstab` in a text editor and find the line matching the swapfile you
|
||||||
|
want to remove, and delete it. For example:
|
||||||
|
|
||||||
|
```text
|
||||||
|
/swapfile none swap sw 0 0
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 3: Delete the actual file
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
# rm /swapfile
|
||||||
|
```
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
title: Text substitution in Discord using `sed`
|
title: Text substitution in Discord using `sed`
|
||||||
date: 2021-03-25T18:48:15-05:00
|
date: 2021-03-25T18:48:15-05:00
|
||||||
|
lastmod: 2021-10-19T14:02:08-05:00
|
||||||
toc: false
|
toc: false
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
@ -12,10 +13,13 @@ aliases:
|
|||||||
- /blog/posts/sed-text-substitution-in-discord/
|
- /blog/posts/sed-text-substitution-in-discord/
|
||||||
- /blog/posts/text-substitution-in-discord-using-sed/
|
- /blog/posts/text-substitution-in-discord-using-sed/
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- tips-and-tricks
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- tutorial
|
|
||||||
- discord
|
- discord
|
||||||
- discord-tricks
|
- discord-tricks
|
||||||
|
- sed
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- name: feature
|
- name: feature
|
||||||
|
@ -2,17 +2,20 @@
|
|||||||
|
|
||||||
title: The redesign of my website
|
title: The redesign of my website
|
||||||
date: 2021-10-18T14:03:05-05:00
|
date: 2021-10-18T14:03:05-05:00
|
||||||
|
lastmod: 2021-10-27T09:51:43-05:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- bbaovanc
|
- bbaovanc
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- meta
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- announcement
|
|
||||||
- blog
|
|
||||||
- hugo
|
|
||||||
- bobatheme
|
- bobatheme
|
||||||
|
- hugo
|
||||||
|
- web-development
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- name: feature
|
- name: feature
|
||||||
|
@ -2,18 +2,21 @@
|
|||||||
|
|
||||||
title: Using Github Copilot to write a blog post
|
title: Using Github Copilot to write a blog post
|
||||||
date: 2021-11-07T16:17:15-06:00
|
date: 2021-11-07T16:17:15-06:00
|
||||||
|
lastmod: 2021-11-08T21:46:39-06:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- bbaovanc
|
- bbaovanc
|
||||||
|
|
||||||
|
categories:
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- github-copilot
|
- github-copilot
|
||||||
- blog
|
- markdown
|
||||||
|
|
||||||
series:
|
series:
|
||||||
- GitHub Copilot Experiments
|
- github-copilot-experiments
|
||||||
|
|
||||||
# this will be shown for the article in list pages and in the page metadata
|
# this will be shown for the article in list pages and in the page metadata
|
||||||
# it can be either an image or video (this might change in the future, however)
|
# it can be either an image or video (this might change in the future, however)
|
||||||
|
@ -2,15 +2,20 @@
|
|||||||
|
|
||||||
title: Youtube URL structures you should know
|
title: Youtube URL structures you should know
|
||||||
date: 2021-10-30T21:20:38-05:00
|
date: 2021-10-30T21:20:38-05:00
|
||||||
|
lastmod: 2023-01-16T21:04:09-06:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- bbaovanc
|
- bbaovanc
|
||||||
|
|
||||||
|
categories:
|
||||||
|
- tips-and-tricks
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- youtube
|
- query-parameters
|
||||||
- url-structures
|
- url-structures
|
||||||
|
- youtube
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- name: feature
|
- name: feature
|
||||||
@ -23,7 +28,7 @@ resources:
|
|||||||
[What is a
|
[What is a
|
||||||
URL?](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL#parameters)
|
URL?](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL#parameters)
|
||||||
by [Mozilla
|
by [Mozilla
|
||||||
Contributors](https://developer.mozilla.org/en-US/docs/MDN/About/contributors.txt)
|
Contributors](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL/contributors.txt)
|
||||||
is licensed under [CC-BY-SA
|
is licensed under [CC-BY-SA
|
||||||
2.5](https://creativecommons.org/licenses/by-sa/2.5/)
|
2.5](https://creativecommons.org/licenses/by-sa/2.5/)
|
||||||
|
|
||||||
@ -60,7 +65,7 @@ Here's the video I'll be using as an example:
|
|||||||
|
|
||||||
{{< youtube F6va6tg62qg >}}
|
{{< youtube F6va6tg62qg >}}
|
||||||
|
|
||||||
I embedded that video on my website with this code:[^1]
|
I embedded that video on my website with this code:[^hugo-shortcode]
|
||||||
|
|
||||||
```text
|
```text
|
||||||
{{</* youtube F6va6tg62qg */>}}
|
{{</* youtube F6va6tg62qg */>}}
|
||||||
@ -121,5 +126,9 @@ As far as I know, it's not possible to link to a playlist using `youtu.be`.
|
|||||||
[This Stack Exchange answer](https://webapps.stackexchange.com/a/9881) is a good
|
[This Stack Exchange answer](https://webapps.stackexchange.com/a/9881) is a good
|
||||||
reference for some other YouTube parameters.
|
reference for some other YouTube parameters.
|
||||||
|
|
||||||
[^1]: I use a static site generator called [Hugo](https://gohugo.io) for my
|
[^hugo-shortcode]: I use a static site generator called
|
||||||
website.
|
[Hugo](https://gohugo.io) for my website. It has a built in "shortcode" which
|
||||||
|
is a feature that allows me to embed certain code blocks into a page. One of
|
||||||
|
its shortcodes, named `youtube`, allows me to embed a YouTube video into my
|
||||||
|
post. You can read more info about [shortcodes on the Hugo
|
||||||
|
docs](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes)
|
||||||
|
7
content/categories/_index.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Categories
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
List of categories on my website. These are different types or styles of posts.
|
11
content/categories/devops/_index.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: DevOps
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Posts about toolchain and software pipeline stuff. The abbreviation means
|
||||||
|
software development (Dev) plus IT operations (Ops). Includes things such as
|
||||||
|
CI/CD (GitHub Actions).
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/categories/guides/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Guides
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Any kind of guide or tutorial.
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/categories/jailbreak/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Jailbreak
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Anything related to jailbreaking (iOS or other Apple devices).
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/categories/linux/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Linux
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Anything relating to Linux (the kernel or operating systems).
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/categories/meta/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Meta
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Posts talking about my website.
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/categories/programming/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Programming
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Any posts relating to programming and/or software development.
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/categories/software/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Software
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Posts that discuss/review various programs.
|
||||||
|
|
||||||
|
<!--more-->
|
10
content/categories/sysadmin/_index.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Sysadmin
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Anything relating to managing servers (usually relating to Linux). "Sysadmin" is
|
||||||
|
short for "system administrator".
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/categories/tinkering/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Tinkering
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Posts where I experiment with things.
|
||||||
|
|
||||||
|
<!--more-->
|
10
content/categories/tips-and-tricks/_index.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Tips and Tricks
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Random little tips and/or tricks that I want to share. Will probably be mostly
|
||||||
|
short articles (but that's not a bad thing).
|
||||||
|
|
||||||
|
<!--more-->
|
@ -3,7 +3,7 @@
|
|||||||
title: Contact
|
title: Contact
|
||||||
menu: main
|
menu: main
|
||||||
toc: false
|
toc: false
|
||||||
comments: false
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- bbaovanc
|
- bbaovanc
|
||||||
@ -13,5 +13,8 @@ description: >-
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- Email: [contact@bbaovanc.com](mailto:contact@bbaovanc.com)
|
- Email: bbaovanc@bbaovanc.com
|
||||||
- Matrix: [@bbaovanc:boba.best](https://matrix.to/#/@bbaovanc:boba.best)
|
- If needed, encrypt your email with [my PGP
|
||||||
|
key](https://keyserver.ubuntu.com/pks/lookup?search=bbaovanc%40bbaovanc.com&fingerprint=on&op=index)
|
||||||
|
- GitHub Discussions (Q&A):
|
||||||
|
https://github.com/BBaoVanC/bbaovanc.com/discussions/categories/q-a
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
title: Donate
|
title: Donate
|
||||||
menu: main
|
menu: main
|
||||||
toc: false
|
toc: false
|
||||||
comments: false
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- bbaovanc
|
- bbaovanc
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
title: Links
|
title: Links
|
||||||
menu: main
|
menu: main
|
||||||
toc: true
|
toc: true
|
||||||
comments: false
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- bbaovanc
|
- bbaovanc
|
||||||
@ -18,41 +18,57 @@ description: >-
|
|||||||
|
|
||||||
## Other
|
## Other
|
||||||
|
|
||||||
- [GitHub](https://github.com/BBaoVanC/)
|
- [GitHub](https://github.com/BBaoVanC/) - my GitHub profile
|
||||||
- [boba.best](https://boba.best/)
|
- [boba.best](https://boba.best/)
|
||||||
|
|
||||||
## My Website
|
## My Website
|
||||||
|
|
||||||
- [Homepage](https://bbaovanc.com/) - theme:
|
- [bbaovanc.com source code](https://github.com/BBaoVanC/bbaovanc.com)
|
||||||
[bobatheme](https://github.com/BBaoVanC/bobatheme)
|
- [bobatheme](https://github.com/BBaoVanC/bobatheme) - theme for this
|
||||||
- [Blog](https://bbaovanc.com/blog/)
|
website
|
||||||
- [Status Page](https://status.bbaovanc.com/)
|
- [Searx Instance](https://search.bbaovanc.com/) - privacy-respecting search
|
||||||
- [Searx Instance](https://search.bbaovanc.com/) -
|
engine
|
||||||
[source code](https://github.com/BBaoVanC/searx)
|
- [Gitea Instance](https://git.bbaovanc.com/) - mostly just mirrors of my GitHub
|
||||||
- [Gitea Instance](https://git.bbaovanc.com/)
|
repos
|
||||||
|
|
||||||
## My Software
|
## My Projects
|
||||||
|
|
||||||
- [smines](https://github.com/BBaoVanC/smines)
|
- [smines](https://github.com/BBaoVanC/smines) - TUI minesweeper in C, made for
|
||||||
- [imgupload.py](https://github.com/imgupload-py/imgupload.py)
|
practice
|
||||||
- [mojiman](https://github.com/BBaoVanC/mojiman)
|
- [imgupload.py](https://github.com/imgupload-py/imgupload.py) - simple image
|
||||||
- [pynamegen](https://git.bbaovanc.com/bbaovanc/pynamegen)
|
uploading server written with Python Flask
|
||||||
|
- [mojiman](https://github.com/BBaoVanC/mojiman) - program I made to learn Rust
|
||||||
|
- [pynamegen](https://git.bbaovanc.com/bbaovanc/pynamegen) - name generator
|
||||||
|
written in Python
|
||||||
- [libnamegen](https://git.bbaovanc.com/bbaovanc/libnamegen)
|
- [libnamegen](https://git.bbaovanc.com/bbaovanc/libnamegen)
|
||||||
- [liblistloader](https://git.bbaovanc.com/bbaovanc/liblistloader)
|
- [liblistloader](https://git.bbaovanc.com/bbaovanc/liblistloader)
|
||||||
- [libprogress](https://git.bbaovanc.com/bbaovanc/libprogress)
|
- [libprogress](https://git.bbaovanc.com/bbaovanc/libprogress)
|
||||||
- [RokuRemote](https://github.com/BBaoVanC/RokuRemote)
|
- [RokuRemote](https://github.com/BBaoVanC/RokuRemote) - keyboard-based remote
|
||||||
|
control for Roku
|
||||||
|
|
||||||
## My Configurations
|
## My Configurations
|
||||||
|
|
||||||
- [dotfiles](https://github.com/BBaoVanC/dotfiles)
|
- [dotfiles](https://github.com/BBaoVanC/dotfiles) - main repository with my
|
||||||
- [dwm](https://github.com/BBaoVanC/.dwm)
|
configs
|
||||||
- [dwm-flexipatch](https://github.com/BBaoVanC/dwm-flexipatch)
|
- [docker-dotfiles](https://github.com/BBaoVanC/docker-dotfiles) - Docker image
|
||||||
- [dwmblocks](https://github.com/BBaoVanC/dwmblocks)
|
that contains my dotfiles
|
||||||
- [dmenu](https://github.com/BBaoVanC/dmenu)
|
- [onehalf](https://github.com/BBaoVanC/onehalf) - the theme I use on my
|
||||||
|
terminal
|
||||||
|
|
||||||
### Archived
|
### Archived
|
||||||
|
|
||||||
- [dwm](https://github.com/BBaoVanC/dwm)
|
- [dwm](https://github.com/BBaoVanC/.dwm) - outer repo with submodules for my
|
||||||
- [st](https://github.com/BBaoVanC/st)
|
various dwm-related configs
|
||||||
- [slstatus](https://github.com/BBaoVanC/slstatus)
|
- [dwm-flexipatch](https://github.com/BBaoVanC/dwm-flexipatch) - see
|
||||||
- [xmonad](https://github.com/BBaoVanC/.xmonad)
|
https://github.com/bakkeby/dwm-flexipatch
|
||||||
|
- [dwmblocks](https://github.com/BBaoVanC/dwmblocks) - DWM status bar, see
|
||||||
|
https://github.com/torrinfail/dwmblocks
|
||||||
|
- [dmenu](https://github.com/BBaoVanC/dmenu) - dynamic menu, see
|
||||||
|
https://tools.suckless.org/dmenu/
|
||||||
|
- [st](https://github.com/BBaoVanC/st) - simple terminal, see
|
||||||
|
https://st.suckless.org
|
||||||
|
- [slstatus](https://github.com/BBaoVanC/slstatus) - suckless status, see
|
||||||
|
https://tools.suckless.org/slstatus/
|
||||||
|
- [dwm](https://github.com/BBaoVanC/dwm) - dynamic window manager, see
|
||||||
|
https://dwm.suckless.org/
|
||||||
|
- [xmonad](https://github.com/BBaoVanC/.xmonad) - see https://xmonad.org
|
||||||
|
7
content/series/_index.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Series
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
List of series, which are sequences of closely related posts.
|
@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
title: Github Copilot Experiments
|
title: Github Copilot Experiments
|
||||||
|
|
||||||
description: >-
|
|
||||||
Make sure to read the last two posts where I made GitHub Copilot write a blog
|
|
||||||
post itself.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Make sure to read the last two posts where I made GitHub Copilot write a blog
|
||||||
|
post itself.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
10
content/series/swapfile-guide/_index.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Swapfile Guide
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
A tutorial on how to set up a swapfile on Linux, but with some more depth than
|
||||||
|
just a step-by-step.
|
||||||
|
|
||||||
|
<!--more-->
|
8
content/tags/_index.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Tags
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
List of tags on my website. These are specific things or ideas that I talk about
|
||||||
|
in a post.
|
10
content/tags/arch-linux/_index.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Arch Linux
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
A Linux distribution which aims to be lightweight, flexible, and simple. See
|
||||||
|
https://archlinux.org for more information.
|
||||||
|
|
||||||
|
<!--more-->
|
12
content/tags/bobanews/_index.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: bobanews
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
The main name for my newsletter. I recommend you read the [blog post I wrote
|
||||||
|
about it][newsletter-post].
|
||||||
|
|
||||||
|
[newsletter-post]: {{< ref "/blog/blog-post-newsletter" >}}
|
||||||
|
|
||||||
|
<!--more-->
|
12
content/tags/bobatheme/_index.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: bobatheme
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Posts about bobatheme, my custom [Hugo][hugo-website] theme which I use on this
|
||||||
|
website.
|
||||||
|
|
||||||
|
[hugo-website]: https://gohugo.io
|
||||||
|
|
||||||
|
<!--more-->
|
14
content/tags/caddy/_index.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Caddy
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Caddy is a powerful and open source webserver written in [Golang][golang] which
|
||||||
|
includes some fancy features such as built-in automatic HTTPS. It's by far my
|
||||||
|
favorite webserver. See my [blog post about Caddy][caddy-blog-post] for why.
|
||||||
|
|
||||||
|
[golang]: https://go.dev/
|
||||||
|
[caddy-blog-post]: {{< ref "/blog/caddy-is-the-best-webserver" >}}
|
||||||
|
|
||||||
|
<!--more-->
|
13
content/tags/checkra1n/_index.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: checkra1n
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
An [iOS jailbreak][ios-jailbreaking] which supports the iPhone 4s to the iPhone
|
||||||
|
X. See the [official checkra1n website][checkra1n-website] for more information.
|
||||||
|
|
||||||
|
[ios-jailbreaking]: https://en.wikipedia.org/wiki/IOS_jailbreaking
|
||||||
|
[checkra1n-website]: https://checkra.in/
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/tags/discord-tricks/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Discord Tricks
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Tips and tricks I have learned about Discord.
|
||||||
|
|
||||||
|
<!--more-->
|
14
content/tags/discord/_index.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Discord
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
An extremely popular chat platform. You have to live under a rock to not know
|
||||||
|
what Discord is.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
See also: the [discord-tricks tag][discord-tricks-tag].
|
||||||
|
|
||||||
|
[discord-tricks-tag]: {{< ref "/tags/discord-tricks/" >}}
|
13
content/tags/gitea/_index.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Gitea
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Gitea is a lightweight self-hosted Git service similar to GitHub. I use it on
|
||||||
|
[bbaovanc's Gitea][bbaovanc-gitea] and [bobatea][bobatea].
|
||||||
|
|
||||||
|
[bbaovanc-gitea]: https://git.bbaovanc.com
|
||||||
|
[bobatea]: https://git.boba.best
|
||||||
|
|
||||||
|
<!--more-->
|
11
content/tags/github-actions/_index.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Github Actions
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Any posts that talk about GitHub's CI/CD platform. This is what I use for
|
||||||
|
automatic tasks on my website, such as automatic audits, and automatic building
|
||||||
|
and deploying.
|
||||||
|
|
||||||
|
<!--more-->
|
14
content/tags/github-copilot/_index.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: GitHub Copilot
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
An extension made by GitHub which provides artificial intelligence powered
|
||||||
|
autocomplete, trained on real open source code. It is intended to give smarter
|
||||||
|
results than a typical autocomplete solution can, such as automatically
|
||||||
|
generating [boilerplate code][boilerplate-code].
|
||||||
|
|
||||||
|
[boilerplate-code]: https://en.wikipedia.org/wiki/Boilerplate_code
|
||||||
|
|
||||||
|
<!--more-->
|
11
content/tags/google-lighthouse/_index.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Google Lighthouse
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Lighthouse is a tool that can audit websites based on performance,
|
||||||
|
accessibility, SEO, and more. It also provides useful suggestions on how a
|
||||||
|
website can be improved.
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/tags/hugo/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Hugo
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Hugo is a static site generator which I use to generate this website.
|
||||||
|
|
||||||
|
<!--more-->
|
13
content/tags/linux-swap/_index.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Swap (Linux)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Swap space is storage on your drive that can be used as virtual memory when the
|
||||||
|
system is running low on physical memory (RAM). It is also used when hibernating
|
||||||
|
(suspend to disk).
|
||||||
|
|
||||||
|
More information: https://haydenjames.io/linux-performance-almost-always-add-swap-space/
|
||||||
|
|
||||||
|
<!--more-->
|
12
content/tags/listmonk/_index.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: listmonk
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
A self-hosted newsletter manager which I use to handle my blog post newsletter.
|
||||||
|
Read [this blog post][newsletter-blog-post] for more information.
|
||||||
|
|
||||||
|
[newsletter-blog-post]: {{< ref "/blog/blog-post-newsletter" >}}
|
||||||
|
|
||||||
|
<!--more-->
|
11
content/tags/markdown/_index.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Markdown
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Markdown is a simple and easy to use markup language which is actually used to
|
||||||
|
write the content on this website. Writing it only requires learning a very
|
||||||
|
basis syntax, and using a plain-text editor.
|
||||||
|
|
||||||
|
<!--more-->
|
15
content/tags/newsletter/_index.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Newsletter
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Blog posts related to my newsletter.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
You can sign up for my newsletter [using this signup form][signup-form]. Make
|
||||||
|
sure that you tick the box labeled `bbaovanc.com Blog Posts`. A nickname (or
|
||||||
|
your real name if you prefer) is optional.
|
||||||
|
|
||||||
|
[signup-form]: https://lists.bbaovanc.com/subscription/form
|
16
content/tags/query-parameters/_index.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Query Parameters
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Query parameters are a map of fields and values after the question mark in a
|
||||||
|
URL.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
Optionally provide more information about the tag here. This part will only show
|
||||||
|
on the tag page, not on the tags list page.
|
||||||
|
|
||||||
|
If you delete this section, DO NOT delete the summary separator (`<!--more-->`)
|
||||||
|
or else the summary won't be shown.
|
11
content/tags/sed/_index.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: sed
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Short for "stream editor", `sed` is a utility used to edit text on Unix systems.
|
||||||
|
It is usually used with regular expressions (regex for short). If you're
|
||||||
|
interested, look up "regex basics" and "sed basics", or something similar.
|
||||||
|
|
||||||
|
<!--more-->
|
11
content/tags/swapfile/_index.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: swapfile
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
A swapfile is a file that gives your system more [swap]({{< relref
|
||||||
|
"../linux-swap" >}}) space, which is used when the system is running low on RAM,
|
||||||
|
or when hibernating.
|
||||||
|
|
||||||
|
<!--more-->
|
10
content/tags/systemd/_index.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: systemd
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
`systemd` is by far the most popular service manager (known as an "init system")
|
||||||
|
used on Linux.
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/tags/url-structures/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: URL Structures
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Posts about URL conventions on certain websites or services.
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/tags/web-development/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Web Development
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Posts about developing for the internet.
|
||||||
|
|
||||||
|
<!--more-->
|
9
content/tags/webserver/_index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: Webserver
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Blog posts about webservers (software that runs websites).
|
||||||
|
|
||||||
|
<!--more-->
|
10
content/tags/youtube/_index.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
title: YouTube
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
One of the most popular video and social media platforms. If you don't know what
|
||||||
|
YouTube is, I don't know what to tell you.
|
||||||
|
|
||||||
|
<!--more-->
|
32
include/bashsession.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{{< aside info >}}
|
||||||
|
|
||||||
|
Commands in this article are prefixed them with a prompt symbol (either `$` or
|
||||||
|
`#`) which is not part of the command. Lines with no prompt symbol are output
|
||||||
|
from the command.
|
||||||
|
|
||||||
|
The `#` means to run it as `root` (usually using `sudo`):
|
||||||
|
|
||||||
|
```bashsession
|
||||||
|
$ ls /var/lib/docker
|
||||||
|
ls: cannot open directory '/var/lib/docker': Permission denied
|
||||||
|
|
||||||
|
$ # this is a comment
|
||||||
|
$ # regular users aren't allowed to view /var/lib/docker, we need root
|
||||||
|
|
||||||
|
# ls /var/lib/docker
|
||||||
|
builder containerd image overlay2 runtimes tmp volumes
|
||||||
|
buildkit containers network plugins swarm trust
|
||||||
|
|
||||||
|
$ # we can do the same thing using sudo
|
||||||
|
|
||||||
|
$ sudo ls /var/lib/docker
|
||||||
|
[sudo] password for bbaovanc:
|
||||||
|
builder containerd image overlay2 runtimes tmp volumes
|
||||||
|
buildkit containers network plugins swarm trust
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to copy just the commands (for example: pasting them into your own
|
||||||
|
terminal to run them all), press the [Copy](javascript:void(0)) button in the top right of the code
|
||||||
|
block.
|
||||||
|
|
||||||
|
{{< /aside >}}
|
@ -1,3 +1,6 @@
|
|||||||
{{ if eq .Site.BaseURL "https://bbaovanc.com" }}
|
{{ if eq .Site.BaseURL "https://bbaovanc.com" }}
|
||||||
<script defer data-domain="bbaovanc.com" src="https://plausible.bbaovanc.com/js/bobalytics.js"></script>
|
<script defer data-domain="bbaovanc.com" src="https://plausible.bbaovanc.com/js/bobalytics.outbound-links.js"></script>
|
||||||
|
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
<link rel="me" href="https://procursus.social/@bbaovanc" />
|
||||||
|
@ -1,34 +1,58 @@
|
|||||||
{{ if ne .Site.BaseURL "https://bbaovanc.com" }}
|
{{ with resources.Get "css/comments.css" | fingerprint "sha512" }}
|
||||||
<i>Comment section is not available during development previews.</i>
|
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||||
{{ else }}
|
|
||||||
<noscript>
|
|
||||||
<small>
|
|
||||||
<i>Enable JavaScript to see the comment section.</i>
|
|
||||||
</small>
|
|
||||||
</noscript>
|
|
||||||
|
|
||||||
{{ $id := "" }}
|
|
||||||
{{ with .Params.discussionId }}
|
|
||||||
{{ $id = . }}
|
|
||||||
{{ else }}
|
|
||||||
{{ if .IsTranslated }}
|
|
||||||
{{ with index .AllTranslations 0 }}
|
|
||||||
{{ $id = .Permalink }}
|
|
||||||
{{ end }}
|
|
||||||
{{ else }}
|
|
||||||
{{ $id = .Permalink }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
<script>talkyardServerUrl='{{ .Site.Params.talkyardServerUrl }}';</script>
|
|
||||||
<script async defer src="{{ .Site.Params.talkyardScriptUrl }}"></script>
|
|
||||||
<!-- You can specify a per page discussion id on the next line, if your URLs might change. -->
|
|
||||||
<div class="talkyard-comments" data-discussion-id="{{ $id }}" style="margin-top: 45px;">
|
|
||||||
</div>
|
|
||||||
<div class="comments-footer" style="text-align: right;">
|
|
||||||
<small>
|
|
||||||
<p style="margin: 0;">Comments powered by <a href="https://www.talkyard.io">Talkyard</a>.</p>
|
|
||||||
<p style="margin: 0;">Discussion ID: <code>{{ $id }}</code></p>
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
<h2 style="margin-bottom: 0;">Comments</h2>
|
||||||
|
<small>
|
||||||
|
<p style="margin: 0;">
|
||||||
|
If you provide an email address, you can enable notifications for
|
||||||
|
replies to your comment. It will not be shown publicly.
|
||||||
|
</p>
|
||||||
|
</small>
|
||||||
|
|
||||||
|
<noscript>
|
||||||
|
<i>Enable JavaScript to see the comment section.</i>
|
||||||
|
</noscript>
|
||||||
|
|
||||||
|
{{ $url := .Permalink }}
|
||||||
|
{{ if .IsTranslated }}
|
||||||
|
{{ with index .AllTranslations 0 }}
|
||||||
|
{{ $url = .Permalink }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
<script data-isso-id="{{ $url }}"
|
||||||
|
data-isso-default-lang="{{ .Language.Lang }}"
|
||||||
|
data-isso-css="true"
|
||||||
|
data-isso-max-comments-top="10"
|
||||||
|
data-isso-max-comments-nested="5"
|
||||||
|
data-isso-reveal-on-click="5"
|
||||||
|
{{/*
|
||||||
|
data-isso-avatar-bg="#111"
|
||||||
|
data-isso-avatar-fg="#9abf88 #5698c4 #e279a3 #9163b6 ..."
|
||||||
|
*/}}
|
||||||
|
data-isso-vote="true"
|
||||||
|
{{/*
|
||||||
|
data-isso-vote-levels=""
|
||||||
|
*/}}
|
||||||
|
data-isso-feed="true"
|
||||||
|
data-isso-require-email="false"
|
||||||
|
data-isso-reply-notifications="true"
|
||||||
|
data-isso-reply-notifications-default-enabled="true"
|
||||||
|
|
||||||
|
{{ with (.GetTerms "authors") }}
|
||||||
|
{{ $authorHashes := slice }}
|
||||||
|
{{ range . }}
|
||||||
|
{{ with .Params.issoUserID }}
|
||||||
|
{{ $authorHashes = $authorHashes | append . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
data-isso-page-author-hashes="{{ delimit $authorHashes "," }}"
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
src="https://isso.bbaovanc.com/js/embed.min.js">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<section id="isso-thread" data-title="{{ .Title }}"></section>
|
||||||
|
5
lighthouserc.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
ci:
|
||||||
|
collect:
|
||||||
|
startServerCommand: sudo caddy run
|
||||||
|
settings:
|
||||||
|
chromeFlags: "--ignore-certificate-errors --throttling.cpuSlowdownMultiplier=2.4"
|
Before Width: | Height: | Size: 4.6 KiB |
BIN
static/apple-touch-icon.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 3.2 KiB |