mirror of
https://github.com/RealOrangeOne/notes.git
synced 2024-11-23 06:49:29 +00:00
Replace link with sources, and actually show them
This commit is contained in:
parent
24fc330e64
commit
65e681742d
11 changed files with 30 additions and 10 deletions
|
@ -2,7 +2,8 @@
|
|||
title: Find and kill long running queries
|
||||
tags:
|
||||
- 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
|
||||
|
|
|
@ -2,10 +2,9 @@
|
|||
title: Monitor redis commands
|
||||
tags:
|
||||
- Redis
|
||||
link: https://redis.io/commands/monitor/
|
||||
---
|
||||
|
||||
It's often useful to view what Redis is working on.
|
||||
|
||||
1. Connect to redis
|
||||
2. `MONITOR`
|
||||
2. [`MONITOR`](https://redis.io/commands/monitor/)
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
title: Monitor running queries
|
||||
tags:
|
||||
- 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:
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
title: Get credentials for an assumed role
|
||||
tags:
|
||||
- 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:
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
title: Cross-account data transfer
|
||||
tags:
|
||||
- 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:
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
title: Simple reverse proxy
|
||||
tags:
|
||||
- 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
|
||||
```
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
title: Rebase commits done on the wrong branch
|
||||
tags:
|
||||
- Git
|
||||
link: https://git-scm.com/book/en/v2/Git-Branching-Rebasing#_more_interesting_rebases
|
||||
---
|
||||
|
||||
```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.
|
||||
|
||||
See also ["more interesting rebases"](https://git-scm.com/book/en/v2/Git-Branching-Rebasing#_more_interesting_rebases)
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
title: Downmixing audio channels
|
||||
tags:
|
||||
- Media
|
||||
link: https://trac.ffmpeg.org/wiki/AudioChannelManipulation
|
||||
sources:
|
||||
- https://trac.ffmpeg.org/wiki/AudioChannelManipulation
|
||||
---
|
||||
|
||||
```bash
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
title: Strip audio / subtitle stream with ffmpeg
|
||||
tags:
|
||||
- Media
|
||||
link: https://stackoverflow.com/a/38162168
|
||||
sources:
|
||||
- https://stackoverflow.com/a/38162168
|
||||
---
|
||||
|
||||
```bash
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import jinja2
|
||||
from mkdocs.structure.nav import Navigation
|
||||
from urllib.parse import urlparse
|
||||
|
||||
@jinja2.pass_context
|
||||
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)
|
||||
|
||||
def get_domain(url):
|
||||
return urlparse(url).netloc
|
||||
|
||||
def on_env(env, config, files):
|
||||
env.tests["startswith"] = str.startswith
|
||||
env.globals["get_page"] = get_page
|
||||
env.globals["get_notes"] = get_notes
|
||||
env.filters["domain"] = get_domain
|
||||
|
|
|
@ -30,3 +30,11 @@
|
|||
<strong>GitHub</strong>
|
||||
</a>.
|
||||
{% 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 %}
|
||||
|
|
Loading…
Reference in a new issue