This repository was archived by the owner on Jun 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.json
More file actions
189 lines (182 loc) · 7.61 KB
/
config.json
File metadata and controls
189 lines (182 loc) · 7.61 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
{
"m": [
"[[ $(hostname) = main && -z $ignorehostname ]] || { echo wrong hostname; exit 1; }",
"cd ~/.config/backupscript/dotfiles.git || exit 1",
"git checkout main || exit 1",
"git rm -rf $(fd -H -E .git/ -d 1)",
"cp ../.gitignore .gitignore",
"mkdir -p .config/{npm,oni2} etc/{ssh,systemd/system} .ssh",
"crontab -l > cron",
"cp -f ~/.ssh/config .ssh",
"rsync -a --exclude-from ~/.config/.gitignore ~/.config/{.gitignore,zsh,nvim,screen,wget,python,user-dirs.dirs,mpv} .config",
"cp -r ~/.config/npm/npmrc .config/npm/",
"rsync -a --exclude 'gnupg*' /etc/{fstab,grub.d,pacman.conf,pacman.d} etc",
"cp /etc/ssh/{ssh,sshd}_config etc/ssh",
"cp /etc/systemd/system/{vnc,rclone-gdrive}.service etc/systemd/system",
"git add -A",
"bcommit",
"git push ${push:-} origin main"
],
"i": [
"# [[ $(hostname) = main && -z $ignorehostname ]] || { echo wrong hostname; exit 1; }",
"cd ~/.config/backupscript/dotfiles.git || exit 1",
"git checkout main || exit 1",
"git rm -rf $(fd -H -E .git/ -d 1)",
"cp ../.gitignore .gitignore",
"mkdir -p .config/npm",
"# crontab -l > cron",
"# cp -f ~/.ssh/config .ssh",
"rsync -a --exclude-from ~/.config/.gitignore ~/.config/{.gitignore,zsh,nvim,screen,wget,python,user-dirs.dirs} .config",
"cp -r ~/.config/npm/npmrc .config/npm/",
"git add -A",
"bcommit",
"git push ${push:-} origin main"
],
"l": [
"[[ $(hostname) = laptop && -z $ignorehostname ]] || { echo wrong hostname; exit 1; }",
"cd ~/.config/backupscript/dotfiles.git || exit 1",
"git checkout laptop || exit 1",
"git rm -rf $(fd -H -E .git/ -d 1)",
"cp ../.gitignore .gitignore",
"mkdir -p .config/npm etc/{ssh,systemd/system} .ssh",
"crontab -l > cron",
"cp -f ~/.ssh/config .ssh",
"rsync -a --exclude-from ~/.config/.gitignore ~/.config/{.gitignore,zsh,nvim,screen,wget,python,user-dirs.dirs,mpv} .config",
"cp -r ~/.config/npm/npmrc .config/npm/",
"rsync -a --exclude 'gnupg*' /etc/{fstab,grub.d,pacman.conf,pacman.d,nginx} etc",
"cp /etc/ssh/{ssh,sshd}_config etc/ssh",
"cp /etc/systemd/system/rclone-gdrive.service etc/systemd/system",
"git add -A",
"bcommit",
"git push ${push:-} origin laptop"
],
"u": [
"[[ $(hostname) = unowhy && -z $ignorehostname ]] || { echo wrong hostname; exit 1; }",
"cd ~/.config/backupscript/dotfiles.git || exit 1",
"git checkout unowhy || exit 1",
"git rm -rf $(fd -H -E .git/ -d 1)",
"cp ../.gitignore .gitignore",
"mkdir -p .config/npm etc/{ssh,systemd/system} .ssh",
"crontab -l > cron",
"cp -f ~/.ssh/config .ssh",
"rsync -a --exclude-from ~/.config/.gitignore ~/.config/{.gitignore,zsh,nvim,screen,wget,python,user-dirs.dirs,mpv} .config",
"cp -r ~/.config/npm/npmrc .config/npm/",
"rsync -a --exclude 'gnupg*' /etc/{fstab,grub.d,pacman.conf,pacman.d} etc",
"cp /etc/ssh/{ssh,sshd}_config etc/ssh",
"cp /etc/systemd/system/rclone-gdrive.service etc/systemd/system",
"git add -A",
"bcommit",
"git push ${push:-} origin unowhy"
],
"r": [
"[[ $(hostname) = raspberrypi && -z $ignorehostname ]] || { echo wrong hostname; exit 1; }",
"cd ~/.config/backupscript/dotfiles.git || exit 1",
"git checkout raspberrypi || exit 1",
"git rm -rf $(fd -H -E .git/ -d 1)",
"cp ../.gitignore .gitignore",
"mkdir -p .config/npm etc/{ssh,systemd/system} .ssh",
"crontab -l > cron",
"cp -f ~/.ssh/config .ssh/",
"cp /etc/systemd/system/updatefreedns.service etc/systemd/system",
"rsync -a --exclude-from ~/.config/.gitignore ~/.config/{.gitignore,zsh,nvim,screen,wget,python} .config",
"cp -r ~/.config/npm/npmrc .config/npm/",
"cp /etc/ssh/{ssh,sshd}_config etc/ssh",
"git add -A",
"git push ${push:-} origin raspberrypi"
],
"t": [
"[[ $(hostname) = tosh && -z $ignorehostname ]] || { echo wrong hostname; exit 1; }",
"cd ~/.config/backupscript/dotfiles.git || exit 1",
"git checkout tosh || exit 1",
"git rm -rf $(fd -H -E .git/ -d 1)",
"cp ../.gitignore .gitignore",
"mkdir -p .config/npm etc/{ssh,systemd/system} .ssh",
"crontab -l > cron",
"cp -f ~/.ssh/config .ssh/",
"cp -r /server/www .",
"cp /etc/systemd/system/{gitea,requestbin,updatefreedns,wssh,novnc}.service etc/systemd/system",
"rsync -a --exclude-from ~/.config/.gitignore ~/.config/{.gitignore,zsh,nvim,screen,wget,python,autostart-scripts} .config",
"cp -r ~/.config/npm/npmrc .config/npm/",
"cp /etc/ssh/{ssh,sshd}_config etc/ssh",
"rsync -a --exclude 'gnupg' /etc/{fstab,grub.d,pacman.conf,pacman.d,nginx} etc",
"git add -A",
"git push ${push:-} origin tosh"
],
"p": [
"[[ $(cat ~/../usr/etc/hostname) = phone && -z $ignorehostname ]] || { echo wrong hostname; exit 1; }",
"cd ~/.config/backupscript/dotfiles.git || exit 1",
"git checkout phone || exit 1",
"git rm -rf $(fd -H -E .git/ -d 1)",
"cp ../.gitignore .gitignore",
"mkdir -p .config/npm etc/{ssh,systemd/system} .ssh",
"cp -f ~/.ssh/config .ssh",
"rsync -a --exclude-from ~/.config/.gitignore ~/.config/{.gitignore,zsh,nvim,screen,wget,python} .config",
"cp -r ~/.config/npm/npmrc .config/npm/",
"cp ~/../usr/etc/ssh/{ssh,sshd}_config etc/ssh",
"cp -r ~/{.shortcuts,.termux} .",
"git add -A",
"bcommit",
"git push ${push:-} origin phone"
],
"df": [
"# [[ -d ~/.cache/dotfiles.git ]] || git clone -q git@github.com:mirsella/dotfiles.git ~/.cache/dotfiles.git",
"cd ~/.config/backupscript/dotfiles.git",
"git add -A",
"git stash",
"git checkout -q ${branch:-main} || exit 1",
"git fetch; git reset --hard FETCH_HEAD",
"rm -rf ~/.config/zsh.bak; mv ~/.config/{zsh,zsh.bak}",
"cp -r .config/{zsh,nvim,.gitignore,screen,mpv} ~/.config",
"cp -f .ssh/config ~/.ssh",
"hostname=$(hostname); b ${hostname:0:1}"
],
"dp": [
"cd ~/.config/backupscript/dotfiles.git",
"git checkout -q ${branch:-main} || exit 1",
"git pull",
"cp -r .config/{zsh,nvim,.gitignore,screen,mpv} ~/.config",
"cp -f .ssh/config ~/.ssh",
"hostname=$(hostname); b ${hostname:0:1}"
],
"script": [
"cd ~/.config/backupscript",
"git add -A",
"bcommit",
"git push ${push:-}"
],
"upscript": [
"cd ~/.config/backupscript || exit 1",
"# cp config.json config.json.bak",
"git fetch",
"git reset --hard FETCH_HEAD"
],
"clearcommit": [
"cd ~/.config/backupscript/dotfiles.git || exit 1",
"git checkout -q ${branch:-$(hostname)} || exit 1",
"git checkout --orphan ${branch:-$(hostname)}cleared",
"git add -A",
"bcommit 'cleared commit history'",
"git branch -D ${branch:-$(hostname)}",
"git branch -M ${branch:-$(hostname)}cleared $(cat /etc/hostname)",
"git push ${push:-} -f origin ${branch:-$(hostname)}"
],
"install": {
"script": [
"rm -rf ~/.config/backupscript",
"git clone https://github.com/mirsella/backupscript ~/.config/backupscript",
"cd ~/.config/backupscript",
"git remote set-url origin git@github.com:mirsella/backupscript",
"git clone https://github.com/mirsella/dotfiles ~/.config/backupscript/dotfiles.git",
"cd ~/.config/backupscript/dotfiles.git",
"git remote set-url origin git@github.com:mirsella/dotfiles",
"sudo ln -s ~/.config/backupscript/backupscript.sh /usr/bin/b"
],
"dotfiles" : [
"rm -rf ~/.cache/dotfiles.git",
"mv ~/.config/backupscript/dotfiles.git ~/.cache/",
"git clone https://github.com/mirsella/dotfiles ~/.config/backupscript/dotfiles.git",
"cd ~/.config/backupscript/dotfiles.git",
"git remote set-url origin git@github.com:mirsella/backupscript"
]
}
}