]> www.git.dmfe.net Git - dmfe-website/commitdiff
Add transmission and systemd pages.
authorDmitry Fedotov <dm.fe@yandex.ru>
Sat, 17 Aug 2024 09:24:49 +0000 (12:24 +0300)
committerDmitry Fedotov <dm.fe@yandex.ru>
Sat, 17 Aug 2024 09:24:49 +0000 (12:24 +0300)
docs/unix-linux/utils/_category_.json [new file with mode: 0644]
docs/unix-linux/utils/systemd.md [new file with mode: 0644]
docs/unix-linux/utils/transmission.md [new file with mode: 0644]

diff --git a/docs/unix-linux/utils/_category_.json b/docs/unix-linux/utils/_category_.json
new file mode 100644 (file)
index 0000000..f9f0ddc
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "label": "Linux/Unix Utils",
+  "position": 2,
+  "link": {
+    "type": "generated-index",
+    "description": "Usefull information about different Linux/Unix utils."
+  }
+}
diff --git a/docs/unix-linux/utils/systemd.md b/docs/unix-linux/utils/systemd.md
new file mode 100644 (file)
index 0000000..67aafb8
--- /dev/null
@@ -0,0 +1,51 @@
+---
+sidebar_position: 2
+tags:
+    - linux
+    - unix
+    - utils
+    - systemd
+---
+
+# systemd
+
+_systemd_ is a suit of basic building blocks for a linux system.
+It provides a system and service manager that runs as PID 1 and starts the rest of the system.
+
+## Basic systemctl usage
+
+The main command used to introspect and control _systemd_ is `systemctl`.
+Some of its uses are examinig the system state and managing the system and services.
+
+### Using units
+
+Units commonly include, but are not limited to, services (.service), mount points (.mount),
+devices (.device) and sockets (.socket). When using `systemctl`, you generally have to
+specify the complete name of the unit file, including suffix, for example `sshd.socket`.
+There are a few short forms when specifying the unit int the following `systemctl` commands:
+- If you do not specify the suffix, systemctl will assume _.service_
+- Mount points will automatically be translated into the appropriate _.mount_ unit.
+  For example `/home` is equivalent to `home.mount`
+- Similar to mount points, devices are automatically translated into the appropriate _.device_ unit.
+  Therefore specifying `/dev/sda2` is equivalent to `dev-sda2.device`
+
+|                                   Action                                       |                  Command              |                    Note                |
+|--------------------------------------------------------------------------------|---------------------------------------|----------------------------------------|
+| **Show system status**                                                         | `systemctl status`                    |                                        |
+| **List running** units                                                         | `systemctl` or `systemctl list-units` |                                        |
+| **List failing** units                                                         | `systemctl --failed`                  |                                        |
+| **List installed** unit files                                                  | `systemctl list-unit-files`           |                                        |
+| **Show process status** for a PID                                              | `systemctl status pid`                | cgroup slice, memory and parent        |
+| **Show a manual page** associated with a unit                                  | `systemctl help unit`                 | as supported by the unit               |
+| **Status** of a unit                                                           | `systemctl status unit`               | including whether it is running or not |
+| **Check** whether a unit is enabled                                            | `systemctl is-enabled unit`           |                                        |
+| **Start** a unit immediately                                                   | `systemctl start unit`                |                                        |
+| **Stop** a unit immediately                                                    | `systemctl stop unit`                 |                                        |
+| **Restart** a unit                                                             | `systemctl restart unit`              |                                        |
+| **Reload** a unit and its configuration                                        | `systemctl reload unit`               |                                        |
+| **Enable** a unit to start auatomatically at boot                              | `systemctl enable unit`               |                                        |
+| **Enable** a unit to start auatomatically at boot and **start** it immediately | `systemctl enable --now unit`         |                                        |
+| **Disable** a unit to no longer to start at boot                               | `systemctl disable unit`              |                                        |
+| **Reenable** a unit                                                            | `systemctl reenable unit`             | i.e. disable and enable anew           |
+
+
diff --git a/docs/unix-linux/utils/transmission.md b/docs/unix-linux/utils/transmission.md
new file mode 100644 (file)
index 0000000..2654c49
--- /dev/null
@@ -0,0 +1,67 @@
+---
+sidebar_position: 1
+tags:
+    - linux
+    - unix
+    - utils
+    - transmission
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Transmission
+
+[Transmission](https://transmissionbt.com/) is a light-weight and cross-platform BitTorrent client.
+
+## Installation
+
+<Tabs>
+  <TabItem value="arch" label="archlinux" default>
+        ```bash
+        $ sudo pacman -S transmission-cli
+        ```
+  </TabItem>
+</Tabs>
+
+## transmission-remote
+
+**transmission-remote** is a remote control utility for transimission-daemon.
+By default connects to the transmission session at `localhost:9091`.
+
+### Command examples
+
+```bash title="Print command-line option descriptions"
+$ transmission-remote -h
+$ transmission-remote --help
+```
+
+```bash title="Add torrents to transmission"
+$ transmission-remote -a filenames-or-URLs
+$ transmission-remote --add filenames-or-URLs
+```
+
+```bash title="List all torrents"
+$ transmission-remote -l
+$ transmission-remote --list
+```
+
+```bash title="List all active torrents"
+$ transmission-remote -tactive -l
+```
+
+```bash title="List all torrents with label 'abc'"
+$ transmission-remote -F l:abc -l
+```
+
+```bash title="List all torrents with name containig 'def'"
+$ transmission-remote -F n:def -l
+```
+
+```bash title="Start all torrents"
+transmission-remote -tall --start
+```
+
+```bash title="Get a list of files for torrent with id = 1"
+transmission-remote -t1 -f
+```