In the middle of the desert you can say anything you want
Added bindsym $ms+Return exec ~/.local/kitty.app/bin/kitty to ~/.config/i3/config
kitty - the fast, featureful, GPU based terminal emulator — kitty 0.17.1 documentation is really awesome actually, and noticeably faster than any other terminals I’ve used.
TODO - read through the documentation linked above, esp wrt zooming and config.
<Ctrl+Shift+F2> opens the config file. In general I love everything about Kitti for now, in all the tiny little details.
Changes:
font_family FiraCode-Bold
font_size 10.0
cursor_blink_interval 0.5
scrollback_lines 5000
strip_trailing_spaces smart
background_image ~/test.png
background_image_layout tiled
background_tint 0.7
Waffle House Index - Wikipedia
If you get there and the Waffle House is closed? That’s really bad… — Craig Fugate, Former Head of the Federal Emergency Management Agency
Just wrote this and put it into ~/.local/share/qutebrowser/userscripts/yank.py.
This is an userscript that allows me to escape my only problematic markdown character (|) when copying with ym:
#!/usr/bin/python3
import os
title = os.environ['QUTE_TITLE']
title = title.replace("|", "\\|")
url = os.environ['QUTE_URL']
with open(os.environ['QUTE_FIFO'], 'w') as f:
f.write("yank inline \"[{}]({})\"".format(title, url))
Added config.bind('ym', 'spawn --userscript yank.py') to config.py
Why did I need to use with open(..) as f: in the above script and couldn’t just do os.environ['sth']='sth else'?
It took seeing qutebrowser/taskadd at master · qutebrowser/qutebrowser to learn that you can annotate tasks in taskwarrior! task 123 annotate my annotation that can be long adds a visible line with the annotation under the task that is shown whenever the task is shown. This is awesome and I should read manpages sometimes.
I should finally put it in order, especially given that I mostly don’t use the left-hand part of the left-hand typing layout, I started today by putting my ` and ~ no LALT+SHIFT+apostrophe by adding this:
key <AD01> { [ apostrophe,!quotedbl, grave, asciitilde] };
to /usr/share/X11/xkb/symbols/v4
{%raw%}{{=}}{%endraw%} templateUsing Template:= - Wikipedia as an example, I created a page located at = - Fiamma which I can include as {%raw%}{{=}}{%endraw%} to replace URIs in parameters in my Template:B - Fiamma template. I’m not sure how would I edit all pages containing equal signs in parameters but this is a nice start. My source is Help:Template - Wikipedia, first bullet point.
Same works for |, for which there’s already the default template {%raw%}{{!}}{%endraw%}.
The old venerable bookmarklets I wrote about here Updated Fiamma “Add link” bookmarklet (now there are two of them!) | Я сам, соломка, чай. are as dead as it gets, I’ll write one userscript to rule them all :) Or one userscript and one vim script to expand it.
Current iteration is:
#!/usr/bin/python3
import os
from urllib.parse import quote_plus
def urlencode(string):
return quote_plus(string)
def replace(original):
new = original.replace("|", "-")
return new
title = os.environ['QUTE_TITLE']
url = os.environ['QUTE_URL']
newTitle = replace(title)
newUrl = replace(url)
et = urlencode(newTitle)
eu = urlencode(newUrl)
fiammaUrl = 'https://pchr8.net/f/index.php'
url = fiammaUrl+'?title='+et+'&action=edit&preload=Template:NewLink&preloadparams[]='+eu+'&preloadparams[]='+et
with open(os.environ['QUTE_FIFO'], 'w') as f:
f.write("open -w {}".format(url))
Pages to test this on:
I had issues with commands executing too early, for example before the previous one has executed. So:
config.bind('B', 'spawn --userscript open_fiamma_page.py')
config.bind('T', 'hint inputs --first;; later 20 leave-mode;; later 20 open-editor')
Lastly for some reason the “later” sometimes are interpreted as starting at the same time, not from the time the last command finished executing.
(sorry)
{%raw%}
" let @H = 'gg??c??bi??c??b{{B|^[^[^[j0i|^[^[^[ji|j?kb^[^[^[ji|^[^[^[o}};q' " For the 5 lines
" let @L = 'ji{{$?kb%?kb#set:\^Mk=?kD^[o|+sep=,}}^[' " For the tags
" let @C = 'i[[C;tj?kb?kb?kbategory: ^[^[^[A]];q' " For each individual category
" let @F = 'jjVG:norm! @C\^M' "Apply that to all lines till the end
" let @d = '@H@L@F'
" let @q = '^[A^[bbbbbbi|??^B?kb^[:%s/=/{{=}}/ge^M'
" Summed up:
let @C = 'i[[C;tj?kb?kb?kbategory: ^[^[^[A]];q' " For each individual category
let @H = '^[A^[bbbbbbi|??^B?kb^[:%s/=/{{=}}/ge^Mgg??c??bi??c??b{{B|^[^[^[j0i|^[^[^[ji|j?kb^[^[^[ji|^[^[^[o}};qji{{$?kb%?kb#set:^Mk=?kD^[o|+sep=,}}^[jjVG:norm! @C^M:x^M'
" let @d = '@H@L@F'
{%endraw%}
The above changes text like:
https://www.pchr8.net/d/dtb/
Diensttagebuch - A purely technical blog about things I did on particular days, for future reference and search.
5
tag1, tag tag2, tag3
Cat1
Cat2
And a category with space
to
{%raw%}
{{B|https://www.pchr8.net/d/dtb/
|Diensttagebuch - A purely technical blog about things I did on particular days, for future reference and search.
|5
|6
}}
{{#set:
k=tag1, tag tag2, tag3
|+sep=, }}
[[Category: Cat1]]
[[Category: Cat2]]
[[Category: And a category with space]]
{%endraw%}
For the above, jekyll had issues with utf-8 encoding and the escaped characters, so I copy-pasted them with my mouse from my terminal.
Additionally it converts the equal sign to its template, and saves-and-closes gvim.
… And with the glorious new page Waffle House Index - Wikipedia - Fiamma a new era for that wiki starts again!
This raises the question about what is the role of this blog, but I think here we’ll stick to IT stuff
..especially when writing macros that replace stuff.
The magic is the e option at the end:
:%s/x/y/ge
And the vim macro / script doesn’t break anymore.
Added some things to the concat.sh script, it’s even more ugly now but the resulting page is okay:
{% raw %}
echo "Concatting all existing days"
cd _posts
echo \
"---
layout: page
title: Master file
permalink: /master/
---
"\
> ../master_file.md
cat * | grep -v "layout: post" | grep -v "categories: \[" | grep -v "title: \"Day" | grep -v "date: 20" | grep -v "\-\-\-" >> ../master_file.md
{% endraw %}
Why do color TVs make black and white snow? | Hacker News
The other question is “why don’t you see that noise when the TV is tuned in?” The TV has automatic gain control. When the signal is weak, it will amplify it up to the right level. If the signal is just background noise, then it will amplify that background noise until it’s at the “right level” for a proper TV signal. So, the gain is lower for stronger signals, and very high when there is no signal at all.
the artefacts created in the black and white picture by the colour signal are hardly noticeable, but they are enough to recover the colour from a black and white recording! The Unofficial Colour Recovery Wiki | Fandom
Programmer Competency Matrix – Sijin Joseph, I don’t agree with everything but looks like a nice blueprint
Picture from xkcd what-if 0034 found on this article about evaluating LMs: Evaluation Metrics for Language Modeling and hotlinked from what-if 0034.
Added to config.py:
c.tabs.pinned.frozen = False
c.tabs.title.format_pinned = "{current_title}"
Cabinfever is der Lagerkoller.
My favourite corona-Dashboard has a nice new option to “align by date of 100th case”: Coronavirus charts
It looks like this today:
Changed the font from Fira Code Light to Fira Code Medium (EDIT: now Bold. True-bold text still gets rendered as extra-bold, which is very nice too!). It works much better on not-bright-enough screens that stand in front of too-bright windows.
I could not save a Tensorflow Keras model, the issue was that I passed arguments from init as: self.whatever = whatever, then changed self.whatever to a different data type (string to b’ytes’ w/ .encode in my case), then in the get_config() function then I happily said {'whatever': self.whatever,} which then could not be encode()’d.
Granular convection - Wikipedia is the process where biggerr parts of something float above when surrounded by smaller parts of something and vibration.
I’m not sure this is the place for this (oh wait, my blog, I decide the rules, it is now), but since the universe is interesting right now, I feel like preserving some parts. Not necessarily like a diary, just links that I feel will represent this interesting time better than many words could.
This is very nice and concise: Setup SSH keys for use with GitHub/GitLab/BitBucket etc, along with this series: Generating a new SSH key and adding it to the ssh-agent - GitHub Help
TL;DR generate a key, add it to Github, add it to the ssh-agent as
$ eval "$(ssh-agent -s)"
> Agent pid 59566
$ ssh-add ~/.ssh/id_rsa
Test the results as
→ ssh -T git@github.com
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
If the key is in a non-default location, Host github.com HostName github.com User jaeaess IdentityFile ~/.ssh/id_rsa_github_jaeaess is needed in the ~/.ssh/config file.
To push without being asked for passwords, the remote needs to be changed from HTTPS to SSH:
$ git remote remove origin
$ git remote add origin git@github.com:AquilineAdaeze/gitformyMac.git
Since it doesn’t seem to be persistent, the unsafe way (even though it’s considered unsafe in general) is to add ssh-add -q ~/.ssh/id_rsa_github to startup.
To copy absolute path of a file, Ctrl+Shift+C works.
Very interesting discussion: Loading a trained model, popping the last two layers, and then saving it · Issue #8772 · keras-team/keras
For the Sequential model, model.pop() also exists but not for the Functional one.
For a Functional model, after getting a model from an .h5 file, we can do things such as:
new_model = Model(model.inputs, model.layers[-3].output)
Very nice R-centric explanation, but should be valid for Python too: Saving and serializing models
A subclassed model differs in that it’s not a data structure, it’s a piece of code. The architecture of the model is defined via the body of the call method. This means that the architecture of the model cannot be safely serialized. To load a model, you’ll need to have access to the code that created it (the code of the model subclass). Alternatively, you could be serializing this code as bytecode (e.g. via pickling), but that’s unsafe and generally not portable.
Why am I getting wildly different accuracies and losses after loading the model from .h5 file, when model.weights for both are identical and predictions (using model.predict()) too? This probably has something to do with me misunderstanding datasets, how exactly?
tab-give keybindingAdded config.bind('tg', 'set-cmd-text -s :tab-give') to qutebrowser config.py. set-cmd-text is nice, -s means add space to the end, and now I know more about qutebrowser modes in general - for example, I can do keybindings even while I’m inserting a :command. The further it goes the more I love qutebrowser.
Debug tool window - Help | IntelliJ IDEA
If I click and the Debugger pane disappears, Alt+5 makes it appear again in the previous state.
cat compressed files with zcatThis is very nice: zcat auth.log.3.gz
lenovo - 18.10: how to set system default webcam? - Ask Ubuntu
mv /dev/video0 /dev/video0.original
ln -s /dev/video2 /dev/video0
How to Make Yourself Into a Learning Machine - Superorganizers - fascinating practical use of the Zettelkasten method, amongst other things - don’t have time for this now but I will read it later. + Using Anki to Remember Everything You Read | Hacker News as my source.
Adding to this:
ym that automatically escapes things like |Everytime I call model.fit() it does NOT reset the weights, DOES reset the hidden states (such as RNN/LSTM), does NOT reset optimizer settings. machine learning - keras.fit() re-initialises the weights - Stack Overflow
If I want to reset them, keras.backend.clear_session() should clear the info from the previous model.
Geburtsname: Vorname oder Nachname - Das versteht man darunter - FOCUS Online
Müssen Sie in einem Formular Ihren Geburtsnamen angeben, handelt es sich um Ihren Nachnamen, den Sie bei Ihrer Geburt erhalten haben. Sofern Sie nicht geheiratet und den Namen Ihres Ehemanns oder Ihrer Ehefrau angenommen oder eine Namensänderung beantragt haben, können Sie hier Ihren aktuellen Nachnamen angeben.
[ $[$RANDOM % 10] = 0 ] && do_this || do_that “s gives roughly a 1 in 10 chance of do_this running, and a 9 in 10 chance of do_that running. You can omit || do_that to just have a 10 percent chance of do_this running.” (seen here: Clear Your Terminal in Style - Adam.)
The vim vim-easymotion plugin (easymotion/vim-easymotion: Vim motions on speed!) also works in select/visual mode!
EDIT: there’s an intellij idea plugin! Just wow
I’m very very very glad about this, this is one thing that I missed from vim! AlexPl292/IdeaVim-EasyMotion: EasyMotion emulation plugin for IdeaVim
To activate I had to add set easymotion after setting the leader key in .ideavimrc.
I just to not-forget about it.