Skip to content

Commit f915f2c

Browse files
committed
Add commands
1 parent f99a31c commit f915f2c

519 files changed

Lines changed: 41704 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/commands/2fa.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# TLDR
2+
3+
**Add a new TOTP secret** for an account
4+
5+
```2fa -add [account_name]```
6+
7+
**Generate a TOTP code** for a specific account
8+
9+
```2fa [account_name]```
10+
11+
**List all configured accounts**
12+
13+
```2fa -list```
14+
15+
**Add a secret with a specific issuer**
16+
17+
```2fa -add -issuer=[issuer_name] [account_name]```
18+
19+
**Generate codes for all accounts**
20+
21+
```2fa```
22+
23+
# SYNOPSIS
24+
25+
**2fa** [**-add**] [**-list**] [**-issuer** _name_] [_account_]
26+
27+
# PARAMETERS
28+
29+
**-add**
30+
> Add a new account. Prompts for the base32-encoded TOTP secret.
31+
32+
**-list**
33+
> List all configured account names.
34+
35+
**-issuer** _name_
36+
> Specify the issuer name when adding an account (for organization).
37+
38+
**-clip**
39+
> Copy the generated code to clipboard instead of printing.
40+
41+
# DESCRIPTION
42+
43+
**2fa** is a command-line two-factor authentication tool that generates time-based one-time passwords (TOTP) compatible with services like Google Authenticator. It stores secrets securely in a local file and produces 6-digit codes that refresh every 30 seconds.
44+
45+
The tool reads TOTP secrets in base32 format (the same format shown when setting up 2FA on websites). When run without arguments, it displays codes for all configured accounts. Specify an account name to get only that code.
46+
47+
Secrets are stored in **~/.2fa** by default. The file should be protected with appropriate permissions as it contains sensitive authentication material.
48+
49+
# CAVEATS
50+
51+
Secrets are stored unencrypted in a plain text file. Ensure proper file permissions (**chmod 600**) on the storage file. System clock must be accurate for TOTP codes to work correctly; time drift will cause authentication failures.
52+
53+
# HISTORY
54+
55+
The **2fa** command was created by Russ Cox and released as an open-source Go utility. It provides a minimal Unix-philosophy approach to TOTP generation, designed for users who prefer command-line tools over mobile authenticator apps.
56+
57+
# SEE ALSO
58+
59+
[oathtool](/man/oathtool)(1), [pass-otp](/man/pass-otp)(1), [gpg](/man/gpg)(1)
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# TLDR
2+
3+
**Basic configuration**
4+
5+
```[main]\nplugins=ifupdown,keyfile```
6+
7+
**Set DNS mode**
8+
9+
```[main]\ndns=dnsmasq```
10+
11+
**Disable MAC randomization**
12+
13+
```[device]\nwifi.scan-rand-mac-address=no```
14+
15+
**Set hostname mode**
16+
17+
```[main]\nhostname-mode=dhcp```
18+
19+
# SYNOPSIS
20+
21+
**/etc/NetworkManager/NetworkManager.conf**
22+
23+
# PARAMETERS
24+
25+
**[main]**
26+
> Main configuration section.
27+
28+
**plugins**
29+
> Connection plugins to use.
30+
31+
**dns**
32+
> DNS processing mode.
33+
34+
**[connection]**
35+
> Default connection settings.
36+
37+
**[device]**
38+
> Device-specific settings.
39+
40+
**[logging]**
41+
> Logging configuration.
42+
43+
# DESCRIPTION
44+
45+
**NetworkManager.conf** is the main configuration file for NetworkManager. It controls DNS handling, plugins, device management, and various global settings.
46+
47+
Additional configuration can be placed in /etc/NetworkManager/conf.d/.
48+
49+
# EXAMPLE CONFIG
50+
51+
```ini
52+
[main]
53+
plugins=ifupdown,keyfile
54+
dns=systemd-resolved
55+
56+
[ifupdown]
57+
managed=false
58+
59+
[device]
60+
wifi.scan-rand-mac-address=yes
61+
62+
[connection]
63+
wifi.powersave=2
64+
65+
[logging]
66+
level=WARN
67+
```
68+
69+
# DNS MODES
70+
71+
```
72+
default - Use resolv.conf
73+
dnsmasq - Local dnsmasq
74+
systemd-resolved - Use resolved
75+
none - No DNS management
76+
```
77+
78+
# CAVEATS
79+
80+
Syntax errors may prevent NM from starting. Use conf.d/ for drop-in files. Restart NM after changes.
81+
82+
# SEE ALSO
83+
84+
[NetworkManager](/man/NetworkManager)(8), [nmcli](/man/nmcli)(1), [nm-settings](/man/nm-settings)(5)

