Skip to content

Instantly share code, notes, and snippets.

@ckrzen
Created February 9, 2020 01:42
Show Gist options
  • Save ckrzen/e3d8c0144e4230caf23a2f0bb166fcbb to your computer and use it in GitHub Desktop.
Save ckrzen/e3d8c0144e4230caf23a2f0bb166fcbb to your computer and use it in GitHub Desktop.
CRUX Linux scripts
#!/bin/bash
#
# CRUX post-install script
#
# Author: Chris Rainey <ckrzen at tuta dot io>
#
# Version: 0.8
###
UPGRADE()
{
clear
sudo ports -u
sudo prt-get cache
case $(sudo prt-cache diff) in
"No differences found")
echo -e "\nNothing to upgrade !!\n\n"
exit
;;
*)
echo -e "\n"
sudo prt-cache diff
;;
esac
read -sn 1 -p $'\n\n[[[ PRESS ANY KEY TO ``FSTRIM`` ]]]\n\n'
sudo fstrim -av
read -sn 1 -p $'\n\n[[[ PRESS ANY KEY TO ``SYSUP`` ]]]\n\n'
sudo prt-cache sysup
read -sn 1 -p $'\n\n[[[ PRESS ANY KEY TO ``REVDEP`` ]]]\n\n'
echo -e ' >>> working...\n'
case $(sudo revdep) in
'')
echo -e "Nothing to rebuild"
;;
*)
sudo prt-cache update -fr $(revdep)
;;
esac
read -sn 1 -p $'\n\n[[[ PRESS ANY KEY TO ``REJMERGE`` ]]]\n\n'
sudo rejmerge
echo -e '\n\n[[[ ALL DONE !! ]]]\n\n\n'
}
SERVER()
{
clear
sudo prt-cache depinst \
fail2ban \
fwupd \
intel-firmware \
intel-ucode \
iucode-tool \
lshw \
mailx \
mediainfo \
nmap \
rtorrent \
smartmontools \
sshfs-fuse \
unrar
read -sn 1 -p $'\n\n[[[ PRESS ANY KEY TO ``REVDEP`` ]]]\n\n'
echo -e ' >>> working...\n'
case $(sudo revdep) in
'')
echo -e "Nothing to rebuild"
;;
*)
sudo prt-cache update -fr $(revdep)
;;
esac
echo -e '\n\n[[[ ALL DONE ]]]\n\n\n'
}
DESKTOP()
{
clear
sudo prt-cache depinst \
alsa-bluez \
avahi \
alsa-utils \
alsa-plugins \
conky \
ffmpeg \
fwupd \
intel-firmware \
intel-ucode \
iucode-tool \
iw \
libdvdcss \
libva-intel \
mailx \
mediainfo \
mpg123 \
mpv \
neofetch \
nmap \
rtorrent \
scrot \
slock \
sxiv \
smartmontools \
sshfs-fuse \
tightvnc \
upower \
unrar \
whois \
xorg-xinput \
youtube-dl
#jwm
#libva-utils
#npm
#oathtool
#sudo npm -g install castnow
read -sn 1 -p $'\n\n[[[ PRESS ANY KEY TO ``REVDEP`` ]]]\n\n'
echo -e ' >>> working...\n'
case $(sudo revdep) in
'')
echo -e "Nothing to rebuild"
;;
*)
sudo prt-cache update -fr $(revdep)
;;
esac
echo -e '\n\n[[[ ALL DONE ]]]\n\n\n'
}
# sudo sed -i.orig \
# 's/# user/user/' \
# /etc/fuse.conf \
# sudo sed -i.orig \
# 's/#DNS=/DNS=8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844/' \
LOW-RAM()
{
earlyoom
}
# ISP SMTP for mailx[smartd]
# From Slack64-curr:
#
# ] LFS & BLFS
# X] Start WM stanza in /etc/X11/xinit/xinitrc
# ] ACPI from /etc/
# X] ALSA from /etc/
# X] asound.* in /etc/
# X] hosts* in /etc/
# ] pm in /etc/
# X] mkinitrd ?
# X] microcode in efi_stub
# X] ntpd or chrony
# X] smartd
# X] crond ?
# X] setfont -v [/usr/share/kbd/consolefonts]
# .] mcelog ?
# X] setterm ?
# X] Set %VISUAL or $EDITOR in /etc/profile ?
# ] /etc/resolv.conf ?
# X] Add 'fstrim' to CRUX-Inst update function
# X] BUG: jwm can't find .desktop file [RETEST]
# ] BUG: conky build with WLAN
# UPGRADE: Firmware / SSD's / HDD's / batteries / routers
# SET: 8.8.8.8 | 8.8.4.4 | 2001:4860:4860::8888 | 2001:4860:4860::8844 in routers DNS
#echo
### REMOVE: # No AUTO-LOGIN if shared LUKS crypt passwd !!!
### RENAME: UPGRADE
### FIX: DESKTOP
#LOW-RAM
# ADD: earlyoom to rc.conf
#CKR #ADD ssh-keygen/copy-id
# REBOOT
# CONFIGURE: Settings / Tweaks
#simple-scan # hp-plugin needed?
# *** REPEAT FOR ALL USERS ***
# RESTORE: data
# INSTALL: software
# SET: 2-Step Verification for all cloud services
# ADJUST: LibreOffice theme
# INSTALL: VPN(surfshark, PIA, Nord, etc.)
# *** REPEAT FOR ALL USERS ***
# TEST: all launchers
# TEST: all 'Fn' keys
# SET: screen lock / power management
# TEST: laptop lid-close suspend
### RENAME: UPGRADE
# TEST: all UPS's
# COPY: recovery codes to laptops
# LABEL: computers
# SET: hard drive to first / only boot device
# SET: passwd for Firmware / BOOT
# ERASE: previous backup drives & test
# DESKTOP: sudo dnf install deja-dup && sudo dnf needs-restarting
# CONFIGURE: .HD-BKUP.sh || Deja-Dup(Google Drive, etc.)
# MOVE: ~root/.bash_history to ~/CONFIGS/root/
# CLEAN: ~root/ files
# UPDATE: "[???] Passwords & Tasks List"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment