# Linux

# Backup and Restore Ubuntu based systems

Use apt-clone, deja-dup and some shell scripts to backup and restore ubuntu based systems:

Requirements: 
 * Deja-Dup
 * duplicity as a terminal command, if you want to restore that way.

## Backup

```
sudo apt install apt-clone
mkdir ~/backup
cd ~/backup
sudo apt-clone clone apt-clone-state-ubuntu-$(lsb_release -sr)-$(date +%F).tar.gz
flatpak list --columns=application --app | tee flatpak.lst

# backup /etc
sudo apt install etckeeper
sudo etckeeper vcs remote add origin $GITHUB_URL
sudo etckeeper vcs push
```

Run DejaDup and store the backup in ~/backup/dejadup in this example.


You can probably also run DejaDup to restore into a folder somewhere, instead of using duplicity below.

## Restore
```
cd ~/backup
sudo apt-clone restore apt-clone-state-ubuntu-$(lsb_release -sr)-$(date +%F).tar.gz
xargs flatpak install < flatpak.lst

sudo su
# change myuser
PASSPHRASE="" duplicity restore file:///home/myuser/backup/dejadup /root/restore
cp -r /root/restore/home/myuser/. /home/myuser
chown myuser:myuser /home/myuser -R

# etc (unverified)
cd /tmp
git clone $GITHUB_URL etc.new
sudo mv /etc /tmp/etc.old
sudo mv /tmp/etc.new /etc
```

Now reboot

# Elementary OS Configuration and Setup

## ElementaryOS 7 Horus

* Same wifi issue as [[OpenSUSE Tumbleweed]]. Same fix
* Mouse battery is seen as laptop battery, so battery power options apply.
* Zoom is fixed and keeps settings!

### Grub has no timeout

```shell
$ sudo nano /etc/default/grub
GRUB_TIMEOUT=5
```

### PHPenv

Use native PHP packages and my [PHP activate](https://github.com/svandragt/php-activate)

### iCloud contacts and calendar
https://ekiwi-blog.de/en/26497/synchronize-icloud-calendar-and-contacts-with-thunderbird/ TLDR TBSync with an application specific password.

### Media keys on macintosh keyboard
 1. if you press Fn+Esc it changes the `Fn lock` so that F1+F12 work as normal.
 2. For an untested permanent solution [try remapping](https://askubuntu.com/a/1201287/32058)

### Google Calendar integration

```
sudo apt install gnome-control-center gnome-online-accounts
Exec=env XDG_CURRENT_DESKTOP=GNOME gnome-control-center --overview
```

Enable Google Account and it's Calendar



### Assign Eject to Multitasking view:

https://vandragt.com/map-eject-to-multitasking-view

> So I use ElementaryOS and in version 7 you are no longer able to map  just the Eject key. I like to map this to the Multitasking View  (something like the macOS Expose).
>
> The solution is to use the DConf Editor application and search for `show-desktop`. [ElementaryOS repurposes the show desktop to the multitasking view](https://github.com/elementary/shortcut-overlay/blob/8a88249e5775f9727927dc9bd7ebb6547bd3bc56/src/Views/ShortcutsView.vala#L60-L61). Simply set the value to `['Eject']`



## ElementaryOS 6

### B560 
Does not find wireless until Linux-firmware is installed. Use Ethernet and dist-upgrade followed by install Linux-firmware

### Other 
Do not install the following packages via apt, as you want to control when to update them: 

* virtualbox
* composer (apt version doesn't self-update)
* php
* added by working copy ❤️

## Macos Migration
- [x] todolist ios/linux:
  - [x] Workflowy.com  for work
  - [x] Todoist for personal.
- [x] Notes
   - [x] Workflowy
   - [x] Bookstack hosted
- [ ] deejay program 
	- [ ] traktor over wine, try that
- [ ] Some alternative to Acorn if needed
  - [ ] krita
- [x] Better clipboard monitor
  - [x] CopyQ is ok
- [x] Screen recorder
  - [ ] SimpleScreenRecorder (Screen recording)
  - [ ] Handbrake (video conversion)
  - [ ] https://github.com/flameshot-org/flameshot (Screenshots)
  - [ ] and https://gitlab.gnome.org/YaLTeR/video-trimmer For trimming videos
- [x] auto updates
   - [x] flatpak: https://www.jwillikers.com/automate-flatpak-updates-with-systemd
   - [x] https://wiki.debian.org/UnattendedUpgrades
   - [x] https://gist.github.com/svandragt/9776828a64d6eba0f19dfd604fbbd94e running this manually once a day.
- [x] Webcam
	- [x] Logitech C922 Pro works well and is compatible

### Essential apps

```shell
sudo apt install gnome-system-monitor
```


### Keyboard
* fn + arrow keys for start/end of line and pageup/down


### Change shell
```shell
sudo apt install zsh
# TODO steps to configure it
chsh -s $(which zsh)
```

# Time Since Last Resume

This has been moved to [https://github.com/svandragt/break-aware](https://github.com/svandragt/break-aware)