1
Fork 0
mirror of https://github.com/RealOrangeOne/notes.git synced 2024-11-23 13:49:28 +00:00

Replace link with sources, and actually show them

This commit is contained in:
Jake Howard 2024-02-21 11:40:55 +00:00
parent 24fc330e64
commit 65e681742d
Signed by: jake
GPG key ID: 57AFB45680EDD477
11 changed files with 30 additions and 10 deletions

View file

@ -2,7 +2,8 @@
title: Find and kill long running queries title: Find and kill long running queries
tags: tags:
- PostgreSQL - PostgreSQL
link: https://medium.com/little-programming-joys/finding-and-killing-long-running-queries-on-postgres-7c4f0449e86d sources:
- https://medium.com/little-programming-joys/finding-and-killing-long-running-queries-on-postgres-7c4f0449e86d
--- ---
# Running queries # Running queries

View file

@ -2,10 +2,9 @@
title: Monitor redis commands title: Monitor redis commands
tags: tags:
- Redis - Redis
link: https://redis.io/commands/monitor/
--- ---
It's often useful to view what Redis is working on. It's often useful to view what Redis is working on.
1. Connect to redis 1. Connect to redis
2. `MONITOR` 2. [`MONITOR`](https://redis.io/commands/monitor/)

View file

@ -2,7 +2,8 @@
title: Monitor running queries title: Monitor running queries
tags: tags:
- PostgreSQL - PostgreSQL
link: https://techmango.org/2017/11/04/monitor-running-queries-postgresql/ sources:
- https://techmango.org/2017/11/04/monitor-running-queries-postgresql/
--- ---
View a list of running queries: View a list of running queries:

View file

@ -2,7 +2,8 @@
title: Get credentials for an assumed role title: Get credentials for an assumed role
tags: tags:
- AWS - AWS
link: https://aws.amazon.com/premiumsupport/knowledge-center/iam-assume-role-cli/ sources:
- https://aws.amazon.com/premiumsupport/knowledge-center/iam-assume-role-cli/
--- ---
It's often useful to get regular access keys as if you were assumed into another role. This is possible: It's often useful to get regular access keys as if you were assumed into another role. This is possible:

View file

@ -2,7 +2,9 @@
title: Cross-account data transfer title: Cross-account data transfer
tags: tags:
- AWS - AWS
link: https://aws.amazon.com/premiumsupport/knowledge-center/cross-account-access-s3/ sources:
- https://aws.amazon.com/premiumsupport/knowledge-center/cross-account-access-s3/
- https://stackoverflow.com/a/63804619
--- ---
To copy bucket contents from a bucket in account A to a bucket in account B: To copy bucket contents from a bucket in account A to a bucket in account B:

View file

@ -2,9 +2,10 @@
title: Simple reverse proxy title: Simple reverse proxy
tags: tags:
- Networking - Networking
link: https://docs.mitmproxy.org/stable
--- ---
This uses [`mitmproxy`](https://docs.mitmproxy.org/stable), which can proxy both HTTP and HTTPS.
``` ```
mitmproxy --mode reverse:http://localhost:8000 mitmproxy --mode reverse:http://localhost:8000
``` ```

View file

@ -2,7 +2,6 @@
title: Rebase commits done on the wrong branch title: Rebase commits done on the wrong branch
tags: tags:
- Git - Git
link: https://git-scm.com/book/en/v2/Git-Branching-Rebasing#_more_interesting_rebases
--- ---
```sh ```sh
@ -10,3 +9,5 @@ git rebase --onto master server client
``` ```
> Take the `client` branch, figure out the patches since it diverged from the `server` branch, and replay these patches in the client branch as if it was based directly off the `master` branch instead. > Take the `client` branch, figure out the patches since it diverged from the `server` branch, and replay these patches in the client branch as if it was based directly off the `master` branch instead.
See also ["more interesting rebases"](https://git-scm.com/book/en/v2/Git-Branching-Rebasing#_more_interesting_rebases)

View file

@ -2,7 +2,8 @@
title: Downmixing audio channels title: Downmixing audio channels
tags: tags:
- Media - Media
link: https://trac.ffmpeg.org/wiki/AudioChannelManipulation sources:
- https://trac.ffmpeg.org/wiki/AudioChannelManipulation
--- ---
```bash ```bash

View file

@ -2,7 +2,8 @@
title: Strip audio / subtitle stream with ffmpeg title: Strip audio / subtitle stream with ffmpeg
tags: tags:
- Media - Media
link: https://stackoverflow.com/a/38162168 sources:
- https://stackoverflow.com/a/38162168
--- ---
```bash ```bash

View file

@ -1,5 +1,6 @@
import jinja2 import jinja2
from mkdocs.structure.nav import Navigation from mkdocs.structure.nav import Navigation
from urllib.parse import urlparse
@jinja2.pass_context @jinja2.pass_context
def get_page(context, slug): def get_page(context, slug):
@ -25,8 +26,11 @@ def get_notes(context):
return sorted(notes, key=lambda p: p.meta["git_creation_date_localized_raw_iso_date"], reverse=True) return sorted(notes, key=lambda p: p.meta["git_creation_date_localized_raw_iso_date"], reverse=True)
def get_domain(url):
return urlparse(url).netloc
def on_env(env, config, files): def on_env(env, config, files):
env.tests["startswith"] = str.startswith env.tests["startswith"] = str.startswith
env.globals["get_page"] = get_page env.globals["get_page"] = get_page
env.globals["get_notes"] = get_notes env.globals["get_notes"] = get_notes
env.filters["domain"] = get_domain

View file

@ -30,3 +30,11 @@
<strong>GitHub</strong> <strong>GitHub</strong>
</a>. </a>.
{% endblock %} {% endblock %}
{% block content %}
{{ super() }}
{% if page.meta.sources %}
<small>Sources: {% for source in page.meta.sources %}<a href="{{ source }}">{{ source|domain }}</a>{% endfor %}</small>
{% endif %}
{% endblock %}