-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPost-Install
524 lines (401 loc) · 16.7 KB
/
Post-Install
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
Arch Linux Post Install
Pacman settings
sudo nano /etc/pacman.conf
Enable 32bit repo [once steam get's 64bit this repo will be uncessary]
uncomment color option /etc/pacman.conf and uncomment [multilib] repo
Add AUR repo
------------------------------------------
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
------------------------------------------
Initiate pacman gpg keys
# pacman-key --init
# pacman-key --populate archlinu
Install yay AUR helper
# git clone https://aur.archlinux.org/yay.git
# cd yay
# makepgk -si
Install another AUR helper
# yay -S pikaur
Rankmirrors
# yay -S pacman-contrib
Back up the existing /etc/pacman.d/mirrorlist:
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
To uncomment every mirror, run the following sed line:
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup
Rank the mirrors, here with the operand -n 6 to only output the 6 fastest mirrors:
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
Sync mirrors
# yay -Syy
Automatically clean the package cache after every pacman transaction.
# sudo nano /etc/pacman.d/hooks/clean_package_cache.hook
---------------------------------------------
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Cleaning pacman cache...
When = PostTransaction
Exec = /usr/bin/paccache -r
--------------------------------------------
Using Reflector to rank mirrors
# yay -S reflector
Back up the existing /etc/pacman.d/mirrorlist:
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
Verbosely rate and sort the five most recently synchronized mirrors by download speed, and overwrite the file /etc/pacman.d/mirrorlist:
# reflector --verbose --latest 5 --sort rate --save /etc/pacman.d/mirrorlist
Pacman hook
Create a pacman hook that will run reflector and remove the .pacnew file created every time pacman-mirrorlist gets an upgrade.
# mkdir /etc/pacman.d/hooks
# nano /etc/pacman.d/hooks/mirrorupgrade.hook
-------------------------------------------------------------------------------
[Trigger]
Operation = Upgrade
Type = Package
Target = pacman-mirrorlist
[Action]
Description = Updating pacman-mirrorlist with reflector and removing pacnew...
When = PostTransaction
Depends = reflector
Exec = /bin/sh -c "reflector --country 'United States' --latest 200 --age 24 --sort rate --save /etc/pacman.d/mirrorlist; rm -f /etc/pacman.d/mirrorlist.pacnew"
--------------------------------------------------------------------------------
Systemd service
This is an example of service unit that waits for the network to be up and online before running reflector:
# nano /etc/systemd/system/reflector.service
--------------------------------------------------------------------------------
[Unit]
Description=Pacman mirrorlist update
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/reflector --protocol https --latest 30 --number 20 --sort rate --save /etc/pacman.d/mirrorlist
[Install]
RequiredBy=multi-user.target
-----------------------------------------------------------------------------------
Enable/Start service
# systemctl enable reflector.service
# systemctl start reflector.service
xwindow
# sudo pacman -S xorg xorg-server xf86-input-libinput xf86-video-intel xorg-xinit xterm xorg-xclock xorg-twm git
Snapshots of root will allow a working copy of root be preserved as a backup while upgrading or testing the system
Display lv
# lvs
LVM snapshots commands for root snapshots of fresh install (this will also save luks headers)
# lvcreate -L 10GB -n snap-root -s vgArch/cryptroot
Reverting back to root snapshots
# lvconvert --merge vgArch/snap-root
Snapshots will be deleted after restart of the system
Removing root snapshots
# lvremove vgArch/snap-root
LVM snapshots commands for home snapshots and tar backup
# lvcreate -L 10GB -n snap-home -s vgArch/crypthome
Reverting back to home snapshots
# lvconvert --merge vgArch/snap-home
Snapshots will be deleted after restart of the system
Removing home snapshots
# lvremove vgArch/snap-home
Known Issues
shutting down the system with active snapshots may hang for some time. As a workaround a shorter job timeout can be set. Create a copy of /usr/lib/systemd/system/dm-event.service in /etc/systemd/system and insert JobTimeoutSec=10
--------------------------------------------------
[Unit]
Description=Device-mapper event daemon
Documentation=man:dmeventd(8)
Requires=dmeventd.socket
After=dmeventd.socket
DefaultDependencies=no
JobTimeoutSec=10
[Service]
Type=forking
ExecStart=/usr/sbin/dmeventd
ExecReload=/usr/sbin/dmeventd -R
Environment=SD_ACTIVATION=1
PIDFile=/run/dmeventd.pid
OOMScoreAdjust=-1000
--------------------------------------------------
Editing fstab and crypttab for auto-mount and auto-unlock options of externel encrypted usb
Make mount point for external drive
# sudo mkdir /mnt/backup
Set chattr option so we can't write in the /mnt/backup dir while drive is not mounted
# sudo chattr +i .
Zero out drive
# dd if=/dev/zero of=/dev/sdX bs=4096 status=progress
Once done an error of no more space will display
Encrypting drive with passphrase first
# cryptsetup -c aes-xts-plain64 -s 512 -h sha512 -i 5000 luksFormat /dev/sdX
Type in capital YES
Enter in passphrase twice
Now create a keyfile to allow crypttab to auto-unlock the the encrypted drive when plugged in.
Generate 20kb of random data for a keyfile for use with encrypting and unlocking lvm-vg02 with a keyfile.
Which will be named lvm-vg02-data-key and located in root of usb installation disk
# dd if=/dev/urandom of=usb.key bs=1024 count=20
Add in key into external encrypted drive
# cryptsetup luksAddKey /dev/sdX usb.key
Find UUID
#cryptsetup luksDump /dev/sdX
Add mount point and options for /etc/crypttab
------------------------------------------------------------------------------------------------------------
backup UUID=e709425c-699f-4594-acb7-7987689e5ecb /luks-keys/usb.key luks,discard,nofail,x-systemd.device-timeout=3
-------------------------------------------------------------------------------------------------------------
Add mount point and options for /etc/fstab
-------------------------------------------------------------------------------------------------------------
/dev/mapper/backup /mnt/backup ext4 defaults,rw,nofail,discard,x-systemd.device-timeout=3 0 0
-------------------------------------------------------------------------------------------------------------
Installing Back In Time for creating snapshots/backups on an external encrypted drive
# yay -S backintime-git meld
Install Plasma 5 Desktop Environment
# sudo pacman -S plasma kde-applications ttf-liberation ttf-dejavu networkmanager nm-connection-editor network-manager-applet networkmanager-openvpn dnsmasq
Enable display sddm displaymanager and network manager
# sudo systemctl enable networkmanager.service
# sudo systemctl enable sddm.service
DNSMASQ setup
Create /etc/NetworkManager/conf.d/dns.conf
------------------------
[main]
dns=dnsmasq
-----------------------
DNSSEC - For dnsmasq to properly validate DNSSEC, create the following configuration file:
/etc/NetworkManager/dnsmasq.d/dnssec.conf
---------------------------------------------------
conf-file=/usr/share/dnsmasq/trust-anchors.conf
dnssec
dnssec-check-unsigned
---------------------------------------------------
Installing and configure Samba
# sudo pacman -S samba kdenetwork-filesharing gvfs-smb
Create /etc/samba/smb.conf and add the following default values:
-----------------------------------------------------------------------------------------------------
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# For a step to step guide on installing, configuring and using samba,
# read the Samba-HOWTO-Collection. This may be obtained from:
# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# Many working examples of smb.conf files can be found in the
# Samba-Guide which is generated daily and can be downloaded from:
# http://www.samba.org/samba/docs/Samba-Guide.pdf
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = MYGROUP
# server string is the equivalent of the NT Description field
server string = Samba Server
# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
server role = standalone server
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
; hosts allow = 192.168.1. 192.168.2. 127.
# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest
# this tells Samba to use a separate log file for each machine
# that connects
log file = /usr/local/samba/var/log.%m
# Put a capping on the size of the log files (in Kb).
max log size = 50
# Specifies the Kerberos or Active Directory realm the host is part of
; realm = MY_REALM
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
; passdb backend = tdbsam
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting.
# Note: Consider carefully the location in the configuration file of
# this line. The included file is read at that point.
; include = /usr/local/samba/lib/smb.conf.%m
# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
; interfaces = 192.168.12.2/24 192.168.13.2/24
# Where to store roving profiles (only for Win95 and WinNT)
# %L substitutes for this servers netbios name, %U is username
# You must uncomment the [Profiles] share below
; logon path = \\%L\Profiles\%U
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
wins support = yes
# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z
# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The default is NO.
dns proxy = no
# These scripts are used on a domain controller or stand-alone
# machine to add or delete corresponding unix accounts
; add user script = /usr/sbin/useradd %u
; add group script = /usr/sbin/groupadd %g
; add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
; delete user script = /usr/sbin/userdel %u
; delete user from group script = /usr/sbin/deluser %u %g
; delete group script = /usr/sbin/groupdel %g
#============================ Share Definitions ==============================
[homes]
comment = Home Directories
browseable = no
writable = yes
# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /usr/local/samba/lib/netlogon
; guest ok = yes
; writable = no
; share modes = no
# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
; path = /usr/local/samba/profiles
; browseable = no
; guest ok = yes
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
comment = All Printers
path = /usr/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
writable = no
printable = yes
# This one is useful for people to share files
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes
# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
; comment = Public Stuff
; path = /home/samba
; public = yes
; writable = no
; printable = no
; write list = @staff
# Other examples.
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;[fredsprn]
; comment = Fred's Printer
; valid users = fred
; path = /homes/fred
; printer = freds_printer
; public = no
; writable = no
; printable = yes
# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;[fredsdir]
; comment = Fred's Service
; path = /usr/somewhere/private
; valid users = fred
; public = no
; writable = yes
; printable = no
# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %U option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;[pchome]
; comment = PC Directories
; path = /usr/pc/%m
; public = no
; writable = yes
# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
; path = /usr/somewhere/else/public
; public = yes
; only guest = yes
; writable = yes
; printable = no
# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765
--------------------------------------------------------------------------------------------------
Create samba passwd for user
# sudo smbpasswd -a nickle
Change samba user password
# sudo smbpasswd nickle
Enable/Start the service
# sudo systemctl enable smb.service
# sudo systemctl enable nmb.service
Programs
# sudo yay -S htop ntfs-3g git btrfs-progs firefox thunar gvfs thunar-archive-plugin thunar-media-tags-plugin thunar-shares-plugin raw-thumbnailer ffmpegthumbnailer
# yay -S chromium pepper-flash chromium-widevine
Make sure Flash is allowed to run in chrome://settings/content/flash
Make sure Allow sites to play protected content is checked in chrome://settings/content/protectedContent
Printing
yay -S printer-manager cups hplip-minimal
VlC
# yay -S phonon-qt5-vlc libva-intel-driver ttf-freefont
Priivate Internet Access - download pia tar and install
CLI system information tool
# yay -S neofetch-git w3m imagemagick
place neofetch command in ~/.bashrc
neofetch --w3m --source /home/nickle/Photos/pictures/karmen.jpg
Bittorrent Software
# yay -S deluge python2-notify pygtk python2-mako
Filesystems Tools
# yay -S gparted exfat-utils gpart
Skype
# yay -S skypeforlinux-stable-bin
ynab4
# yay -S ynab4
Dropbox
# yay -S dropbox
Dropbox Kde Client
# yay -S kfilebox
Install login theme
# yay sddm
Youtube downloader
# yay -S clipgrab-qt5
Kde dock app
# yay -S latte-dock