Update cheatsheets

This commit is contained in:
ivuorinen
2025-01-21 00:16:55 +00:00
parent 1f72b34083
commit 11e0e72150
5 changed files with 45 additions and 12 deletions

View File

@@ -23,3 +23,11 @@ source: https://github.com/tldr-pages/tldr.git
- Print file with author name and commit hash on each line before a specific commit:
`git blame {{commit}}~ {{path/to/file}}`
- Print author name and commit hash information for a specific line range:
`git blame -L {{start_line}},{{end_line}} {{path/to/file}}`
- Ignore whitespaces and line moves:
`git blame -w -C -C -C {{path/to/file}}`

View File

@@ -13,25 +13,25 @@ source: https://github.com/tldr-pages/tldr.git
`git config --global {{user.name|user.email}} "{{Your Name|email@example.com}}"`
- List local or global configuration entries:
- List local, global or system configuration entries and show their file location:
`git config --list --{{local|global}}`
`git config --list --{{local|global|system}} --show-origin`
- List only system configuration entries (stored in `/etc/gitconfig`), and show their file location:
- Set the global value of a given configuration entry (in this case an alias):
`git config --list --system --show-origin`
`git config --global {{alias.unstage}} "reset HEAD --"`
- Get the value of a given configuration entry:
`git config alias.unstage`
`git config {{alias.unstage}}`
- Set the global value of a given configuration entry:
- Use an alias:
`git config --global alias.unstage "reset HEAD --"`
`git {{unstage}}`
- Revert a global configuration entry to its default value:
`git config --global --unset alias.unstage`
`git config --global --unset {{alias.unstage}}`
- Edit the local Git configuration (`.git/config`) in the default editor:

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`git maintenance register`
- Start running maintenance on the current repository:
- Schedule maintenance tasks on the current repository every hour:
`git maintenance start`

View File

@@ -9,14 +9,18 @@ source: https://github.com/tldr-pages/tldr.git
> It profiles the function executions of a program.
> More information: <https://ftp.gnu.org/old-gnu/Manuals/gprof-2.9.1/html_mono/gprof.html>.
- Compile binary with gprof information and run it to get `gmon.out`:
- Compile binary to default `a.out` with gprof information and run it to get `gmon.out`:
`gcc -pg {{program.c}} && {{./a.out}}`
`gcc -pg {{program.c}} && ./a.out`
- Run gprof to obtain profile output:
- Run gprof on default `a.out` and `gmon.out` to obtain profile output:
`gprof`
- Run gprof on a named binary:
`gprof {{path/to/binary}} {{path/to/gmon.out}}`
- Suppress profile field's description:
`gprof -b`

21
tldr/lame Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# lame
> Encode WAV to MP3 files.
> More information: <https://svn.code.sf.net/p/lame/svn/trunk/lame/USAGE>.
- Encode an audio file to MP3 using CBR 320 kbit/second:
`lame -b 320 {{path/to/file}}.wav {{path/to/output}}.mp3`
- Encode an audio file to MP3 using the V0 preset:
`lame -V 0 {{path/to/file}}.wav {{path/to/output}}.mp3`
- Encode an audio file to AAC:
`lame {{path/to/file}}.wav {{path/to/output}}.aac`