posts-go/docs/2023-07-01-pastebin.html

558 lines
23 KiB
HTML
Raw Normal View History

2023-07-18 18:38:30 +00:00
<!doctype html>
2023-06-30 18:06:13 +00:00
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.5.1/github-markdown.min.css"
2023-06-30 18:06:13 +00:00
/>
<title>haunt98 posts</title>
</head>
<style>
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
2024-03-01 10:11:20 +00:00
font-family:
Shantell Sans Normal,
Rec Mono Casual,
SF Pro,
Inter,
sans-serif;
font-weight: 500;
}
.markdown-body pre {
font-family:
Berkeley Mono,
IBM Plex Mono,
SF Mono,
Jetbrains Mono,
monospace;
2023-06-30 18:06:13 +00:00
}
@media (max-width: 767px) {
.markdown-body {
padding: 15px;
}
}
</style>
<body class="markdown-body">
2023-08-09 07:22:58 +00:00
<h2>
<a href="index.html"><code>~</code></a>
</h2>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h1 class="heading-element">Throw away pastebin</h1>
2023-11-19 15:59:21 +00:00
<a
id="user-content-throw-away-pastebin"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: Throw away pastebin"
2023-11-19 15:59:21 +00:00
href="#throw-away-pastebin"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-06-30 18:06:13 +00:00
<p>Just a place to throw away some text.</p>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element"><code>.gitignore</code></h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-gitignore"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: .gitignore"
2023-11-19 15:59:21 +00:00
href="#gitignore"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-07-30 10:23:34 +00:00
<div class="highlight highlight-text-adblock">
<pre><span class="pl-c"># macOS</span>
.DS_Store
<span class="pl-c"># Window</span>
<span class="pl-k">*</span>.exe
<span class="pl-c"># IntelliJ</span>
.idea
<span class="pl-c"># VSCode</span>
.vscode
<span class="pl-c"># Go</span>
coverage.out
vendor
<span class="pl-c"># GoReleaser</span>
dist</pre>
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">GitHub Actions</h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-github-actions"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: GitHub Actions"
2023-11-19 15:59:21 +00:00
href="#github-actions"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-06-30 18:06:13 +00:00
<p><code>dependabot.yml</code>:</p>
<div class="highlight highlight-source-yaml">
<pre><span class="pl-ent">version</span>: <span class="pl-c1">2</span>
<span class="pl-ent">updates</span>:
- <span class="pl-ent">package-ecosystem</span>: <span class="pl-s"><span class="pl-pds">"</span>gomod<span class="pl-pds">"</span></span>
<span class="pl-ent">directory</span>: <span class="pl-s"><span class="pl-pds">"</span>/<span class="pl-pds">"</span></span>
<span class="pl-ent">schedule</span>:
<span class="pl-ent">interval</span>: <span class="pl-s"><span class="pl-pds">"</span>daily<span class="pl-pds">"</span></span>
- <span class="pl-ent">package-ecosystem</span>: <span class="pl-s"><span class="pl-pds">"</span>github-actions<span class="pl-pds">"</span></span>
<span class="pl-ent">directory</span>: <span class="pl-s"><span class="pl-pds">"</span>/<span class="pl-pds">"</span></span>
<span class="pl-ent">schedule</span>:
<span class="pl-ent">interval</span>: <span class="pl-s"><span class="pl-pds">"</span>daily<span class="pl-pds">"</span></span></pre>
</div>
<p><code>go.yml</code>:</p>
<div class="highlight highlight-source-yaml">
<pre><span class="pl-ent">name</span>: <span class="pl-s">Go</span>
<span class="pl-ent">on</span>:
<span class="pl-ent">push</span>:
<span class="pl-ent">branches</span>:
- <span class="pl-s">main</span>
<span class="pl-ent">paths</span>:
- <span class="pl-s"><span class="pl-pds">"</span>**.go<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>go.mod<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>go.sum<span class="pl-pds">"</span></span>
<span class="pl-ent">pull_request</span>:
<span class="pl-ent">branches</span>:
- <span class="pl-s">main</span>
<span class="pl-ent">paths</span>:
- <span class="pl-s"><span class="pl-pds">"</span>**.go<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>go.mod<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>go.sum<span class="pl-pds">"</span></span>
<span class="pl-ent">concurrency</span>:
<span class="pl-ent">group</span>: <span class="pl-s">${{ github.workflow }}-${{ github.ref }}</span>
<span class="pl-ent">cancel-in-progress</span>: <span class="pl-c1">true</span>
<span class="pl-ent">jobs</span>:
<span class="pl-ent">test</span>:
<span class="pl-ent">name</span>: <span class="pl-s">Test</span>
<span class="pl-ent">runs-on</span>: <span class="pl-s">ubuntu-latest</span>
<span class="pl-ent">steps</span>:
- <span class="pl-ent">uses</span>: <span class="pl-s">actions/checkout@v3</span>
- <span class="pl-ent">uses</span>: <span class="pl-s">actions/setup-go@v4</span>
<span class="pl-ent">with</span>:
<span class="pl-ent">go-version</span>: <span class="pl-s"><span class="pl-pds">"</span>stable<span class="pl-pds">"</span></span>
- <span class="pl-ent">run</span>: <span class="pl-s">go test -race -failfast ./...</span>
<span class="pl-ent">build</span>:
<span class="pl-ent">name</span>: <span class="pl-s">Build</span>
<span class="pl-ent">runs-on</span>: <span class="pl-s">${{ matrix.os }}</span>
<span class="pl-ent">strategy</span>:
<span class="pl-ent">matrix</span>:
<span class="pl-ent">os</span>: <span class="pl-s">[ubuntu-latest, macos-latest, windows-latest]</span>
<span class="pl-ent">steps</span>:
- <span class="pl-ent">uses</span>: <span class="pl-s">actions/checkout@v3</span>
- <span class="pl-ent">uses</span>: <span class="pl-s">actions/setup-go@v4</span>
<span class="pl-ent">with</span>:
<span class="pl-ent">go-version</span>: <span class="pl-s"><span class="pl-pds">"</span>stable<span class="pl-pds">"</span></span>
- <span class="pl-ent">run</span>: <span class="pl-s">go build .</span>
<span class="pl-ent">golangci-lint</span>:
<span class="pl-ent">name</span>: <span class="pl-s">golangci-lint</span>
<span class="pl-ent">runs-on</span>: <span class="pl-s">ubuntu-latest</span>
<span class="pl-ent">steps</span>:
- <span class="pl-ent">uses</span>: <span class="pl-s">actions/checkout@v3</span>
<span class="pl-ent">with</span>:
<span class="pl-ent">fetch-depth</span>: <span class="pl-c1">0</span>
- <span class="pl-ent">uses</span>: <span class="pl-s">actions/setup-go@v4</span>
<span class="pl-ent">with</span>:
<span class="pl-ent">go-version</span>: <span class="pl-s"><span class="pl-pds">"</span>stable<span class="pl-pds">"</span></span>
- <span class="pl-ent">uses</span>: <span class="pl-s">golangci/golangci-lint-action@v3</span>
<span class="pl-ent">with</span>:
<span class="pl-ent">version</span>: <span class="pl-s">latest</span></pre>
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">Go</h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-go"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: Go"
2023-11-19 15:59:21 +00:00
href="#go"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-06-30 18:06:13 +00:00
<p><code>.golangci.yml</code>:</p>
<div class="highlight highlight-source-yaml">
<pre><span class="pl-ent">run</span>:
<span class="pl-ent">timeout</span>: <span class="pl-c1">5m</span>
<span class="pl-ent">tests</span>: <span class="pl-c1">false</span>
<span class="pl-ent">skip-dirs</span>:
- <span class="pl-s"><span class="pl-pds">"</span>.*test.*<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>.*mock.*<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>.*example.*<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>.*utils.*<span class="pl-pds">"</span></span>
<span class="pl-ent">skip-files</span>:
- <span class="pl-s"><span class="pl-pds">"</span>.*Mock.*<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>.*_mock.*<span class="pl-pds">"</span></span>
<span class="pl-ent">output</span>:
<span class="pl-ent">sort-results</span>: <span class="pl-c1">true</span>
<span class="pl-ent">linters</span>:
<span class="pl-ent">disable-all</span>: <span class="pl-c1">true</span>
<span class="pl-ent">enable</span>:
<span class="pl-c"><span class="pl-c">#</span> Default</span>
- <span class="pl-s">errcheck</span>
- <span class="pl-s">gosimple</span>
- <span class="pl-s">govet</span>
- <span class="pl-s">ineffassign</span>
- <span class="pl-s">staticcheck</span>
- <span class="pl-s">typecheck</span>
- <span class="pl-s">unused</span>
<span class="pl-c"><span class="pl-c">#</span> Custom</span>
- <span class="pl-s">errchkjson</span>
- <span class="pl-s">errname</span>
- <span class="pl-s">errorlint</span>
- <span class="pl-s">execinquery</span>
- <span class="pl-s">forcetypeassert</span>
- <span class="pl-s">gocritic</span>
- <span class="pl-s">goerr113</span>
- <span class="pl-s">gofumpt</span>
- <span class="pl-s">gosec</span>
- <span class="pl-s">importas</span>
- <span class="pl-s">makezero</span>
- <span class="pl-s">nilnil</span>
- <span class="pl-s">noctx</span>
- <span class="pl-s">prealloc</span>
- <span class="pl-s">reassign</span>
<span class="pl-c"><span class="pl-c">#</span> - rowserrcheck</span>
- <span class="pl-s">sqlclosecheck</span>
- <span class="pl-s">unconvert</span>
<span class="pl-c"><span class="pl-c">#</span> - wastedassign</span>
<span class="pl-ent">fast</span>: <span class="pl-c1">true</span>
<span class="pl-ent">linters-settings</span>:
<span class="pl-c"><span class="pl-c">#</span> Default</span>
<span class="pl-ent">govet</span>:
<span class="pl-ent">check-shadowing</span>: <span class="pl-c1">false</span>
<span class="pl-ent">disable-all</span>: <span class="pl-c1">true</span>
<span class="pl-ent">enable</span>:
- <span class="pl-s">assign</span>
- <span class="pl-s">atomic</span>
- <span class="pl-s">bools</span>
- <span class="pl-s">buildtag</span>
- <span class="pl-s">composites</span>
- <span class="pl-s">copylocks</span>
- <span class="pl-s">fieldalignment</span>
- <span class="pl-s">httpresponse</span>
- <span class="pl-s">loopclosure</span>
- <span class="pl-s">lostcancel</span>
- <span class="pl-s">nilfunc</span>
- <span class="pl-s">printf</span>
- <span class="pl-s">unmarshal</span>
- <span class="pl-s">unreachable</span>
- <span class="pl-s">unusedresult</span>
<span class="pl-ent">staticcheck</span>:
<span class="pl-ent">checks</span>: <span class="pl-s">["all", "-SA1019"]</span>
<span class="pl-c"><span class="pl-c">#</span> Custom</span>
<span class="pl-ent">gocritic</span>:
<span class="pl-ent">disabled-checks</span>:
- <span class="pl-s">ifElseChain</span>
- <span class="pl-s">singleCaseSwitch</span>
- <span class="pl-s">unnamedResult</span>
- <span class="pl-s">whyNoLint</span>
<span class="pl-ent">enabled-tags</span>:
- <span class="pl-s">diagnostic</span>
- <span class="pl-s">style</span>
<span class="pl-ent">gosec</span>:
<span class="pl-ent">excludes</span>:
- <span class="pl-c1">G101</span>
- <span class="pl-c1">G112</span>
- <span class="pl-c1">G402</span>
- <span class="pl-c1">G404</span>
- <span class="pl-c1">G501</span>
- <span class="pl-c1">G505</span>
<span class="pl-ent">exclude-generated</span>: <span class="pl-c1">true</span>
<span class="pl-ent">reassign</span>:
<span class="pl-ent">patterns</span>:
- <span class="pl-s"><span class="pl-pds">"</span>.*<span class="pl-pds">"</span></span></pre>
</div>
<p><code>.goreleaser.yml</code>:</p>
<div class="highlight highlight-source-yaml">
<pre><span class="pl-ent">before</span>:
<span class="pl-ent">hooks</span>:
- <span class="pl-s">go mod tidy</span>
<span class="pl-ent">builds</span>:
- <span class="pl-ent">main</span>: <span class="pl-s">.</span>
<span class="pl-ent">goos</span>:
- <span class="pl-s">linux</span>
- <span class="pl-s">windows</span>
- <span class="pl-s">darwin</span>
<span class="pl-ent">goarch</span>:
- <span class="pl-s">amd64</span>
- <span class="pl-s">arm64</span>
<span class="pl-ent">universal_binaries</span>:
- <span class="pl-ent">replace</span>: <span class="pl-c1">true</span>
<span class="pl-ent">archives</span>:
- <span class="pl-ent">format_overrides</span>:
- <span class="pl-ent">goos</span>: <span class="pl-s">windows</span>
<span class="pl-ent">format</span>: <span class="pl-s">zip</span>
<span class="pl-ent">changelog</span>:
<span class="pl-ent">skip</span>: <span class="pl-c1">false</span>
<span class="pl-ent">use</span>: <span class="pl-s">github</span></pre>
2023-08-03 10:33:40 +00:00
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">Git clean up</h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-git-clean-up"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: Git clean up"
2023-11-19 15:59:21 +00:00
href="#git-clean-up"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-08-03 10:33:40 +00:00
<div class="highlight highlight-source-shell">
<pre><span class="pl-c"><span class="pl-c">#</span> Delete untracked</span>
git clean -fdx
git gc</pre>
2023-06-30 18:06:13 +00:00
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">Delete <code>.DS_Store</code></h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-delete-ds_store"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: Delete .DS_Store"
2023-11-19 15:59:21 +00:00
href="#delete-ds_store"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-08-03 10:33:40 +00:00
<p>
With
<a href="https://stackoverflow.com/q/30483670" rel="nofollow">find</a>:
</p>
<div class="highlight highlight-source-shell">
<pre>find <span class="pl-c1">.</span> -name <span class="pl-s"><span class="pl-pds">"</span>.DS_Store<span class="pl-pds">"</span></span> -print -type f -delete</pre>
2023-07-30 10:23:34 +00:00
</div>
2023-08-03 10:33:40 +00:00
<p>With <a href="https://github.com/sharkdp/fd">fd</a>:</p>
<div class="highlight highlight-source-shell">
<pre>fd -H <span class="pl-s"><span class="pl-pds">'</span>^\.DS_Store$<span class="pl-pds">'</span></span> -tf -X rm</pre>
2023-07-30 10:23:34 +00:00
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">
<a href="https://github.com/chmln/sd">sd</a>
</h2>
2024-01-28 07:10:04 +00:00
<a
id="user-content-sd"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: sd"
2024-01-28 07:10:04 +00:00
href="#sd"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2024-01-28 07:10:04 +00:00
<p>Remove proto options:</p>
<div class="highlight highlight-source-shell">
<pre>sd -F <span class="pl-s"><span class="pl-pds">'</span>import "validate/validate.proto";<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span> api/raw/<span class="pl-k">*</span>.proto
sd -F <span class="pl-s"><span class="pl-pds">'</span>import "marshal-zap.proto";<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span> api/raw/<span class="pl-k">*</span>.proto
sd -f s <span class="pl-s"><span class="pl-pds">'</span>\s\[.*?];<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span>;<span class="pl-pds">'</span></span> api/raw/<span class="pl-k">*</span>.proto</pre>
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">
<a href="https://github.com/adrianlopezroche/fdupes">fdupes</a>
</h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-fdupes"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: fdupes"
2023-11-19 15:59:21 +00:00
href="#fdupes"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-08-03 10:33:40 +00:00
<p>Remove duplicated files:</p>
<div class="highlight highlight-source-shell">
<pre>fdupes -rdN <span class="pl-c1">.</span></pre>
2023-06-30 18:06:13 +00:00
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">
<a href="https://github.com/WayneD/rsync">rsync</a>
</h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-rsync"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: rsync"
2023-11-19 15:59:21 +00:00
href="#rsync"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-08-03 09:22:08 +00:00
<div class="highlight highlight-source-shell">
<pre><span class="pl-c"><span class="pl-c">#</span> Result is dst/src</span>
rsync -avzP src dst
<span class="pl-c"><span class="pl-c">#</span> Result is dst/* with * is from src</span>
rsync -avzP src/ dst</pre>
</div>
<p>Commonly flags:</p>
<ul>
<li><code>-v</code>: verbose</li>
<li><code>-z</code>: compress</li>
<li>
<code>-P</code>: enable both <code>--partial</code>,
<code>--progress</code> to easily resume after interupt
</li>
<li><code>-n</code>: dry run</li>
</ul>
<p>Be careful flags (need dry run if not sure):</p>
<ul>
<li>
<code>-u</code>: skip if files in <strong>dst</strong> is already newer
than in <strong>src</strong>, if you want to sync both ways
</li>
<li>
<code>--delete</code>: delete files in <strong>dst</strong> if not exist
in <strong>src</strong>, useful to sync dst with src
</li>
</ul>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">
<a href="https://github.com/atuinsh/atuin">atuin</a>
</h2>
2024-02-10 17:06:43 +00:00
<a
id="user-content-atuin"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: atuin"
2024-02-10 17:06:43 +00:00
href="#atuin"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2024-02-10 17:06:43 +00:00
<p>Remove duplicated command:</p>
<div class="highlight highlight-source-sql">
<pre><span class="pl-k">delete</span>
<span class="pl-k">from</span> history
<span class="pl-k">where</span> id not <span class="pl-k">in</span> (<span class="pl-k">select</span> <span class="pl-c1">max</span>(id)
<span class="pl-k">from</span> history
2024-03-11 20:39:44 +00:00
<span class="pl-k">group by</span> command);
<span class="pl-k">delete</span>
<span class="pl-k">from</span> history
<span class="pl-k">where</span> length(command) <span class="pl-k">&gt;</span> <span class="pl-c1">128</span>;</pre>
</div>
<p>Remove shell history:</p>
<div class="highlight highlight-source-shell">
<pre>cat /dev/null <span class="pl-k">&gt;</span> <span class="pl-k">~</span>/.zsh_history</pre>
2024-02-10 17:06:43 +00:00
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">
<a href="https://github.com/ayoisaiah/f2">F2</a>
</h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-f2"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: F2"
2023-11-19 15:59:21 +00:00
href="#f2"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-07-30 11:13:08 +00:00
<p>Rename:</p>
<div class="highlight highlight-source-shell">
<pre><span class="pl-c"><span class="pl-c">#</span> If want dry run, remove -x</span>
2024-03-16 07:53:45 +00:00
f2 -r <span class="pl-s"><span class="pl-pds">"</span>{mtime.YYYY}{mtime.MM}{mtime.DD}.{mtime.H}{mtime.mm}{mtime.ss}{ext}<span class="pl-pds">"</span></span> -F -x</pre>
2023-07-30 11:13:08 +00:00
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">
<a href="https://github.com/instaloader/instaloader">Instaloader</a>
</h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-instaloader"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: Instaloader"
2023-11-19 15:59:21 +00:00
href="#instaloader"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-08-03 10:33:40 +00:00
<p><code>args.txt</code>:</p>
<div class="highlight highlight-text-adblock">
<pre>
--no-video-thumbnails
--no-captions
--no-metadata-json
--stories
--fast-update
--sanitize-paths
--abort-on=302,400,429
--no-iphone</pre
>
</div>
<p><code>login.txt</code>:</p>
<div class="highlight highlight-text-adblock">
<pre>
--login=your_insta_username
--sessionfile=where/sessionfile/store</pre
>
</div>
<p>Run:</p>
<div class="highlight highlight-text-adblock">
<pre>instaloader +login.txt +args.txt +targets.txt</pre>
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">
<a href="https://github.com/fullstorydev/grpcurl">gRPCurl</a>
</h2>
2023-11-19 15:59:21 +00:00
<a
id="user-content-grpcurl"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: gRPCurl"
2023-11-19 15:59:21 +00:00
href="#grpcurl"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2023-08-21 12:38:37 +00:00
<div class="highlight highlight-source-shell">
<pre>grpcurl -proto path/file.proto \
-d <span class="pl-s"><span class="pl-pds">'</span>{"key": "value", "timestamp": "1997-04-01T00:00:00Z"}<span class="pl-pds">'</span></span> \
2023-08-21 12:38:37 +00:00
internal-social.zalopay.vn:443 \
pkg.Service/GetData</pre>
</div>
2024-02-29 12:29:26 +00:00
<div class="markdown-heading">
<h2 class="heading-element">
<a href="https://github.com/zed-industries/zed">Zed</a>
</h2>
2024-02-08 17:13:49 +00:00
<a
id="user-content-zed"
2024-03-08 08:12:41 +00:00
class="anchor"
2024-02-29 12:29:26 +00:00
aria-label="Permalink: Zed"
2024-02-08 17:13:49 +00:00
href="#zed"
2024-02-29 12:29:26 +00:00
><span aria-hidden="true" class="octicon octicon-link"></span
></a>
</div>
2024-02-08 17:13:49 +00:00
<p>Settings:</p>
<div class="highlight highlight-source-json">
<pre>{
<span class="pl-ent">"telemetry"</span>: {
<span class="pl-ent">"diagnostics"</span>: <span class="pl-c1">false</span>,
<span class="pl-ent">"metrics"</span>: <span class="pl-c1">false</span>
},
<span class="pl-ent">"vim_mode"</span>: <span class="pl-c1">true</span>,
<span class="pl-ent">"language_overrides"</span>: {
<span class="pl-ent">"JSON"</span>: {
<span class="pl-ent">"format_on_save"</span>: <span class="pl-s"><span class="pl-pds">"</span>off<span class="pl-pds">"</span></span>,
<span class="pl-ent">"formatter"</span>: {
<span class="pl-ent">"external"</span>: {
<span class="pl-ent">"command"</span>: <span class="pl-s"><span class="pl-pds">"</span>prettier<span class="pl-pds">"</span></span>,
<span class="pl-ent">"arguments"</span>: [<span class="pl-s"><span class="pl-pds">"</span>--stdin-filepath<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>{buffer_path}<span class="pl-pds">"</span></span>]
}
}
}
}
}</pre>
</div>
2023-06-30 18:06:13 +00:00
<div>
Feel free to ask me via
<a href="mailto:hauvipapro+posts@gmail.com">email</a> or
2023-08-20 17:29:13 +00:00
<a rel="me" href="https://hachyderm.io/@haunguyen">Mastodon</a>.
<br />Source code is available on
2023-06-30 18:06:13 +00:00
<a href="https://github.com/haunt98/posts-go">GitHub</a>
2023-08-20 17:29:13 +00:00
<a href="https://codeberg.org/yoshie/posts-go">Codeberg</a>
<a href="https://git.sr.ht/~youngyoshie/posts-go">sourcehut</a>
<a href="https://gitea.treehouse.systems/yoshie/posts-go">Treehouse</a>
<a href="https://gitlab.com/youngyoshie/posts-go">GitLab</a>
2023-06-30 18:06:13 +00:00
</div>
</body>
</html>