Compare commits
19 Commits
ab079fedfa
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
f5dee293a6
|
|||
|
462192bb85
|
|||
|
d9a8b7c442
|
|||
|
6df8890b2a
|
|||
|
1e6d70d8f4
|
|||
|
58f794d7b8
|
|||
|
49452db82d
|
|||
|
a3ffdd8ae6
|
|||
|
fe1c524dc3
|
|||
|
668d605dcb
|
|||
|
cc3ac0d7b0
|
|||
|
8811e94b11
|
|||
|
cd7ddd15b2
|
|||
|
88eefd2c1e
|
|||
|
54e4cc5149
|
|||
|
9901404a91
|
|||
|
4e76fec33c
|
|||
|
d7f8c9bae1
|
|||
|
6a10468d4d
|
+76
-2
@@ -5,6 +5,15 @@
|
|||||||
%unique: shell
|
%unique: shell
|
||||||
%sort: shell bin
|
%sort: shell bin
|
||||||
|
|
||||||
|
aim: Change a CSV header
|
||||||
|
cmd: from=number
|
||||||
|
+ to=quantity
|
||||||
|
+ sed -i "1 s///" "".csv
|
||||||
|
bin: sed
|
||||||
|
tag: csv
|
||||||
|
tag: substitute
|
||||||
|
tag: replace
|
||||||
|
|
||||||
aim: Roll a die
|
aim: Roll a die
|
||||||
cmd: echo $(( RANDOM % 6+1 ))
|
cmd: echo $(( RANDOM % 6+1 ))
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -200,6 +209,13 @@ shell: sh
|
|||||||
bin: fzf
|
bin: fzf
|
||||||
tag: comfy
|
tag: comfy
|
||||||
|
|
||||||
|
aim: Read the minimal size of a git repo
|
||||||
|
cmd: git count-objects -vH | grep -Po 'size-pack: \K.*'
|
||||||
|
note: Git repositories are never at their minimal size.
|
||||||
|
shell: sh
|
||||||
|
bin: git
|
||||||
|
tag: size
|
||||||
|
|
||||||
aim: Email a pull request which points to your git server
|
aim: Email a pull request which points to your git server
|
||||||
tag: git
|
tag: git
|
||||||
shell: sh
|
shell: sh
|
||||||
@@ -286,7 +302,7 @@ shell: sh
|
|||||||
bin: journalctl
|
bin: journalctl
|
||||||
tag: system
|
tag: system
|
||||||
|
|
||||||
aim: Find errors since a date
|
aim: Find service errors in systemd since a date
|
||||||
cmd: date=2027-01-01
|
cmd: date=2027-01-01
|
||||||
+ journalctl --since=${date} --grep="EXT4-fs error"
|
+ journalctl --since=${date} --grep="EXT4-fs error"
|
||||||
shell: sh
|
shell: sh
|
||||||
@@ -294,7 +310,8 @@ bin: journalctl
|
|||||||
tag: system
|
tag: system
|
||||||
|
|
||||||
aim: Limit the systemd's journal size to 2 gigabytes
|
aim: Limit the systemd's journal size to 2 gigabytes
|
||||||
cmd: journalctl --vacuum-size=2G
|
cmd: journalctl --disk-usage
|
||||||
|
+ journalctl --vacuum-size=2G
|
||||||
+ journalctl --disk-usage
|
+ journalctl --disk-usage
|
||||||
shell: sh
|
shell: sh
|
||||||
bin: journalctl
|
bin: journalctl
|
||||||
@@ -413,6 +430,13 @@ bin: ntpd
|
|||||||
tag: time
|
tag: time
|
||||||
tag: system
|
tag: system
|
||||||
|
|
||||||
|
aim: Convert bytes to human readable size
|
||||||
|
cmd: b=10392309
|
||||||
|
+ echo "$b" | numfmt --to=eic
|
||||||
|
shell: sh
|
||||||
|
bin: numfmt
|
||||||
|
tag: size
|
||||||
|
|
||||||
aim: Uncompress a PDF
|
aim: Uncompress a PDF
|
||||||
cmd: pdftk ${input}.pdf output ${output}.pdf uncompress
|
cmd: pdftk ${input}.pdf output ${output}.pdf uncompress
|
||||||
shell: sh
|
shell: sh
|
||||||
@@ -427,6 +451,17 @@ bin: printf
|
|||||||
tag: xargs
|
tag: xargs
|
||||||
tag: stdout
|
tag: stdout
|
||||||
|
|
||||||
|
aim: Share a directory as a local website
|
||||||
|
cmd: python3 -m http.server
|
||||||
|
note: Anyone can go to your computer's IP address and access all files in the current directory.
|
||||||
|
shell: sh
|
||||||
|
bin: python3
|
||||||
|
tag: tip
|
||||||
|
tag: network
|
||||||
|
tag: share
|
||||||
|
cmd: qrencode -t ansi "$(ip route show | grep -Pom1 'src \K[\d.]+')"
|
||||||
|
+ sudo python -m http.server 80
|
||||||
|
|
||||||
aim: Make a QR Code image
|
aim: Make a QR Code image
|
||||||
cmd: qrencode 'https://play.google.com/store/apps/details?id=org.briarproject.briar.android' -o "${file}".png
|
cmd: qrencode 'https://play.google.com/store/apps/details?id=org.briarproject.briar.android' -o "${file}".png
|
||||||
shell: sh
|
shell: sh
|
||||||
@@ -470,6 +505,12 @@ bin: recinf
|
|||||||
tag: recfiles
|
tag: recfiles
|
||||||
tag: database
|
tag: database
|
||||||
|
|
||||||
|
aim: Remove non-printable characters
|
||||||
|
cmd: sed -i 's/[^[:print:]]//g' ${file}
|
||||||
|
shell: sh
|
||||||
|
bin: sed
|
||||||
|
tag: text
|
||||||
|
|
||||||
aim: Get back terminal after ssh freezes remote machine
|
aim: Get back terminal after ssh freezes remote machine
|
||||||
cmd: <Return>~.
|
cmd: <Return>~.
|
||||||
shell: sh
|
shell: sh
|
||||||
@@ -477,6 +518,39 @@ bin: ssh
|
|||||||
tag: system
|
tag: system
|
||||||
tag: comfy
|
tag: comfy
|
||||||
|
|
||||||
|
aim: Launch GUI app as root
|
||||||
|
cmd: app=gparted
|
||||||
|
+ sudo -E ${app}
|
||||||
|
note: Useful for launching gparted in sway.
|
||||||
|
shell: sh
|
||||||
|
bin: sudo
|
||||||
|
tag: wayland
|
||||||
|
tag: gui
|
||||||
|
tag: sway
|
||||||
|
|
||||||
|
aim: Check current keyboard layout on sway
|
||||||
|
cmd: swaymsg -t get_inputs --raw | jq -r '.[0].xkb_active_layout_name'
|
||||||
|
bin: sway
|
||||||
|
bin: jq
|
||||||
|
tag: keyboard
|
||||||
|
tag: locale
|
||||||
|
shell: sh
|
||||||
|
|
||||||
|
aim: Show name of currently selected app in sway
|
||||||
|
cmd: swaymsg -t get_tree | jq -C '.. | select(.type?) | select(.focused==true)'
|
||||||
|
bin: sway
|
||||||
|
bin: jq
|
||||||
|
tag: bar
|
||||||
|
shell: sh
|
||||||
|
|
||||||
|
aim: List enabled systemd services
|
||||||
|
cmd: systemctl list-unit-files --state enabled
|
||||||
|
cmd: systemctl --user list-unit-files --state enabled
|
||||||
|
shell: sh
|
||||||
|
bin: systemd
|
||||||
|
tag: system
|
||||||
|
tag: service
|
||||||
|
|
||||||
aim: Check a service
|
aim: Check a service
|
||||||
cmd: sudo systemctl status mpd
|
cmd: sudo systemctl status mpd
|
||||||
shell: sh
|
shell: sh
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: git
|
title: Setup git
|
||||||
tags:
|
tags:
|
||||||
- data
|
- data
|
||||||
- setup
|
- setup
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: pass
|
title: Store passwords
|
||||||
tags:
|
tags:
|
||||||
- data
|
- data
|
||||||
|
- Setup
|
||||||
- credentials
|
- credentials
|
||||||
- secrets
|
- secrets
|
||||||
requires:
|
requires:
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ requires:
|
|||||||
- networking/nginx.md
|
- networking/nginx.md
|
||||||
---
|
---
|
||||||
|
|
||||||
|
- [Soft-Serve with https](soft-serve/commands.md)
|
||||||
- [Soft-Serve with https](soft-serve/soft_https.md)
|
- [Soft-Serve with https](soft-serve/soft_https.md)
|
||||||
- [Maintenance](soft-serve/soft_maintenance.md)
|
- [Maintenance](soft-serve/soft_maintenance.md)
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
title: Soft-Serve Commands
|
||||||
|
tags:
|
||||||
|
- data
|
||||||
|
- git server
|
||||||
|
- CLI
|
||||||
|
requires:
|
||||||
|
- data/git.md
|
||||||
|
- networking/ssh.md
|
||||||
|
---
|
||||||
|
|
||||||
|
Some commands to try with an active soft server:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh -p 2222 splint.rs repo list
|
||||||
|
|
||||||
|
ssh -p 2222 splint.rs repo info nd6
|
||||||
|
|
||||||
|
ssh -p 2222 splint.rs repo tree nd6 /
|
||||||
|
|
||||||
|
ssh -p 2222 splint.rs repo info newsraft
|
||||||
|
|
||||||
|
ssh -p 2222 splint.rs repo tree newsraft main doc
|
||||||
|
|
||||||
|
ssh -p 2222 splint.rs repo tree mkdots all scripts
|
||||||
|
|
||||||
|
ssh -p 2222 splint.rs repo -cl cat mkdots all scripts/nb | less -R
|
||||||
|
|
||||||
|
```
|
||||||
+34
-11
@@ -1,6 +1,5 @@
|
|||||||
%rec: example
|
%rec: example
|
||||||
%key: name
|
%key: name
|
||||||
%type: note line
|
|
||||||
|
|
||||||
name: Default systemd service file
|
name: Default systemd service file
|
||||||
filename: default.service
|
filename: default.service
|
||||||
@@ -148,9 +147,8 @@ content: ### Variables
|
|||||||
+
|
+
|
||||||
+ .PHONY: help
|
+ .PHONY: help
|
||||||
+ help:
|
+ help:
|
||||||
+ @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
|
+ @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) \
|
||||||
+ sort | \
|
+ | sort | column -s ':' -t
|
||||||
+ column -s ':' -t
|
|
||||||
+
|
+
|
||||||
+ .PHONY: check
|
+ .PHONY: check
|
||||||
+ check: ## Check you have the required dependencies
|
+ check: ## Check you have the required dependencies
|
||||||
@@ -209,8 +207,7 @@ content: hdr = @printf "\n\033[37;1;4m%s\033[0m\n"
|
|||||||
+ @printf "\033[36m%s\t" "done"
|
+ @printf "\033[36m%s\t" "done"
|
||||||
+ @printf "\033[0m %s " "Close $$(basename -s .md $(last_modified) | tr '_' ' ')"
|
+ @printf "\033[0m %s " "Close $$(basename -s .md $(last_modified) | tr '_' ' ')"
|
||||||
+ @printf "\033[0m %s\n" "[$$(grep -Pom1 'title: \K.*' $(last_modified))]"
|
+ @printf "\033[0m %s\n" "[$$(grep -Pom1 'title: \K.*' $(last_modified))]"
|
||||||
+ @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
|
+ @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | + column -s ':' -t
|
||||||
+ column -s ':' -t
|
|
||||||
+
|
+
|
||||||
+ $(closed_issues): closed/%.md: open/%.md
|
+ $(closed_issues): closed/%.md: open/%.md
|
||||||
+ @git add $<
|
+ @git add $<
|
||||||
@@ -249,8 +246,34 @@ content: hdr = @printf "\n\033[37;1;4m%s\033[0m\n"
|
|||||||
+ .PHONY: rundown
|
+ .PHONY: rundown
|
||||||
+ rundown: ## Summarize events
|
+ rundown: ## Summarize events
|
||||||
+ @printf "\033[33;5m# %s\033[0m\n" "Outstanding Calamities"
|
+ @printf "\033[33;5m# %s\033[0m\n" "Outstanding Calamities"
|
||||||
+ @$(foreach bug, $(wildcard open/*.md), \
|
+ @$(foreach bug, $(wildcard open/*.md), + a="$$(lowdown -X responsible $(bug))" && + n="$$(echo $(bug) | cut -d_ -f2 | cut -d. -f1)" && + t="$$(lowdown -X title $(bug))" && echo "$$n: $$t ($$a)" ;+ )
|
||||||
+ a="$$(lowdown -X responsible $(bug))" && \
|
|
||||||
+ n="$$(echo $(bug) | cut -d_ -f2 | cut -d. -f1)" && \
|
name: RSS feed
|
||||||
+ t="$$(lowdown -X title $(bug))" && echo "$$n: $$t ($$a)" ;\
|
filename: rss.xml
|
||||||
+ )
|
note: Only 'description', 'link', and 'title' are required.
|
||||||
|
+
|
||||||
|
+ Extra fields include 'textInput' (for a paragraph about the feed), 'skipHours' (for the hours to wait before refreshing), and 'language'.
|
||||||
|
content: <?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
+ <rss version="2.0">
|
||||||
|
+
|
||||||
|
+ <channel>
|
||||||
|
+ <title>{{title}}</title>
|
||||||
|
+ <link>{{url}}</link>
|
||||||
|
+ <generator>Recutils</generator>
|
||||||
|
+ <docs>https://www.w3schools.com/XML/xml_rss.asp</docs>
|
||||||
|
+ <skipDays>{{frequency}}</skipDays>
|
||||||
|
+ <description>{{description}}</description>
|
||||||
|
note: Output the next content field separately to produce multiple post items.
|
||||||
|
content: <item>
|
||||||
|
+ <guid>{{post_id}}</guid>
|
||||||
|
+ <category>{{post_category}}</category>
|
||||||
|
+ <pubDate>{{post_date}}</pubDate>
|
||||||
|
+ <title>{{post_title}}</title>
|
||||||
|
+ <link>{{url}}/{{post_link}}</link>
|
||||||
|
+ <description>{{post_description}}</description>
|
||||||
|
+ <source>{{post_source}}</source>
|
||||||
|
+ </item>
|
||||||
|
note: The last content field closes the XML tags opened in the first content field.
|
||||||
|
content: </channel>
|
||||||
|
+
|
||||||
|
+ </rss>
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
title: Remote Desktop between Sway
|
||||||
|
tags:
|
||||||
|
- networking
|
||||||
|
requires:
|
||||||
|
- networking/ssh.md
|
||||||
|
---
|
||||||
|
|
||||||
|
# On the Host
|
||||||
|
|
||||||
|
Install and run `wayvnc`.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export WAYLAND_DISPLAY=wayland-1
|
||||||
|
wayvnc
|
||||||
|
```
|
||||||
|
|
||||||
|
Only the `localhost` can access this (highly insecure) desktop sharing, at port 5900.
|
||||||
|
|
||||||
|
# On the Client
|
||||||
|
|
||||||
|
You'll need to disable your main modifier key on the client while accessing the host.
|
||||||
|
Edit `~/.config/sway/config`, and create a new `passthrough` mode where the modifier key does nothing.
|
||||||
|
|
||||||
|
```config
|
||||||
|
mode passthrough {
|
||||||
|
bindsym $mod+c mode default
|
||||||
|
}
|
||||||
|
bindsym $mod+c mode passthrough
|
||||||
|
```
|
||||||
|
|
||||||
|
Reload sway to make the changes take effect.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
swaymsg reload
|
||||||
|
```
|
||||||
|
|
||||||
|
Use `ssh` to grab the host's port 5900.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh -L 5900:localhost:5900 ${remote_username}@${remote_ip}
|
||||||
|
```
|
||||||
|
|
||||||
|
Leave that session running, and connect with `vncviewer`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
vncviewer localhost:5900
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
title: New Sway Remote Desktop
|
||||||
|
tags:
|
||||||
|
- networking
|
||||||
|
requires:
|
||||||
|
- networking/remote_sway.md
|
||||||
|
---
|
||||||
|
|
||||||
|
Check the host is using only one display:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
test "$WAYLAND_DISPLAY" = "wayland-1"
|
||||||
|
```
|
||||||
|
|
||||||
|
Start a new sway session, and a `wayvnc` session:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
WLR_BACKENDS=headless WLR_LIBINPUT_NO_DEVICES=1 sway &
|
||||||
|
WAYLAND_DISPLAY=wayland-2 wayvnc
|
||||||
|
```
|
||||||
|
|
||||||
|
On the client, [connect as usual](networking/remote_sway.md).
|
||||||
+1
-2
@@ -8,9 +8,8 @@ tags:
|
|||||||
|
|
||||||
Try out basic ssh by accessing `git.charm.sh`, without needing authentication:
|
Try out basic ssh by accessing `git.charm.sh`, without needing authentication:
|
||||||
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
ssh git.charm.sh
|
ssh -t git.charm.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Start an ssh server to try it out.
|
Start an ssh server to try it out.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ $(publish): .publish/%.md: %.md | .dbs/notes.rec .dbs/requires.fmt
|
|||||||
cmds != recsel command.rec -t command -G bin -CP bin | sort -u
|
cmds != recsel command.rec -t command -G bin -CP bin | sort -u
|
||||||
lists = $(patsubst %,.publish/lists/%.md, $(cmds))
|
lists = $(patsubst %,.publish/lists/%.md, $(cmds))
|
||||||
|
|
||||||
get_title = printf 'title: %s\n' '${1}'
|
get_title = printf 'title: "Rundown: %s"\n' '${1}'
|
||||||
get_tags = recsel -t $(basename $<) $< -G bin \
|
get_tags = recsel -t $(basename $<) $< -G bin \
|
||||||
-e 'bin = "$(1)"' -U -CP tag,bin | \
|
-e 'bin = "$(1)"' -U -CP tag,bin | \
|
||||||
sed 's/.*/- &/'
|
sed 's/.*/- &/'
|
||||||
|
|||||||
+4
-3
@@ -23,14 +23,15 @@ Most programs let you clear the highlighting with `<Esc>+u`.
|
|||||||
Follow a file as new lines are added to it:
|
Follow a file as new lines are added to it:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
tail -f *somefile*
|
tail -f "${file}"
|
||||||
```
|
```
|
||||||
|
|
||||||
See changes in a directory, as it changes:
|
Watch which files in `${directory}` have most recently changed.
|
||||||
|
|
||||||
`watch -d ls *directory*`
|
`watch -d ls -t ${directory}/
|
||||||
|
|
||||||
Or use the `-g` flag to exit once the output changes.
|
Or use the `-g` flag to exit once the output changes.
|
||||||
|
|
||||||
This command will look at whether you're connected to the internet, and turn into a rainbow once the connection hits.
|
This command will look at whether you're connected to the internet, and turn into a rainbow once the connection hits.
|
||||||
|
|
||||||
> watch -g ip address && clear && ip address | lolcat
|
> watch -g ip address && clear && ip address | lolcat
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: make help target
|
title: Make help target
|
||||||
tags:
|
tags:
|
||||||
- system
|
- system
|
||||||
- make
|
- make
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: Making Services
|
title: Make a Service
|
||||||
tags:
|
tags:
|
||||||
- systemd
|
- systemd
|
||||||
---
|
---
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ You would type a command to the computer, and it would type out any errors.
|
|||||||
It would not waste paper, ink, and time by typing out `COMMAND RUN SUCCESSFULLY` after each command.
|
It would not waste paper, ink, and time by typing out `COMMAND RUN SUCCESSFULLY` after each command.
|
||||||
A silent machine meant a happy machine.
|
A silent machine meant a happy machine.
|
||||||
|
|
||||||
To fully appreciate `ed`, you should [slow down your terminal].
|
To fully appreciate `ed`, you should [slow down your terminal][slow].
|
||||||
|
|
||||||
[slow]: shell/slow.md
|
[slow]: shell/slow.md
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user