Day 039: Backups, Linux
Goals for today:
-
learn the number line on the keyboard
-
see what I want to do with my domains and projects
-
Finish my backup system, and do one big backup of everything
-
look at my steno thing and decide what I want to do with it
-
ssh keys for everything
-
finish the basic 3 stones game bot thing, especially the turns part
-
clean everything old and unneded from pchr8.net, to make backups easier and to save money
-
Download maximum audios and videos from my VK accounts
-
move my blog to jekyll?
Linux
Jekyll new post creation
Okay, the first nice thing that happened today is that I finally automated creating new Jekyll posts!
Behold create.sh
:
FILE=$(date +%Y-%m-%d)-day$(date +%j).markdown
DATE=$(date +%Y-%m-%d\ %H:%M:%S\ +0100)
echo "Creating file $FILE"
touch $FILE
echo "Adding stuff"
/bin/cat <<EOM >$FILE
---
layout: post
title: "Day $(date +%j)"
date: $DATE
categories: []
---
### Bash and zsh wildcards
From [this SO answer](https://serverfault.com/questions/47933/how-to-delete-all-hidden-files-and-directories-using-bash) I learned that bash and zsh treat wildcards differently:
> With zsh by default an empty wildcard match is treated as an error; whereas with bash it is simply passed unchanged. To make zsh behave the same way you can use the command unsetopt nomatch
## Stack
## DNB and Typing
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
[jekyll-docs]: https://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/
EOM
Bash backup scripts
And while we’re at it, here are some of my yesterday’s backup scripts:
echo "=== Backing up NFS... ==="
echo "= SQL... ="
name=$(date '+%Y%m%d_%H%M%S')
ssh pchr8_pchr8@ssh.phx.nearlyfreespeech.net "mysqldump --all-databases --user=XXX --password=XXX4 --host=XXX > pchr8_mysql_backup_$name.sql
echo "Moving it to its location..."
mv pchr8_mysql_backup_$name.sql ../all/pchr8/db
echo "SQL done."
#echo "Making a tar archive of everything..."
#ssh pchr8_pchr8@ssh.phx.nearlyfreespeech.net "cd /home/public; tar cf " > pchr8_mysql_backup_$name.sql
echo "starting backup!"
echo "Creating mysql dump:"
name=$(date '+%Y%m%d_%H%M%S')
mysqldump --all-databases >> "arith-mysql-$name.sql"
echo "created!"
echo "adding stuff to the borg thing"
borg create /path/to/backups/arith_borg_repo::arith_complete-$name /var/www arith-mysql-$name.sql /etc/apache2/
echo "creating archive"
tar cf arith_repo.tar.gz arith_borg_repo/
echo "archive created!"
Stack / Random
- Do this for my remappings instead of
xmodmap
- At the end of the day I should really make a more optimal search through this blog.
- Should I learn by heart the COICOP, just for fun? Memory palaces + anki?
DNB and Typing
Changed my startup xkb line to setxkbmap -option -option 'compose:rctrl, grp:rwin_toggle' umlauted,ruua
so I still get the right Shift which I can learn to use!
Also I really like typingclub.com, and the next couple of days will try to force myself to type right, with the correct Shift, without bottoming out my keys, and typing the numbers and special symbols without looking and with the right finger. Also not forgetting about posture and the right position of my hands.
Quotes
“I don’t count my situps, I only start counting when it starts hurting, when I feel pain, that’s when I start counting, cause that’s when it really counts.” -Muhammed Ali (As quoted by Arnold Schwarzenneger in his speech)
Also from that same speech:
People perform better when they have no safety net
English
Sedition is overt conduct, such as speech and organization, that tends toward insurrection against the established order.