commit f652c3ece6e39170ee01709aff4d717e9a00c71e
parent b0c1e07762129617fb89e22d003525c7f309dd6e
Author: pyratebeard <root@pyratebeard.net>
Date: Sun, 24 Feb 2019 00:46:01 +0000
Merge remote-tracking branch 'refs/remotes/origin/master'
Diffstat:
8 files changed, 64 insertions(+), 12 deletions(-)
diff --git a/Home.md b/Home.md
@@ -43,6 +43,9 @@
## technology
+### automation
+- [ansible](technology/automation/ansible)
+
### authentication
- [ldap](technology/authentication/ldap)
diff --git a/coding/git.md b/coding/git.md
@@ -36,6 +36,11 @@ git config user.signingkey <id>
git commit -S -m 'msg'
```
+compare diff between two commits
+```
+git diff <commit>...<commit>
+```
+
[making a pull request][]
[branching and rebasing][]
diff --git a/technology/automation/ansible.md b/technology/automation/ansible.md
@@ -0,0 +1 @@
+# ansible
diff --git a/technology/linux/audio_visual/ffmpeg.md b/technology/linux/audio_visual/ffmpeg.md
@@ -0,0 +1,22 @@
+# ffmpeg
+
+### extract audio from video
+```
+ffmpeg -i input-video.mkv -q:a 0 -map a output-audio.mp3
+```
+
+### record a video
+without audio
+```
+ffmpeg -f x11grab -r 15 -i :0.0 -acodec libmp3lame -vcodec mpeg4 -ar 48000 -qscale 0 -framerate 24 outputvideo.avi
+```
+
+with audio
+```
+ffmpeg -f alsa -ac 2 -i alsa -f x11grab -r 15 -i :0.0 -acodec libmp3lame -vcodec mpeg4 -ar 48000 -qscale 0 -framerate 24 outputvideo.avi
+```
+
+### convert video format
+```
+ffmpeg -i videofile.mp4 videofile.webm
+```
diff --git a/technology/linux/audio_visual/index.md b/technology/linux/audio_visual/index.md
@@ -1,4 +1,5 @@
# audio_visual
+- [ffmpeg](ffmpeg)
- [mpd](mpd)
- [mpv](mpv)
diff --git a/technology/linux/general/ffmpeg.md b/technology/linux/general/ffmpeg.md
@@ -1,6 +0,0 @@
-# ffmpeg
-
-### extract audio from video
-```
-ffmpeg -i input-video.mkv -q:a 0 -map a output-audio.mp3
-```
diff --git a/technology/linux/general/index.md b/technology/linux/general/index.md
@@ -4,7 +4,6 @@
- [bash](bash)
- [bin](bin)
- [dmidecode](dmidecode)
-- [ffmpeg](ffmpeg)
- [i3lock](i3lock)
- [journalctl](journalctl)
- [keymaps](keymaps)
diff --git a/technology/linux/general/systemctl.md b/technology/linux/general/systemctl.md
@@ -1,5 +1,7 @@
# systemctl
+also see [journalctl](journalctl)
+
```bash
systemctl list-units [ --all | --type=service ]
```
@@ -9,13 +11,38 @@ systemctl list-units [ --all | --type=service ]
systemctl list-unit-files
```
-## create service file
+#### create service file
```
vi /etc/systemd/system/<name>.service
```
-[journalctl](journalctl)
+([manage systemd][])
+
+## user services
+run `systemctl` (without sudo) and with the `--user` option
+
+service files are created under '$HOME/.config/systemd/user'
+
+### example user service file
+```
+[Unit]
+Description=This is an example
+
+[Service]
+ExecStart=/path/to/command
+
+[Install]
+WantedBy=default.target
+```
+([writing user units][])
+
+enable and start the user service (without sudo)
+```
+systemctl --user enable <service>
+systemctl --user start <service>
+systemctl --user status <service>
+```
+
-## ref
-- :1: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
-- https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
+[manage systemd]: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
+[writing user units]: https://wiki.archlinux.org/index.php/Systemd/User#Writing_user_units