summaryrefslogtreecommitdiff
path: root/src/content/blog
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/blog')
-rw-r--r--src/content/blog/2018/07/17/guix-nixos.adoc6
-rw-r--r--src/content/blog/2018/12/21/ytdl-subs.adoc10
-rw-r--r--src/content/blog/2019/06/02/nixos-stateless-workstation.adoc2
-rw-r--r--src/content/blog/2020/08/10/guix-srht.adoc4
-rw-r--r--src/content/blog/2020/10/05/cargo2nix.adoc2
-rw-r--r--src/content/blog/2020/10/05/swift2nix.adoc5
-rw-r--r--src/content/blog/2020/11/14/local-first-review.adoc6
-rw-r--r--src/content/blog/2021/01/26/remembering-ann.adoc18
-rw-r--r--src/content/blog/2021/02/17/fallible.adoc2
-rw-r--r--src/content/blog/2021/04/29/relational-review.adoc6
10 files changed, 32 insertions, 29 deletions
diff --git a/src/content/blog/2018/07/17/guix-nixos.adoc b/src/content/blog/2018/07/17/guix-nixos.adoc
index b9cd89b..42290f6 100644
--- a/src/content/blog/2018/07/17/guix-nixos.adoc
+++ b/src/content/blog/2018/07/17/guix-nixos.adoc
@@ -19,7 +19,7 @@ builds in the isolated environments.
The {manual}[manual] already provides you with a ready to run (as root) command
for creating the build users:
-[source,bash]
+[source,sh]
----
groupadd --system guixbuild
for i in `seq -w 1 10`;
@@ -37,7 +37,7 @@ However, In my personal NixOS I have disabled
{mutable-users}[`users.mutableUsers`], which means that even if I run the above
command it means that they'll be removed once I rebuild my OS:
-[source,shell]
+[source,sh]
----
$ sudo nixos-rebuild switch
(...)
@@ -165,7 +165,7 @@ guix-daemon = {
There you go! After running `sudo nixos-rebuild switch` I could get Guix up and
running:
-[source,bash]
+[source,sh]
----
$ guix package -i hello
The following package will be installed:
diff --git a/src/content/blog/2018/12/21/ytdl-subs.adoc b/src/content/blog/2018/12/21/ytdl-subs.adoc
index b6540b7..5c4575f 100644
--- a/src/content/blog/2018/12/21/ytdl-subs.adoc
+++ b/src/content/blog/2018/12/21/ytdl-subs.adoc
@@ -46,7 +46,7 @@ less control on what you share with YouTube and Google.
youtube-dl is a command-line tool for downloading videos, from YouTube and
{other-sites}[many other sites]:
-[source,shell]
+[source,sh]
----
$ youtube-dl https://www.youtube.com/watch?v=rnMYZnY3uLA
[youtube] rnMYZnY3uLA: Downloading webpage
@@ -70,7 +70,7 @@ some interesting flags that we can use:
Putting it all together:
-[source,shell]
+[source,sh]
----
$ youtube-dl "https://www.youtube.com/channel/UClu474HMt895mVxZdlIHXEA" \
--download-archive ~/Nextcloud/cache/youtube-dl-seen.conf \
@@ -90,7 +90,7 @@ download only the last video, since the other 19 were already downloaded.
With this basic setup you have a minimal subscription system at work, and you
can create some functions to help you manage that:
-[source,shell]
+[source,sh]
----
#!/bin/sh
@@ -128,7 +128,7 @@ export -f download_playlist
With these functions, you now can have a subscription fetching script to
download the latest videos from your favorite channels:
-[source,shell]
+[source,sh]
----
#!/bin/sh
@@ -180,7 +180,7 @@ You could try putting it in a dedicated git repository, and wrap the script with
an autocommit after every run. If you ever had a merge conflict, you'd simply
accept all changes and then run the following to tidy up the file:
+
-[source,shell]
+[source,sh]
----
$ uniq youtube-dl-seen.conf > youtube-dl-seen.conf
----
diff --git a/src/content/blog/2019/06/02/nixos-stateless-workstation.adoc b/src/content/blog/2019/06/02/nixos-stateless-workstation.adoc
index 541440b..f89a106 100644
--- a/src/content/blog/2019/06/02/nixos-stateless-workstation.adoc
+++ b/src/content/blog/2019/06/02/nixos-stateless-workstation.adoc
@@ -106,7 +106,7 @@ I'm using {myrepos}[myrepos] to manage all my git repositories, and the general
rule I apply is to add any repository specific configuration in myrepos'
`checkout` phase:
-[source,shell]
+[source,sh]
----
# sample ~/.mrconfig file snippet
[dev/guix/guix]
diff --git a/src/content/blog/2020/08/10/guix-srht.adoc b/src/content/blog/2020/08/10/guix-srht.adoc
index 6411259..a89e86e 100644
--- a/src/content/blog/2020/08/10/guix-srht.adoc
+++ b/src/content/blog/2020/08/10/guix-srht.adoc
@@ -18,7 +18,7 @@ heavily on interactive input.
I developed the following set of scripts that I have been using for some time to
run Guix tasks inside builds.sr.ht jobs. First, `install-guix.sh`:
-[source,shell]
+[source,sh]
----
#!/usr/bin/env bash
set -x
@@ -67,7 +67,7 @@ guixbuild users and authorize the `ci.guix.gnu.org.pub` signing key.
After installing Guix, we perform a `guix pull` to update Guix inside
`start-guix.sh`:
-[source,shell]
+[source,sh]
----
#!/usr/bin/env bash
set -x
diff --git a/src/content/blog/2020/10/05/cargo2nix.adoc b/src/content/blog/2020/10/05/cargo2nix.adoc
index 38f3bfa..a2d478e 100644
--- a/src/content/blog/2020/10/05/cargo2nix.adoc
+++ b/src/content/blog/2020/10/05/cargo2nix.adoc
@@ -60,7 +60,7 @@ internal to Cargo.
Try out the demo (also taken from the repo's README):
-[source,shell]
+[source,sh]
----
pushd "$(mktemp -d)"
wget -O- https://euandre.org/static/attachments/cargo2nix-demo.tar.gz |
diff --git a/src/content/blog/2020/10/05/swift2nix.adoc b/src/content/blog/2020/10/05/swift2nix.adoc
index 4e0ae36..ba0125f 100644
--- a/src/content/blog/2020/10/05/swift2nix.adoc
+++ b/src/content/blog/2020/10/05/swift2nix.adoc
@@ -15,6 +15,7 @@ I wrote a simple little tool called {swift2nix}[swift2nix] that allows you trick
Swift's package manager into assuming everything is set up. Here's the example
from swift2nix's README file:
+[source,nix]
----
let
niv-sources = import ./nix/sources.nix;
@@ -143,7 +144,7 @@ This is something that {node2nix}[node2nix] does right. It allows you to build
the Node.js environment to satisfy NPM, and you can keep using NPM for
everything else:
-[source,shell]
+[source,sh]
----
ln -s ${node2nix-package.shell.nodeDependencies}/lib/node_modules ./node_modules
npm test
@@ -165,7 +166,7 @@ nice-to-have.
swift2nix itself could provide an "easy" interface, something that allows you to
write:
-[source,shell]
+[source,sh]
----
nix-build -A swift2nix.release
nix-build -A swift2nix.test
diff --git a/src/content/blog/2020/11/14/local-first-review.adoc b/src/content/blog/2020/11/14/local-first-review.adoc
index 2a57664..f9dd4b0 100644
--- a/src/content/blog/2020/11/14/local-first-review.adoc
+++ b/src/content/blog/2020/11/14/local-first-review.adoc
@@ -46,7 +46,7 @@ ____
They give examples of artificial restrictions, like this artificial restriction
I've come up with:
-[source,bash]
+[source,sh]
----
#!/bin/sh
@@ -63,7 +63,7 @@ echo $((2 + 2))
Now when using this very useful program:
-[source,bash]
+[source,sh]
----
# today
$ ./useful-adder.sh
@@ -84,7 +84,7 @@ or similar restriction, and stopped working after days pass? Or what if the
programmer added a constant to make the development simpler, and this led to
unintentionally restricting the user?
-[source,bash]
+[source,sh]
----
# today
$ useful-program
diff --git a/src/content/blog/2021/01/26/remembering-ann.adoc b/src/content/blog/2021/01/26/remembering-ann.adoc
index 889683d..6786b3c 100644
--- a/src/content/blog/2021/01/26/remembering-ann.adoc
+++ b/src/content/blog/2021/01/26/remembering-ann.adoc
@@ -54,7 +54,7 @@ previous choices appear at the beginning.
Where you would do:
-[source,shell]
+[source,sh]
----
$ seq 5 | fzf
@@ -69,7 +69,7 @@ $ seq 5 | fzf
And every time get the same order of numbers, now you can write:
-[source,shell]
+[source,sh]
----
$ seq 5 | remembering -p seq-fzf -c fzf
@@ -85,7 +85,7 @@ $ seq 5 | remembering -p seq-fzf -c fzf
On the first run, everything is the same. If you picked 4 on the previous
example, the following run would be different:
-[source,shell]
+[source,sh]
----
$ seq 5 | remembering -p seq-fzf -c fzf
@@ -124,7 +124,7 @@ Here are some functions I wrote myself that you may find useful:
=== Run a command with fzf on `$PWD`
-[source,shellcheck]
+[source,sh]
----
f() {
profile="$f-shell-function(pwd | sed -e 's_/_-_g')"
@@ -148,7 +148,7 @@ profile allows it to not mix data for different repositories.
:pass: https://www.passwordstore.org/
-[source,shell]
+[source,sh]
----
choice="$(find "$HOME/.password-store" -type f | \
grep -Ev '(.git|.gpg-id)' | \
@@ -169,14 +169,14 @@ the contents of my {pass}[password store], with the entries ordered by usage.
Where I previously had:
-[source,shell]
+[source,sh]
----
exe=$(yeganesh -x) && exec $exe
----
Now I have:
-[source,shell]
+[source,sh]
----
exe=$(dmenu_path | remembering -p dmenu-exec -c dmenu) && exec $exe
----
@@ -187,7 +187,7 @@ If you don't have `dmenu_path`, you can get just the underlying `stest` tool
that looks at the executables available in your `$PATH`. Here's a juicy
one-liner to do it:
-[source,shell]
+[source,sh]
----
$ wget -O- https://dl.suckless.org/tools/dmenu-5.0.tar.gz | \
tar Ozxf - dmenu-5.0/arg.h dmenu-5.0/stest.c | \
@@ -198,7 +198,7 @@ $ wget -O- https://dl.suckless.org/tools/dmenu-5.0.tar.gz | \
With the `stest` utility you'll be able to list executables in your `$PATH` and
pipe them to dmenu or something else yourself:
-[source,shell]
+[source,sh]
----
$ (IFS=:; ./stest -flx $PATH;) | sort -u | remembering -p another-dmenu-exec -c dmenu | sh
----
diff --git a/src/content/blog/2021/02/17/fallible.adoc b/src/content/blog/2021/02/17/fallible.adoc
index f2aa333..1f2f641 100644
--- a/src/content/blog/2021/02/17/fallible.adoc
+++ b/src/content/blog/2021/02/17/fallible.adoc
@@ -265,7 +265,7 @@ int main() {
Compile with `-DFALLIBLE` and run {fallible-check}[`fallible-check.1`]:
-[source,shell]
+[source,sh]
----
$ c99 -DFALLIBLE -o leaky leaky.c -lfallible
$ fallible-check ./leaky
diff --git a/src/content/blog/2021/04/29/relational-review.adoc b/src/content/blog/2021/04/29/relational-review.adoc
index cb552c3..4b53737 100644
--- a/src/content/blog/2021/04/29/relational-review.adoc
+++ b/src/content/blog/2021/04/29/relational-review.adoc
@@ -89,6 +89,7 @@ FROM people employees
INNER JOIN people managers ON employees.manager_id = managers.id;
----
+[source,clojure]
----
;; create schema
#{{:db/ident :person/id
@@ -126,11 +127,12 @@ Both "Foo" and "Bar" are employees, and the data is normalized. SQL represents
data as tables, and Datomic as datoms, but relations could be derived from both,
which we could view as:
-....
+[source,sql]
+----
employee_name | manager_name
----------------------------
"Foo" | "Bar"
-....
+----
== Conclusion