serhii.net

In the middle of the desert you can say anything you want

09 Apr 2021

Day 829

VPS plans

  • Taskwarrior sync
  • git for ~/.timewarrior/ and similar folders
  • git for dotfiles
  • Some basic automated backups of small important things
  • Possibly some Telegram bots will live there
  • CalDAV & Contacts sync - both for sync and for backups
  • Possibly self-hosted password management?

Timewarrior on-modify hook for taskwarrior

Had 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.

git clone to different directory

.. As expected. git clone git@what:ever outputdirectory. git clone git@what:ever . works.

Setting up serhii.net

New domain, yay! I’ll slowly move stuff there, starting with this diensttagebuch.

Setting up multiple remotes in github + .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

Creating redirects to new website

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?..

Setting up HTTPS/TLS for serhii.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

utimer can do a countdown, count-..up?, and can work as a stopwatch. It outputs time remaining too.

English

A pizza dough recipe3 reminded me that

DTB/markdown/footnotes/macro improvement idea

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)

Yunohost

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

Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus