Compare commits
5 Commits
808ef3bb71
...
eeade3cdfb
Author | SHA1 | Date | |
---|---|---|---|
eeade3cdfb | |||
481b34a472 | |||
fd850761f3 | |||
b7729e5712 | |||
bbd34e24ec |
44
Makefile
Normal file
44
Makefile
Normal file
@ -0,0 +1,44 @@
|
||||
help: ## Print the help message
|
||||
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
|
||||
sort | \
|
||||
column -s ':' -t
|
||||
|
||||
articles != find * -type f -name "*.md"
|
||||
|
||||
db.rec: $(articles)
|
||||
for x in $^ ; do \
|
||||
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$x" |\
|
||||
sed -e 's/\[ //' -e 's/ \]//' |\
|
||||
tr -d '"' ;\
|
||||
printf "file: %s\n\n" "$$x" ;\
|
||||
done > $@
|
||||
recsel $@ -e "requires != ''" -CR title,requires |\
|
||||
while read title requires; do \
|
||||
IFS=', ' && for provider in $$requires; do \
|
||||
recset $@ -e "title = '$${provider}'" -f provides -a "$${title}" ;\
|
||||
done ;\
|
||||
done
|
||||
|
||||
default += db.rec
|
||||
|
||||
.git/info/exclude: $(default)
|
||||
echo $^ | tr ' ' '\n' > $@
|
||||
|
||||
default += .git/info/exclude
|
||||
|
||||
.PHONY: database
|
||||
database: $(default) ## Make a database for recfiles
|
||||
|
||||
.PHONY: article
|
||||
article: ## Write an article
|
||||
@path=$$(find . -type d -printf '%P\n' | fzy); \
|
||||
read -p "Title: " title; \
|
||||
printf '%s\n' '---' >> $$path/$$title.md ; \
|
||||
printf 'title: "%s"\n' "$$title" >> $$path/$$title.md ; \
|
||||
printf 'tags: [ "%s" ]\n' "$$path" | sed 's#\/#", "#g' >> $$path/$$title.md ; \
|
||||
printf '%s\n\n' '---' >> $$path/$$title.md ;\
|
||||
$(EDITOR) +5 $$path/$$title.md
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Remove all generated files
|
||||
$(RM) $(default)
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Board Games"
|
||||
tags: [ "data", "recfiles" ]
|
||||
tags: [ "data", "recfiles", "games" ]
|
||||
---
|
||||
|
||||
You can play with a board games database from boardgamegeek.com.
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Soft Serve through https"
|
||||
tags: [ "data", "git" ]
|
||||
tags: [ "data", "git", "lfs" ]
|
||||
---
|
||||
|
||||
## `http` Setup
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "basic-install"
|
||||
tags: [ "Documentation", "arch" ]
|
||||
requires: [ "partitions", "time" ]
|
||||
---
|
||||
Keyboard layout changed.
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "fail2ban"
|
||||
tags: [ "Documentation", "Networking" ]
|
||||
requires: [ "ssh" ]
|
||||
---
|
||||
# SSH Daemon Jail
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "sshfs"
|
||||
tags: [ "Documentation", "Networking" ]
|
||||
requires: [ "ssh" ]
|
||||
---
|
||||
# Mount
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "ssh tricks"
|
||||
title: "ssh-tricks"
|
||||
tags: [ "Documentation", "Networking", "ssh", "tricks" ]
|
||||
requires: [ "ssh" ]
|
||||
---
|
||||
|
||||
Mount a remote filesystem locally with fuse-sshfs:
|
||||
|
27
new.sh
27
new.sh
@ -1,27 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo Select a category
|
||||
|
||||
category="$(find . -type d -printf '%P\n' | fzy)"
|
||||
|
||||
[ ! -d "$category" ] && mkdir "$category"
|
||||
|
||||
echo Select a name
|
||||
|
||||
read name
|
||||
|
||||
filePath="$category/$(echo $name | sed 's/ /_/g').md"
|
||||
|
||||
tagsList="$(echo \"$category | sed 's#\/#", "#g')\""
|
||||
|
||||
[ -e "$filePath" ] && $EDITOR "$filePath" && exit 0
|
||||
|
||||
echo "---
|
||||
title: \"$name\"
|
||||
tags: [ $tagsList ]
|
||||
---
|
||||
|
||||
" > "$filePath"
|
||||
|
||||
$EDITOR "$filePath"
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "android"
|
||||
tags: [ "Documentation", "System" ]
|
||||
tags: [ "Documentation", "System", "phone" ]
|
||||
---
|
||||
# mtpfs
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user