In the middle of the desert you can say anything you want
For yay, the cache is in
$HOME/.cache/yay/
If the package is there, then:
sudo pacman -U ./quarto-cli-1.4.555-1-x86_64.pkg.tar.zst
Then pin the package in /etc/pacman.conf:
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
IgnorePkg = quarto-cli
#IgnoreGroup =
Then yay -Syu
will ignore it as well:
:: Synchronizing package databases...
endeavouros is up to date
core is up to date
extra is up to date
multilib is up to date
:: Searching AUR for updates...
-> quarto-cli: ignoring package upgrade (1.4.555-1 => 1.5.52-1)
:: Searching databases for updates...
there is nothing to do
Refs: How do you downgrade an AUR package? : r/archlinux
For not-AUR, there’s the downgrade
command: archlinux-downgrade/downgrade: Downgrade packages in Arch Linux
For later.
Download GitHub directory: paste an URI to the directory, get .zip of that directory only. Handy for downloading only parts of datasets
training/patient101/
containing
segmentation.nii.gz
is the ground truth as used in the challenge, after postprocessing, the one we need.[kidney|tumor|cyst]_instance-[1|2|..?]_annotation-[1|2|3].nii.gz
test set unreleased: How to Obtain Test Data in the KiTS23 Dataset? - KiTS Challenge ↩︎
↩︎It’s important to note the distinction between what we call “annotations” and what we call “segmentations”. We use “annotations” to refer to the raw vectorized interactions that the user generates during an annotation session. A “segmentation,” on the other hand, refers to the rasterized output of a postprocessing script that uses “annotations” to define regions of interest.[^kits2023]
TL;DR use Chromium
PDF, PS and DjVu - ArchWiki has a table, but it lies, in my tests:
And for the Nth time, I end up remembering about Chrome/Chromium PDF viewer, that does this reliably.
sudo pacman -S cronie
sudo systemctl enable cronie.service
# many minutes were lost due to me forgetting to start it as well...
sudo systemctl start cronie.service
crontab -e
edits your own crontab, then you can omit the username.#!/bin/bash
# https://stackoverflow.com/posts/1482133/
# get the directory where this file is located
DIRNAME="$( dirname -- "$( readlink -f -- "$0"; )"; )"
cd $DIRNAME &&
git add -A &&
git commit -m "Automatic backup at `date`" &&
git push origin master &&
echo "Done"
# and this is the crontab
# odd hours:
# * 1-23/2 * * * /bin/bash $HOME/this-script-location.sh > /tmp/cronlog
EDIT: sometimes if git crashes an index file stays and then nothing runs — so the cronjob must be somehow monitored manually, todo.
TL;DR: fish easy version below works, but needs quotes when expression is complex: cc 2+2
but cc 'floor(2.3)'
.
I’m continuing to move my useful snippets from zsh to fish (240620-2109 Fish shell bits), and the most challenging one was the CLI python calculator I really love and depend on, since it contained arguments with parentheses (which are fish expressions as well).
Basically: cc WHATEVER
runs WHATEVER
inside python, can do both easy math a la 2+2
and more casual statistics-y mean([2,33,28])
.
Before in zsh this was the magic function:
cc() python3 -c "from math import *; from statistics import *; print($*);"
alias cc='noglob cc'
Fish, easy version:
function cc
command python3 -c "from math import *; from statistics import *; print($argv);"
end
Works for easy cc 2+2
bits, but as soon as functions and therefore parentheses get involved (cc floor(2.3)
) it starts to error out.
[I] sh@nebra~/t $ cc mean([2,4])
fish: Unknown command: '[2,4]'
in command substitution
fish: Unknown command
cc mean([2,4])
^~~~~~^
[I] sh@nebra~/t $ cc mean\([2,4]\)
>>> mean([2,4])
3
[I] sh@nebra~/t $
(But I REALLY don’t want to do cc mean\([2, 3]\)
)
In the zsh snippet, noglob
meant basically “take this literally w/o expanding anything”, and it passed everything as-is to python, and this is what fails in my fish solution.
Noglob in fish is fun:
If you wish to use arguments that may be expanded somehow literally, quote them. echo ‘’ and echo “” both will print the literal.
\'
for literals inside single$TERM
) & command substitution ($(command)
)
\"
for literal "
s inside doubleecho (ls)
= ls output, one lineecho "$(ls)"
= ls output, multilineecho '(ls)'
= (ls)
echo "(ls)"
= "(ls)"
THEN
command python3 -c "from math import *; from statistics import *; print($argv);"
cc ceil\(2\)
+cc ceil(2)
-`command python3 -c “from math import *; from statistics import *; print(’$argv’);”
OK can I do a variable then?
set pyc $argv
echo $pyc
command python3 -c "from math import *; from statistics import *; print($pyc);"
nope.
(and learning to use fish loops mainly, of course there are better ways to do this.)
# list of simple, brackets, and parentheses + no, single, double quotes
# no space between nums in brackets, python interpreter would add them. [2,3] — literal, [2, 3] — parsed by python
set cmds \
'2+2' \
'\'2+2\'' \
'"2+2"' \
'[2,3]' \
'\'[2,3]\'' \
'"[2,3]"' \
'floor(2.3)' \
'\'floor(2.3)\'' \
'"floor(2.3)"'
function tcc
set pyc $argv
# command python3 -c "from math import *; from statistics import *; print" '(' "$pyc" ');'
# command python3 -c "from math import *; from statistics import *; print($pyc);"
command python3 -c "from math import *; from statistics import *; print($pyc);"
end
# loop through all test cases to see sth that works for all
for i in $cmds
echo $i:
echo " $(tcc $i)"
end
At the end, no additional literal quotes + initial command didn’t error out, and we came full circle:
set cmds \
'2+2' \
'[2,3]' \
'floor(2.3)'
# winner command!
function tcc
command python3 -c "from math import *; from statistics import *; print($argv);"
end
[I] sh@nebra~/t $ ./test_cc.sh
2+2:
4
[2,3]:
[2, 3]
floor(2.3):
2
$pyc
gets expanded$pyc
in the working versions have no hard-coded quotestcc floor(2.3)
still fails — because like that it’s a command, not a string. In the file it was inside single quotes, as a string. So I can do this in the CLI as well.So simple and logical at the end.
function cc
echo ">>> $argv"
command python3 -c "from math import *; from statistics import *; print($argv);"
end
When using, quotes are needed only for complex bits (parentheses, *
etc.).
[I] sh@nebra~/t $ cc 2+2
>>> 2+2
4
[I] sh@nebra~/t $ cc [2,3,4]
>>> [2,3,4]
[2, 3, 4]
# no quotes
[I] sh@nebra~/t $ cc mean([2,3,4])
fish: Unknown command: '[2,3,4]'
in command substitution
fish: Unknown command
cc mean([2,3,4])
^~~~~~~~^
# with quotes
[I] sh@nebra~/t $ cc 'mean([2,3,4])'
>>> mean([2,3,4])
3
So I literally had to follow the advice from the first link I found and used single quotes in my initial command:
If you wish to use arguments that may be expanded somehow literally, quote them. echo ‘’ and echo “” both will print the literal.
Still, I learned a lot about fish in the process and honestly am loving it.
In my old zsh config I had this:
function dos() {
# run_disowned and silenced
nohup "$@" >/dev/null 2>&1 & disown
}
Emulating my old dos
command in fish:
firefox &; disown
starts and disowns ffx.Both together give this solution:
function dos
echo "disowning $argv"
command $argv >/dev/null 2>&1 &
disown
end
$(cmd)
shell - Fish equivalent of bash $(command) notation - Stack Overflow:
- bash: $(command)
- fish: (command)
which
commandtype - locate a command and describe its type — fish-shell 3.7.0 documentation:
type commandname
.
[I] sh@nebra~/me/me-qs $ type cc
cc is a function with definition
# Defined in /home/sh/.config/fish/config.fish @ line 184
function cc
echo ">>> $argv"
command python3 -c "from math import *; from statistics import *; print($argv);"
end
quarto render --no-clean ...
(or an interrupted render?) created many .html.md
files in the same dirs as their .qmd/.md sources:
papers/11-bank2011using/index.md papers/23-hanig2023nlp/index.md
papers/11-hanig2011benefits/index.html.md papers/23-tumler2023virtual/index.html.md
papers/11-hanig2011benefits/index.md papers/23-tumler2023virtual/index.md
papers/11-hanig2011knowledge/index.html.md papers/24-hamotskyi2024fincorpus/index.html.md
papers/
Then the custom listing for */*.md
went crazy because the html.md
files didn’t have the needed fields. (also .jsons/.html etc.)
Quarto has no quarto clean
but one can just re-render everything without --no-clean
To find all these files arbitrarily many levels deep:
ls **/*.html.md
When doing a multilingual quarto website using profiles (240619-1425 Quarto multilanguage website), quarto preview/render --profile de
allows previewing only one language, and the menu links (/de/xxx
) break.
Solution to preview EVERYTHING, including menu links logic:
# Todo break on erorr
quarto render --profile=ua
quarto render --profile=en
quarto render --profile=de
And then serve the _site
directory locally through a simple webserver, e.g.
Python SimpleHTTPServer - Python HTTP Server | DigitalOcean, and see the result on http://localhost:9000:
python3 -m http.server -d _site 9000