In the middle of the desert you can say anything you want
I’m very impressed by it! Makes everything really easy, I remember the last time I had to install stuff manually. After 48h 9/10, some things surprised me (removing root ssh access…) but they were always mentioned in the relevant docu I hadn’t read.
Official docu is quite okay, but rarely appeared when I was googling my problems. My instinct is to Google the problem instantly - sometimes they should actually be to find and check any existing official documentation/README first, then google. (An even better instinct would be to skim any official documentation before starting, as religiously as I do it for unknown real-life 3D things.)
This took me too long to find, has info about correct DNS records: DNS and subdomains for the applications | Yunohost Documentation
By trial and error the complete process is:
@ A XYZ.XYZ.XYZ.XYZ
@ AAAA 1234:1234:1234:FFAA:FFAA:FFAA:FFAA:AAFF
* CNAME mydomain.com.
agenda CNAME mydomain.com.
blog CNAME mydomain.com.
rss CNAME mydomain.com.
subdomain.my.domain
) as it if were newI kept messing up NAME and DATA of the CNAME records because I was following more the other ones Yunohost created, a row of
Name: xmpp-upload.my.domain
Data: @
For subdomainname.my.domain I needed this (kinda-sorta-reversed from the above; as usual, dots are significant):
Name: my.domain.
Data: subdomainname
cfonts is like figlet, but with many more settings (colors and alignment blew my mind!)! Link has a lot of colorful examples. I might get a nice colorful motd and/or banner soon. :)
There’s a command for that: hostnamectl set-hostname new-hostname
~/.local/bin
I like the idea of having ~/.local/bin
in my $PATH
, and putting there symbolic links (ln -s TARGET LINK
) to my usual folder where I have programs/executables. I’d even have a separate thing in $PATH
for shell scripts and binaries, which will get rid of so many stupid CLI aliases I have whose function is to point to a single executable with a long path.
TODO - look at my aliases and commands I run often and see how many of them can I symlink
~/.timewarrior/
and similar foldersHad always problems with umlauts etc, looked at the source, changed #!/usr/bin/env python
to #!/usr/bin/env python3
- now it works! Wanted to do a pull request, but it’s fixed on github master1, the apt repo has an older version as it often does.
.. As expected. git clone git@what:ever outputdirectory
. git clone git@what:ever .
works.
New domain, yay! I’ll slowly move stuff there, starting with this diensttagebuch.
.git/config
I wanted to set up two remotes, so that the dtb deploy.sh
script after building the html & rsync-ing would push it to both the github dtb repo and my own.
Followed this basically (except that I had deleted origin
by error in the process, so recreated it back again and added both remotes to it so I’ll still be able to do git push origin master
): How to push to multiple git remotes at once. Useful if you keep mirrors of your repo..
Mostly copying from there, changing/sanitizing some of my configs:
# Assume the git repost are set up like this
git remote add github git@github.com:muccg/my-project.git #this is the one "origin" pointed to to
git remote add bb git@bitbucket.org:ccgmurdoch/my-project.git
# Add to origin two remote urls for push
git remote set-url --add --push origin git@github.com:muccg/my-project.git
git remote set-url --add --push origin git@bitbucket.org:ccgmurdoch/my-project.git
# Look at the result
git remote show origin
which outputs this:
> git remote show origin
* remote origin
Fetch URL: git@github.com:pchr8/my-project.git
Push URL: git@bitbucket.org:pchr8/my-project.git
Push URL: git@github.com:pchr8/my-project.git
HEAD branch: master
Mentioned in the comments, it works, but has to be done twice of as it seems to rewrite the original remote: git remote set-url --add --push origin <...>
But maybe the most interesting thing there is .git/config
! I didn’t know it existed, it shows most of the same things but much easier to read/edit! It currently shows something like this:
> cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[branch "master"]
[user]
email = me@me.me
name = SH
[remote "bb"]
url = git@bitbucket.org:pchr8/my-project.git
fetch = +refs/heads/*:refs/remotes/bb/*
pushurl = git@bitbucket.org:pchr8/my-project.git
[remote "github"]
url = git@github.com:pchr8/my-project.git
fetch = +refs/heads/*:refs/remotes/github/*
pushurl = git@github.com:pchr8/my-project.git
[remote "origin"]
url = git@github.com:pchr8/my-project.git
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = git@bitbucket.org:pchr8/my-project.git
pushurl = git@github.com:pchr8/my-project.git
Adding the RedirectPermanent lines to .htaccess
in the root of pchr8.net, that now contains the following:
ErrorDocument 404 /404.html
ErrorDocument 403 /404.html
ErrorDocument 500 /500.html
RewriteRule ^wiki/(.*)$ /f/$1 [R=301,NC,L]
RewriteRule ^fiamma/(.*)$ /f/$1 [R=301,NC,L]
RedirectPermanent /d/dtb https://serhii.net/dtb
RedirectPermanent /blog https://serhii.net/blog
Experimenting with rewriting everything except /f/
, seems to work except for the main page https://www.pchr8.net/f/index.php/Pchr8.net_wiki_thing
RewriteEngine on
#RewriteRule (f) - [L]
RewriteCond %{REQUEST_URI} !^/f
RewriteRule (.*) https://serhii.net/$1 [R=301,L]
It gets redirected to serhii.net - maybe it chokes on the many weird characters or the repeat of pchr8.net?..
As per nfs docs 2, it’s very easily done just by running YourPrompt> tls-setup.sh
, and nfs takes care of all autorenewals, automatically sets up redirects etc. Awesome!
utimer
can do a countdown, count-..up?, and can work as a stopwatch. It outputs time remaining too.
A pizza dough recipe3 reminded me that
I have my vim macro for footnotes where it creates the [^..]
things and then I paste the URI manually, but what I’d actually like is something that automatically creates a footnote at current cursor position, and as content uses the URI currently in the clipboard register! TODO
(And also try to make it readable/interpretable this time)
To create a subdomain, you have to add it as “new” new domain and it takes care of everything, no magic with DNS records needed
Changed the zsh alias for it:
s () {task s project.not:w sprint.not:s "$*"}
Now on my non-work account, it shows non-work tasks from any sprint except “s” (which is a proxy of due:someday
).
Foreign Words (Fremdwörter) - really nice! Has specific suffixes and what genders they create in German. In general - I remember that excellent website.
Also: “das Thema, die Themen”) - which plural rule is that? TODO
Given that I need to push/pull it a lot now, I should exclude the generated .html files in .gitignore
W
opens the last closed window! … on the topic of ’learn well the tools you use daily'
Installed ding
! Still remains the best dictionary program ever.
ding buch
works!
TODO - add keybinding to search for currently selected word. Or a basic prompt to quickly look for words, a la dtb - and that ideally adds the needed words to a list, and maybe even generates anki flashcards from them!
ding -m
to start it minimally, likely make it floating for i3 by class, is a really nice start. Added this to config:
## Ding float
bindsym $ms+Shift+d exec ding -m
for_window [class="Ding"] floating enable
(got class from xprop
)
If default automatic settings are too strong, these work well: redshift -xO 2500 -b 0.7
Couldn’t load noisetorch, error 127 when attempting to get the needed privileges. The help of Noisetorch said this means pksudo
doesn’t work, and to fix this. After some googling, found a solution:
apt install policykit-1-gnome
Then add
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &
to your autostart configuration. 1
According to the docu it should be this, not working for me:
plt.ion()
Somehow it magically worked before without any changes from my side actually. Anyway, this1 worked:
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
I can’t start everything from within i3 config. keynav
doesn’t work (though it’s running), and compton creates a black strip in the bottom monitor when started as exec compton
via i3. Though executing a startup script from within i3, a script starting everything else I need, somehow works. I remember dealing with this in the past, and this created the current chaotic setup.
Startup script (./s/s.sh
)
:
setxkbmap -option -option 'grp:rctrl_toggle, compose:rwin, compose:paus' v5,ruua
xmodmap ~/s/mod4
xcape -e 'Control_L=Escape' -t 100
autorandr -l home
feh --bg-center ~/s/bg.jpg ~/s/bg.jpg
compton
keynav
i3 config startup script:
exec ~/s/s.sh
exec --no-startup-id redshift
exec --no-startup-id nm-applet
I had this, but it started too often by error.
:W sudo saves the file
" command W w !sudo tee % > /dev/null
Added this in a modified sh-trapd00r theme:
dir_status="%{$c1%}%* %B%7c/ %?"
PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${ret_status}%{$reset_color%}
%{$fg_bold[green]%}> %{$reset_color%}'
loginctl
as a way to manage sessions of logged in usersInstead of killing all processes belonging to someone, loginctl
will return all sessions, and loginctl kill-session $number
will log the user off!
Set my old Lain background with feh. I should look at some of my old i3 settings etc, to make it look different from the work one.
tmux
or screen
well
vim
much better
w/E
etcxinput float ..
)arandr
-ing every time(was curious about the name of a PPA)
Test config file:
displays:
- name: eDP-1
workspaces: [1, 0]
randr_extra_options: "--primary --mode 2560x1440"
- name: HDMI-2
workspaces: [2, 3, 4]
randr_extra_options: "--above eDP-1"
This is even better than the above: phillipberndt/autorandr: Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
It saves configs readably and automatically to ~/.config/autorandr/config
Very simple config:
gaps inner 10
gaps outer 10
Installed compton
to get transparent terminals.
Added this to kitty config:
background_opacity 0.8
When using public key and ssh for git, when you can’t use ssh-add ...
, this works:
GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example" git clone example
3
I can happily use plt.plot()
/plt.imshow()
inside the <Alt-F8>
and debugger console windows, it’ll be shown!
Replace -user root
with source user, $USER
expands to user currently running command:
sudo find ~ -type d -user root -exec sudo chown -R $USER: {} +
In line with Day 784 about unmounting broken endpoints, yesterday I got a lot of errors (thunar
didn’t start, I blamed memory, but df -h
also didn’t start…), at the end the issue was with a sshfs directory:
fuse: bad mount point
./mountpoint’: Transport endpoint is not connected`
Using day 784 didn’t help, still got the above error. This helped:
fusermount -uz myserver
Also, TODO: Why doesn’t linking stuff like this work?
{%raw%}
[Day 784]({% post_url 2021-02-23-day784.markdown %})
{%endraw%}
a is True
is false for a numpy array of one element a
, even if it’s value is True. a == True
works correctly. Why does this happen?
You can use the console not just to look for output, but to interact with the variables etc! Why didn’t I think of this before: Using Debug Console | PyCharm
I like giving code examples in C++, Java and Python for the same help topic! OpenCV: Creating Bounding boxes and circles for contours
(22:31:53/11773)~/$ xinput list-props 15
Device 'SynPS/2 Synaptics TouchPad':
Device Enabled (170): 1
Coordinate Transformation Matrix (172): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (304): 1
Device Accel Constant Deceleration (305): 2.500000
Device Accel Adaptive Deceleration (306): 1.000000
Device Accel Velocity Scaling (307): 12.500000
Synaptics Edges (327): 1574, 5368, 1408, 4444
Synaptics Finger (328): 25, 30, 0
Synaptics Tap Time (329): 180
Synaptics Tap Move (330): 248
Synaptics Tap Durations (331): 180, 180, 100
Synaptics ClickPad (332): 1
Synaptics Middle Button Timeout (333): 0
Synaptics Two-Finger Pressure (334): 282
Synaptics Two-Finger Width (335): 7
Synaptics Scrolling Distance (336): 112, 112
Synaptics Edge Scrolling (337): 1, 0, 0
Synaptics Two-Finger Scrolling (338): 1, 0
Synaptics Move Speed (339): 1.000000, 1.750000, 0.035417, 0.000000
Synaptics Off (340): 0
Synaptics Locked Drags (341): 0
Synaptics Locked Drags Timeout (342): 5000
Synaptics Tap Action (343): 2, 3, 0, 0, 1, 3, 0
Synaptics Click Action (344): 1, 3, 0
Synaptics Circular Scrolling (345): 0
Synaptics Circular Scrolling Distance (346): 0.100000
Synaptics Circular Scrolling Trigger (347): 0
Synaptics Circular Pad (348): 0
Synaptics Palm Detection (349): 0
Synaptics Palm Dimensions (350): 10, 200
Synaptics Coasting Speed (351): 20.000000, 50.000000
Synaptics Pressure Motion (352): 30, 160
Synaptics Pressure Motion Factor (353): 1.000000, 1.000000
Synaptics Resolution Detect (354): 1
Synaptics Grab Event Device (355): 0
Synaptics Gestures (356): 1
Synaptics Capabilities (357): 1, 0, 0, 1, 1, 1, 1
Synaptics Pad Resolution (358): 54, 45
Synaptics Area (359): 0, 0, 0, 0
Synaptics Soft Button Areas (360): 3471, 0, 4054, 0, 0, 0, 0, 0
Synaptics Noise Cancellation (361): 28, 28
Device Product ID (297): 2, 7
Device Node (296): "/dev/input/event5"
(22:31:59/11774)~/$ xinput set-prop 15 349 1