f652c3ece6e39170ee01709aff4d717e9a00c71e
Home.md
| ... | ... | @@ -43,6 +43,9 @@ |
| 43 | 43 | |
| 44 | 44 | ## technology |
| 45 | 45 | |
| 46 | +### automation |
|
| 47 | +- [ansible](technology/automation/ansible) |
|
| 48 | + |
|
| 46 | 49 | ### authentication |
| 47 | 50 | - [ldap](technology/authentication/ldap) |
| 48 | 51 |
coding/git.md
| ... | ... | @@ -36,6 +36,11 @@ git config user.signingkey <id> |
| 36 | 36 | git commit -S -m 'msg' |
| 37 | 37 | ``` |
| 38 | 38 | |
| 39 | +compare diff between two commits |
|
| 40 | +``` |
|
| 41 | +git diff <commit>...<commit> |
|
| 42 | +``` |
|
| 43 | + |
|
| 39 | 44 | [making a pull request][] |
| 40 | 45 | |
| 41 | 46 | [branching and rebasing][] |
technology/automation/ansible.md
| ... | ... | @@ -0,0 +1 @@ |
| 1 | +# ansible |
technology/linux/audio_visual/ffmpeg.md
| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | +# ffmpeg |
|
| 2 | + |
|
| 3 | +### extract audio from video |
|
| 4 | +``` |
|
| 5 | +ffmpeg -i input-video.mkv -q:a 0 -map a output-audio.mp3 |
|
| 6 | +``` |
|
| 7 | + |
|
| 8 | +### record a video |
|
| 9 | +without audio |
|
| 10 | +``` |
|
| 11 | +ffmpeg -f x11grab -r 15 -i :0.0 -acodec libmp3lame -vcodec mpeg4 -ar 48000 -qscale 0 -framerate 24 outputvideo.avi |
|
| 12 | +``` |
|
| 13 | + |
|
| 14 | +with audio |
|
| 15 | +``` |
|
| 16 | +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 |
|
| 17 | +``` |
|
| 18 | + |
|
| 19 | +### convert video format |
|
| 20 | +``` |
|
| 21 | +ffmpeg -i videofile.mp4 videofile.webm |
|
| 22 | +``` |
technology/linux/audio_visual/index.md
| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | # audio_visual |
| 2 | 2 | |
| 3 | +- [ffmpeg](ffmpeg) |
|
| 3 | 4 | - [mpd](mpd) |
| 4 | 5 | - [mpv](mpv) |
technology/linux/general/ffmpeg.md
| ... | ... | @@ -1,6 +0,0 @@ |
| 1 | -# ffmpeg |
|
| 2 | - |
|
| 3 | -### extract audio from video |
|
| 4 | -``` |
|
| 5 | -ffmpeg -i input-video.mkv -q:a 0 -map a output-audio.mp3 |
|
| 6 | -``` |
technology/linux/general/index.md
| ... | ... | @@ -4,7 +4,6 @@ |
| 4 | 4 | - [bash](bash) |
| 5 | 5 | - [bin](bin) |
| 6 | 6 | - [dmidecode](dmidecode) |
| 7 | -- [ffmpeg](ffmpeg) |
|
| 8 | 7 | - [i3lock](i3lock) |
| 9 | 8 | - [journalctl](journalctl) |
| 10 | 9 | - [keymaps](keymaps) |
technology/linux/general/systemctl.md
| ... | ... | @@ -1,5 +1,7 @@ |
| 1 | 1 | # systemctl |
| 2 | 2 | |
| 3 | +also see [journalctl](journalctl) |
|
| 4 | + |
|
| 3 | 5 | ```bash |
| 4 | 6 | systemctl list-units [ --all | --type=service ] |
| 5 | 7 | ``` |
| ... | ... | @@ -9,13 +11,38 @@ systemctl list-units [ --all | --type=service ] |
| 9 | 11 | systemctl list-unit-files |
| 10 | 12 | ``` |
| 11 | 13 | |
| 12 | -## create service file |
|
| 14 | +#### create service file |
|
| 13 | 15 | ``` |
| 14 | 16 | vi /etc/systemd/system/<name>.service |
| 15 | 17 | ``` |
| 16 | 18 | |
| 17 | -[journalctl](journalctl) |
|
| 19 | +([manage systemd][]) |
|
| 20 | + |
|
| 21 | +## user services |
|
| 22 | +run `systemctl` (without sudo) and with the `--user` option |
|
| 23 | + |
|
| 24 | +service files are created under '$HOME/.config/systemd/user' |
|
| 25 | + |
|
| 26 | +### example user service file |
|
| 27 | +``` |
|
| 28 | +[Unit] |
|
| 29 | +Description=This is an example |
|
| 30 | + |
|
| 31 | +[Service] |
|
| 32 | +ExecStart=/path/to/command |
|
| 33 | + |
|
| 34 | +[Install] |
|
| 35 | +WantedBy=default.target |
|
| 36 | +``` |
|
| 37 | +([writing user units][]) |
|
| 38 | + |
|
| 39 | +enable and start the user service (without sudo) |
|
| 40 | +``` |
|
| 41 | +systemctl --user enable <service> |
|
| 42 | +systemctl --user start <service> |
|
| 43 | +systemctl --user status <service> |
|
| 44 | +``` |
|
| 45 | + |
|
| 18 | 46 | |
| 19 | -## ref |
|
| 20 | -- :1: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units |
|
| 21 | -- https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units |
|
| 47 | +[manage systemd]: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units |
|
| 48 | +[writing user units]: https://wiki.archlinux.org/index.php/Systemd/User#Writing_user_units |