-
Notifications
You must be signed in to change notification settings - Fork 2
/
fmlt.sh
executable file
·70 lines (49 loc) · 1.61 KB
/
fmlt.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
### Basic tools and configuration ###
sh main.sh
## ssh key pair
if [ ! -e ~/.ssh/id_rsa.pub ]
then
## Or better restore them from a back-up!
ssh-keygen -t rsa -C "facundo.munoz@cirad.fr" -b 4096
fi
## Dotfiles
# paste the contents of ~/.ssh/id_rsa.pub into https://gitlab.com/profile/keys
git clone git@gitlab.com:famuvie/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
git checkout fmlt
make stow-all # update all dotfiles with local versions (if there are) and make links
git checkout -- . # reset to dotfile versions in the repo
cd
### Restore personal settings from backup ###
sshfs 192.168.0.2: mnt
bkploc='~/mnt'
# Okular pdf annotations
# Going through Unison config profile
#cp -r $bkploc/.kde/share/apps/okular/* .kde/share/apps/okular/
# Calibre configuration
# Going through Unison config profile
#cp -r $bkploc/.config/calibre ~/.config
### eMail and firefox profiles
cp -r $bkploc/.thunderbird ~
cp -r $bkploc/.mozilla/firefox ~
### R library (and possibly other libs)
cp -r $bkploc/lib ~
### Virtualbox VMs
rsync -azv --progress 192.168.0.2:/media/facu/Toshiba1T/VirtualBox\ VMs ~
### ~/bin
#cp -r $bkploc/bin ~
## Better off, if $bkploc contains .thunderbird, .mozilla, lib and VirtualBox\ VMs
## just copy everything with
## the trailing slash is necessary to copy the hidden directories
## in part. do not use a * at the end, as it does not match .dirname
rsync -azv $bkploc/ ~
### Software not installed in main.sh ###
### Close connection
sudo umount mnt
## Restore Work folder from fmhm sync
mkdir Work
unison fmhm
## Setup hamster's time-tracking database
cd Work/logistica/Cirad/time-tracking
make