assets/commands/NetworkManager.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# TLDR
2+
3+
**Show connection status**
4+
5+
```nmcli general status```
6+
7+
**List connections**
8+
9+
```nmcli connection show```
10+
11+
**Connect to WiFi**
12+
13+
```nmcli device wifi connect "[SSID]" password "[password]"```
14+
15+
**Show WiFi networks**
16+
17+
```nmcli device wifi list```
18+
19+
**Bring up connection**
20+
21+
```nmcli connection up [connection_name]```
22+
23+
**Create static connection**
24+
25+
```nmcli connection add type ethernet con-name [myeth] ifname [eth0] ip4 [192.168.1.10/24] gw4 [192.168.1.1]```
26+
27+
# SYNOPSIS
28+
29+
**NetworkManager** [_options_]
30+
31+
# PARAMETERS
32+
33+
**--debug**
34+
> Debug mode.
35+
36+
**--log-level** _level_
37+
> Logging level.
38+
39+
**--log-domains** _domains_
40+
> Logging domains.
41+
42+
**--pid-file** _file_
43+
> PID file location.
44+
45+
# DESCRIPTION
46+
47+
**NetworkManager** is a daemon that manages network connections. It provides automatic network detection and configuration, handling wired, wireless, mobile broadband, and VPN connections.
48+
49+
NetworkManager is controlled via nmcli, nmtui, or GUI applets.
50+
51+
# CLI TOOL (nmcli)
52+
53+
```bash
54+
nmcli device # List devices
55+
nmcli connection # List connections
56+
nmcli connection modify ... # Modify connection
57+
nmcli networking off # Disable networking
58+
```
59+
60+
# CONFIGURATION
61+
62+
```
63+
/etc/NetworkManager/
64+
├── NetworkManager.conf
65+
├── system-connections/
66+
└── conf.d/
67+
```
68+
69+
# CAVEATS
70+
71+
May conflict with other network tools. Connections stored in /etc/NetworkManager/. Some systems use alternatives.
72+
73+
# HISTORY
74+
75+
NetworkManager was developed by **Red Hat** starting in **2004** to simplify network configuration on Linux desktops.
76+
77+
# SEE ALSO
78+
79+
[nmcli](/man/nmcli)(1), [nmtui](/man/nmtui)(1), [systemd-networkd](/man/systemd-networkd)(8), [netctl](/man/netctl)(1)

assets/commands/PKGBUILD.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# TLDR
2+
3+
**Build package**
4+
5+
```makepkg```
6+
7+
**Build and install**
8+
9+
```makepkg -si```
10+
11+
**Update checksums**
12+
13+
```updpkgsums```
14+
15+
**Check PKGBUILD**
16+
17+
```namcap PKGBUILD```
18+
19+
# SYNOPSIS
20+
21+
PKGBUILD specification file for Arch Linux packaging
22+
23+
# DESCRIPTION
24+
25+
**PKGBUILD** is a shell script containing build instructions for Arch Linux packages. It defines metadata, sources, and functions for compiling and packaging software.
26+
27+
Used by makepkg to create .pkg.tar.zst packages.
28+
29+
# BASIC STRUCTURE
30+
31+
```bash
32+
# Maintainer: Name <email>
33+
pkgname=mypackage
34+
pkgver=1.0.0
35+
pkgrel=1
36+
pkgdesc="Description of package"
37+
arch=('x86_64')
38+
url="https://example.com"
39+
license=('GPL')
40+
depends=('dep1' 'dep2')
41+
makedepends=('cmake')
42+
source=("$url/releases/$pkgname-$pkgver.tar.gz")
43+
sha256sums=('SKIP')
44+
45+
build() {
46+
cd "$pkgname-$pkgver"
47+
./configure --prefix=/usr
48+
make
49+
}
50+
51+
package() {
52+
cd "$pkgname-$pkgver"
53+
make DESTDIR="$pkgdir" install
54+
}
55+
```
56+
57+
# VARIABLES
58+
59+
```bash
60+
pkgname - Package name
61+
pkgver - Version
62+
pkgrel - Release number
63+
pkgdesc - Description
64+
arch - Architectures
65+
depends - Runtime dependencies
66+
makedepends - Build dependencies
67+
source - Source URLs
68+
sha256sums - Checksums
69+
```
70+
71+
# FUNCTIONS
72+
73+
```bash
74+
prepare() - Prepare sources
75+
build() - Compile
76+
check() - Run tests
77+
package() - Install to $pkgdir
78+
```
79+
80+
# CAVEATS
81+
82+
Must be named PKGBUILD. Arch-specific format. Always verify checksums. Test with namcap.
83+
84+
# HISTORY
85+
86+
PKGBUILD format was designed for **Arch Linux** by **Judd Vinet**, enabling simple, transparent package building.
87+
88+
# SEE ALSO
89+
90+
[makepkg](/man/makepkg)(8), [pacman](/man/pacman)(8), [namcap](/man/namcap)(1)

0 commit comments

Comments
 (0)