Skip to content

Instantly share code, notes, and snippets.

@SanariSan
Last active October 22, 2023 11:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SanariSan/464be2d88f44782b022bd09cd85b9c2a to your computer and use it in GitHub Desktop.
Save SanariSan/464be2d88f44782b022bd09cd85b9c2a to your computer and use it in GitHub Desktop.
Ubuntu init setup
All the SH scripts I run after launching fresh Ubuntu.
Also some manual steps.
+ LUSK
Content inside.
#!/bin/bash
# archey-osx 1.5.2 (https://github.com/obihann/archey-osx/)
# test to see if bash supports arrays
arraytest[0]='test' || (echo 'Error: Arrays are not supported in this version of
bash.' && exit 2)
# Detect the packager.
#if [ -x /usr/local/bin/brew ]; then
#detectedpackager=homebrew
#elif command -v port >/dev/null; then
#detectedpackager=macports
#else
#detectedpackager=none
#fi
# Get the command line options
opt_nocolor=f
opt_force_color=f
opt_offline=f
for arg in "$@"
do
case "${arg}" in
-p|--packager)
packager=$detectedpackager
;;
-m|--macports)
packager=macports
;;
-b|--nocolor)
opt_nocolor=t
;;
-c|--color)
opt_nocolor=f
opt_force_color=t
;;
-o|--offline)
opt_offline=t
;;
-h|--help)
echo "Archey OS X 1.5.2"
echo
echo "Usage: $0 [options]"
echo
echo " -p --packager Use auto detected package system (default packager: ${detectedpackager})."
echo " -m --macports Force use MacPorts as package system."
echo " -b --nocolor Turn color off."
echo " -c --color Force the color on (overrides --nocolor)."
echo " -o --offline Disable the IP address check."
exit 0
;;
*)
echo "Unknown argument: $1" 1>&2
echo "For help, use: $0 --help" 1>&2
exit 1
;;
esac
done
# Set up colors if:
# * stdout is a tty
# * the user hasn't turned it off
# * or if we're forcing color
if [[ ( -t 1 && "${opt_nocolor}" = f) || "${opt_force_color}" = t ]]
then
RED=$(tput setaf 1 2>/dev/null)
GREEN=$(tput setaf 2 2>/dev/null)
YELLOW=$(tput setaf 3 2>/dev/null)
BLUE=$(tput setaf 4 2>/dev/null)
PURPLE=$(tput setaf 5 2>/dev/null)
textColor=$(tput setaf 6 2>/dev/null)
normal=$(tput sgr0 2>/dev/null)
fi
case "${packager}" in
homebrew)
packagehandler=$(brew list -1 | wc -l | awk '{print $1 }')
;;
macports)
packagehandler=$(port installed | wc -l | awk '{print $1 }')
;;
*)
packagehandler=0
;;
esac
# System Variables
user=$(whoami)
hostname=$(hostname | sed 's/.local//g')
# kernel=$(uname)
uptime=$(uptime | sed 's/.*up \([^,]*\), .*/\1/')
shell="$SHELL"
terminal="$TERM ${TERM_PROGRAM//_/} | cyan"
# ram="$(free -m | head -2 | tail -1 | awk '{print "free: " $4 "mb / cached: " $6 "mb / total: " $7 "mb"}')"
ramFree=$(free -m | head -2 | tail -1 | awk '{print $4 "mb"}')
ramBusy=$(free -m | head -2 | tail -1 | awk '{print $3 "mb"}')
ramCache=$(free -m | head -2 | tail -1 | awk '{print $6 "mb"}')
ramTotal=$(free -m | head -2 | tail -1 | awk '{print $2 "mb"}')
disk=$(df | head -4 | tail -1 | awk '{print $5}')
fieldlist[${#fieldlist[@]}]=""
fieldlist[${#fieldlist[@]}]=""
fieldlist[${#fieldlist[@]}]="${textColor}User:${normal} ${user}${normal}"
fieldlist[${#fieldlist[@]}]="${textColor}Hostname:${normal} ${hostname}${normal}"
# fieldlist[${#fieldlist[@]}]="${textColor}Kernel:${normal} ${kernel}${normal}"
# fieldlist[${#fieldlist[@]}]="${textColor}Uptime:${normal} ${uptime}${normal}"
fieldlist[${#fieldlist[@]}]="${textColor}Shell:${normal} ${shell}${normal}"
# fieldlist[${#fieldlist[@]}]="${textColor}Terminal:${normal} ${terminal}${normal}"
fieldlist[${#fieldlist[@]}]="${textColor}Disk:${normal} ${disk}${normal}"
fieldlist[${#fieldlist[@]}]="${textColor}Ram free:${normal} ${ramFree}${normal}"
fieldlist[${#fieldlist[@]}]="${textColor}Ram busy:${normal} ${ramBusy}${normal}"
fieldlist[${#fieldlist[@]}]="${textColor}Ram cached:${normal} ${ramCache}${normal}"
fieldlist[${#fieldlist[@]}]="${textColor}Ram total:${normal} ${ramTotal}${normal}"
fieldlist[${#fieldlist[@]}]="${textColor}Date:${normal} $(date)${normal}"
logofile=${ARCHEY_LOGO_FILE:-"${HOME}/.config/archey-logo"}
if [ -a "$logofile" ]
then
source "$logofile"
else
# The ${foo# } is a cheat so that it lines up here as well
# as when run.
echo -e "
${GREEN# } ####### ${fieldlist[0]}
${GREEN# } ######## ${fieldlist[1]}
${GREEN# } ##### ${fieldlist[2]}
${GREEN# } ##### ${fieldlist[3]}
${YELLOW# } ###### ${fieldlist[4]}
${YELLOW# } ######## ${fieldlist[5]}
${RED# } ########### ${fieldlist[6]}
${RED# } ##### ##### ${fieldlist[7]}
${RED# } ##### ##### ${fieldlist[8]}
${PURPLE# } ##### ##### ${fieldlist[9]}
${PURPLE# } ##### ##### ## ${fieldlist[10]}
${BLUE# } ##### ########## ${fieldlist[11]}
${BLUE# } ##### ####### ${fieldlist[12]}
${normal}
"
fi
#!/bin/bash
# Init
sudo sed -i "/^# deb .* multiverse$/ s/^# //" /etc/apt/sources.list;
sudo sed -i -e 's|eoan|focal|g' /etc/apt/sources.list
sudo apt remove openssh-server openssh-client --purge --yes && sudo apt autoremove --yes && sudo apt autoclean --yes
sudo apt update --yes
sudo apt upgrade --yes
sudo apt install curl
# Repos
# sudo add-apt-repository ppa:atareao/telegram
sudo add-apt-repository ppa:fish-shell/release-3
sudo add-apt-repository ppa:libreoffice/ppa
# Keys
# Postgres
# curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
# Charles
sudo mkdir /etc/apt/keyrings; wget -qO- https://www.charlesproxy.com/packages/apt/charles-repo.asc | sudo tee /etc/apt/keyrings/charles-repo.asc
sudo sh -c 'echo deb [signed-by=/etc/apt/keyrings/charles-repo.asc] https://www.charlesproxy.com/packages/apt/ charles-proxy main > /etc/apt/sources.list.d/charles.list'
# Postgre
# sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
sudo apt update --yes
sudo apt upgrade --yes
# Apps
# BASIC
sudo apt install -y ubuntu-restricted-extras
sudo apt install -y snapd
sudo snap install lazpaint
sudo snap install telegram-desktop
sudo apt install -y smplayer
sudo apt install -y pulseeffects
sudo apt install -y lsp-plugins
#- temp fix for extension-prefs and tseaks (downgrading, unmet deps)
sudo apt install gnome-shell=3.36.4-1ubuntu1~20.04.2 gnome-shell-common=3.36.4-1ubuntu1~20.04.2 gnome-shell-extension-prefs=3.36.4-1ubuntu1~20.04.2
sudo apt install -y gnome-shell-extension-prefs
sudo apt install -y gnome-tweaks
#-
sudo apt install -y libreoffice-calc
sudo apt install -y libreoffice-writer
#sudo apt install -y libreoffice-impress
#sudo apt install -y libreoffice-draw
#sudo apt install -y libreoffice-base
#sudo apt install -y libreoffice-math
#-
sudo apt install -y cheese
sudo apt install -y gparted
sudo apt install -y pavucontrol
sudo apt install -y chrome-gnome-shell
sudo apt install -y preload
sudo apt install -y prelink
sudo apt install -y p7zip-full
sudo apt install -y nautilus-admin
sudo apt install -y flameshot
sudo apt install -y net-tools
#- for external sound cards
# sudo apt install -y qasmixer
# SHELL
sudo apt install -y fish
# DEV
sudo apt install -y software-properties-common apt-transport-https wget
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
sudo apt install -y code
# sudo snap install --classic code
sudo apt install -y fonts-firacode
sudo apt install -y git
sudo apt install -y python3-pip
sudo apt install -y nodejs
sudo apt install -y npm
sudo apt install -y charles-proxy
#sudo apt install -y postgresql-12
#sudo apt install -y pgadmin4
# SSH
sudo apt install -y openssh-server
sudo apt install -y openssh-client
#sudo ufw allow ssh
# ETC
# sudo apt install -y telegram
# for nvidia driver
# ubuntu-drivers devices
# then search recommended driver and install
# sudo apt search nvidia-driver
# sudo apt install -y nvidia-driver-470
# setup service for enabling gpu fan on startup
# Commands info https://forums.developer.nvidia.com/t/nvidia-settings-unable-to-init-server/54006
sudo bash -c 'cat <<EOT >/etc/systemd/system/nvidia-fan.service
[Unit]
Description=Fan control
After=syslog.target multi-user.target graphical.target display-manager.service
Requires=graphical.target
[Service]
Environment="DISPLAY=:1"
Environment="XAUTHORITY=/run/user/1000/gdm/Xauthority"
ExecStart=/usr/bin/fish -c "nvidia-settings -a [gpu:0]/GPUFanControlState=1 && nvidia-settings -a [fan:0]/GPUTargetFanSpeed=50"
Restart=on-failure
RestartSec=300
[Install]
WantedBy=multi-user.target
EOT
'
sudo systemctl enable --now nvidia-fan.service
# get lts nodejs
sudo npm i -g n
sudo n lts
# useful to prevent ssh from dropping connection
sudo sed -i '$a ServerAliveInterval 60' /etc/ssh/ssh_config
#configure pgadmin -> #sudo /usr/pgadmin4/bin/setup-web.sh
# dual boot timezone fix
timedatectl set-local-rtc 1 --adjust-system-clock
# git setup
git config --global core.autocrlf false
git config --global alias.adog 'log --all --decorate --oneline --graph'
git config --global alias.cm 'checkout master'
git config --global alias.cd 'checkout dev'
git config --global alias.md 'merge --no-ff dev'
git config --global alias.pd 'push rep dev'
git config --global alias.pm 'push rep master'
git config --global alias.cdp 'checkout deploy'
git config --global alias.mdp 'merge dev'
git config --global alias.pdp 'push origin deploy'
git config --global user.email 'SanariSan@users.noreply.github.com'
git config --global user.name 'SanariSan'
git config --global credentials.helper 'store'
git config --global core.editor 'code --wait'
# Fix of 2 tg app icons (tg executable located at /opt/telegram)
# WORKS AFTER 1 LAUNCH (since .desktop in .local created after launch)
#sudo mv /usr/share/applications/telegram.desktop /usr/share/applications/telegram.!desktop
# copy&change this file to make multiple tdata clients (~/.local/share/Telegram_Desktop)
#sudo mv /home/user/.local/share/applications/appimagekit_d98825e589ea79557384fe149efdfbdd-Telegram_Desktop.desktop /home/user/.local/share/applications/Telegram_Desktop_main.desktop
# Disable ubuntu dock
sudo gnome-extensions disable ubuntu-dock@ubuntu.com
# Fix for gnome-shell-extension-prefs
sudo apt-get install gir1.2-gtkclutter-1.0
# Disable ctrl+alt+up/down for vscode compatibility
sudo gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "['']"
sudo gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "['']"
# Upgrade
sudo apt update --yes
sudo apt upgrade --yes
# Fish as default shell
# alt solution = usermod -s /usr/bin/fish username
chsh -s `which fish`
#sudo chsh -s `which fish`
usermod -s /usr/bin/fish user
#sudo usermod -s /usr/bin/fish user
# back -> chsh -s (which bash) but no need, type "bash" in fish to get back
# Get OMF (DO MANUALLY, WITH SYSTEM RELOAD BEFORE THAT, FROM FISH, OR SOME BUG HAPPENS!!)
# curl -L https://get.oh-my.fish | fish
#!/usr/bin/fish
# RUN FROM FISH WHEN IT'S SYSTEM SHELL, AFTER RELOAD, WITHOUT SUDO KEYWORD BEFORE
omf install cyan
# First create ./src dir near this .sh file and place archey.sh here
sudo cp ./src/archey.sh /home/user/.local/share/omf/themes/cyan/functions/../archey.sh
# Aliases
alias c="clear"
alias e="exit"
alias grepc="grep -s -n"
alias grepdir="grep -s -r -l"
alias grepdirc="grep -s -r -n"
alias dropcache="sync ; echo 1 | sudo tee /proc/sys/vm/drop_caches"
alias pl="sudo prelink -faRmv"
alias auup="sudo apt update && sudo apt upgrade && pl"
alias pgcheck="sudo systemctl is-active postgresql && sudo systemctl is-enabled postgresql && sudo pg_isready && sudo systemctl status postgresql"
alias pgsh="sudo su - postgres"
alias mostram="ps -e -o pid,user,%mem,command --sort %mem"
alias sens="fish --private"
alias myip="wget -qO- https://json.myip.wtf"
funcsave c
funcsave e
funcsave grepc
funcsave grepdir
funcsave grepdirc
funcsave dropcache
funcsave pl
funcsave auup
funcsave pgcheck
funcsave pgsh
funcsave mostram
funcsave sens
funcsave myip
# Functions
bash -c 'cat <<EOT >/home/user/.config/fish/functions/gs.fish
function gs --description "Wget site in one single file for ease of rehosting"
command wget -r -np -k "\$argv[1]"
end
EOT
'
bash -c 'cat <<EOT >/home/user/.config/fish/functions/trsl.fish
function trsl --description "args - "from", "to", "what" | Translate from one lang to another"
command curl \\
-s \\
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36" \\
-H "Content-Type: application/json" \\
-G \\
--data-urlencode "q=\$argv[3]" \\
"https://translate.googleapis.com/translate_a/single?client=gtx&sl=\$argv[1]&tl=\$argv[2]&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&" \\
| grep -o -E \'("[A-Za-zА-Яа-я ]+?")\' \\
| head -n 25
end
EOT
'
bash -c 'cat <<EOT >/home/user/.config/fish/functions/enru.fish
function enru --description "args - "what" | Translate from en to ru"
trsl "en" "ru" \$argv[1]
end
EOT
'
bash -c 'cat <<EOT >/home/user/.config/fish/functions/ruen.fish
function ruen --description "args - "what" | Translate from ru to en"
trsl "ru" "en" \$argv[1]
end
EOT
'
bash -c 'cat <<EOT >/home/user/.config/fish/functions/tkill.fish
function tkill --description "Completely Target kill process tree by name"
command ps -aux | grep "\$argv[1]" | awk \'{print \$2}\' | xargs -l kill -9
end
EOT
'
bash -c 'cat <<EOT >/home/user/.config/fish/functions/title.fish
function title --description "args - "name" | Set terminal title"
echo -n -e "\\033]0;\$argv[1]\\007"
end
EOT
'
# History import
# First place your fish_history file to ./src dir near this .sh
# May not work automatically, for some reason...
# Check and redo manually if needed
# clear internal history and history file (using builtin means we don't get a prompt)
builtin history --clear
# set prepared history file
sudo rm -f ~/.local/share/fish/fish_history
sudo cp ./src/fish_history ~/.local/share/fish/fish_history
# merge history file with (empty) internal history
history --merge
# Final
preload
pl
# change /etc/preload.conf if needed
# memfree -> 100% && memcached -> 30%
# change /etc/default/prelink PRELINKING=unknown -> yes if needed#!/usr/bin/fish
Pasted from here - https://askubuntu.com/questions/293028/how-can-i-install-ubuntu-encrypted-with-luks-with-dual-boot/293029#293029
Backup - https://web.archive.org/web/20220812081647/https://askubuntu.com/questions/293028/how-can-i-install-ubuntu-encrypted-with-luks-with-dual-boot/293029
Raw text without images:
Boot from an Ubuntu live DVD or USB stick, and select "Try Ubuntu".
Create two partitions using GParted included in the live disk. The first partition should be unformatted and should be large enough for root and swap, in my example, this is /dev/sda3. The second partition should be several hundred megabytes big and formatted in ext2 or ext3, it will be unencrypted and mounted to /boot (in my example this is /dev/sda4).
In this screenshot, I have an existing unencrypted Ubuntu installation in two partitions: /dev/sda1 and /dev/sda5, highlight in the circle to the left. I have created an unformatted partition in /dev/sda3 and an ext3 partition in /dev/sda4, intended for the encrypted Ubuntu installation, higlighted in the circle to the right:
GParted screenshot
Create a LUKS container using these commands. Replace /dev/sda3 with the unformatted partition created earlier, and cryptcherries with a name of your choice.
sudo cryptsetup luksFormat /dev/sda3
sudo cryptsetup luksOpen /dev/sda3 cryptcherries
Warning: You'll notice that the luksFormat step completed very quickly, because it doesn't securely erase the underlying block device. Unless you're just experimenting and don't care about security against various types of forensic attack, it is critical to properly initialize the new LUKS container before creating filesystems in it. Writing zeros to the mapped container will cause strong random data to be written to the underlying block device. This can take a while, so it's best to use the pv command to monitor the progress:
### Only for older releases, e.g. not for 19.04, `pv` is not included in the repo must be added first
# sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
# sudo apt-get update
sudo apt-get install -y pv
sudo sh -c 'exec pv -tprebB 16m /dev/zero >"$1"' _ /dev/mapper/cryptcherries
or, if you're doing an offline install and can't easily get pv:
sudo dd if=/dev/zero of=/dev/mapper/cryptcherries bs=16M
Inside the mounted LUKS container, create an LVM physical volume, a volume group and two logical volumes. The first logical volume will be mounted at /, and the second one will be used as swap. vgcherries is the name of the volume group, and lvcherriesroot and lvcherriesswap are the names of the logical volumes, you can choose your own.
sudo pvcreate /dev/mapper/cryptcherries
sudo vgcreate vgcherries /dev/mapper/cryptcherries
sudo lvcreate -n lvcherriesroot -L 7.5g vgcherries
sudo lvcreate -n lvcherriesswap -L 1g vgcherries
Create filesystems for the two logical volumes: (You can also do this step directly from the installer.)
sudo mkfs.ext4 /dev/mapper/vgcherries-lvcherriesroot
sudo mkswap /dev/mapper/vgcherries-lvcherriesswap
Without rebooting, install Ubuntu using the graphical installer (shortcut is on the desktop in Xubuntu 18.04), choosing manual partitioning. Assign / to /dev/mapper/vgcherries-lvcherriesroot and /boot to the unencrypted partition created in step 2 (in this example,/dev/sda4).
Once the graphical installer is finished, select "continue testing" and open a terminal.
Find the UUID of the LUKS partitions (/dev/sda3 in this case), you will need it later:
$ sudo blkid /dev/sda3
/dev/sda3: UUID="8b80b3a7-6a33-4db3-87ce-7f126545c74af" TYPE="crypto_LUKS"
Mount the appropriate devices to the appropriate locations in /mnt, and chroot into it:
sudo mount /dev/mapper/vgcherries-lvcherriesroot /mnt
sudo mount /dev/sda4 /mnt/boot
sudo mount --bind /dev /mnt/dev
sudo chroot /mnt
> mount -t proc proc /proc
> mount -t sysfs sys /sys
> mount -t devpts devpts /dev/pts
Create a file named /etc/crypttab in the chrooted environment to contain this line, replacing the UUID value with the UUID of the LUKS partition, and vgcherries with the name of the volume group:
# <target name> <source device> <key file> <options>
cryptcherries UUID=8b80b3a7-6a33-4db3-87ce-7f126545c74af none luks,retry=1,lvm=vgcherries
Run the following command in the chrooted environment:
update-initramfs -k all -c
Reboot and boot into the encrypted Ubuntu. You should be prompted for a password.
Check that you're using the encrypted partition for / by running mount:
$ mount
/dev/mapper/vgcherries-lvcherriesroot on / type ext4 (rw,errors=remount-ro)
/dev/sda4 on /boot type ext3 (rw)
# rest of output cut for brevity
Check that you're using the encrypted swap partition (not any unencrypted swap partitions from any other installations) by running this command:
$ swapon -s
Filename Type Size Used Priority
/dev/mapper/vgcherries-lvcherriesswap partition 630780 0 -1
Check that you can boot into recovery mode, you don't want to find out later during an emergency that recovery mode doesn't work :)
Install any updates, which are likely to rebuild the ramdisk and update the grub configuration. Reboot and test both normal mode and recovery mode.
#####
Possible problems:
-can't install anything / update os bcs of boot partition size
+MAKE IT BIGGER FROM THE START!!!
temp solution for
`
I: The initramfs will attempt to resume from /dev/sda5
I: (UUID=qwe-qwe-qwe-qwe)
I: Set the RESUME variable to override this.
`
https://askubuntu.com/a/1116795
blkid | awk -F\" '/swap/ {print $2}'
printf "RESUME=UUID=$(blkid | awk -F\" '/swap/ {print $2}')\n" | sudo tee /etc/initramfs-tools/conf.d/resume
sudo update-initramfs -u -k all
# Launch from liveusb
### graphical gparted ...
# root + swap (label - , unformatted/ext3)
/dev/nvme0n1p6
# boot (label - boot, ext3)
/dev/nvme0n1p7
### graphical gparted ...
sudo cryptsetup luksFormat /dev/nvme0n1p6
sudo cryptsetup luksOpen /dev/nvme0n1p6 ccont
sudo apt-get install -y pv
sudo sh -c 'exec pv -tprebB 16m /dev/zero >"$1"' _ /dev/mapper/ccont
sudo pvcreate /dev/mapper/ccont
sudo vgcreate cvg /dev/mapper/ccont
sudo lvcreate -n clvroot -L 137.5g cvg
sudo lvcreate -n clvswap -l 100%FREE cvg
sudo mkfs.ext4 /dev/mapper/cvg-clvroot
sudo mkswap /dev/mapper/cvg-clvswap
### graphical setup ...
# 1. /dev/nvme0n1p6 clvroot -> ext4 /
# 2. /dev/nvme0n1p6 clvswap -> don't touch
# 3. /dev/nvme0n1p7 -> ext3 /boot
# setup to 1.
### graphical setup ...
sudo blkid /dev/nvme0n1p6
# -> UUID="qwe" TYPE="crypto_LUKS" PARTUUID="asd"
sudo mount /dev/mapper/cvg-clvroot /mnt
sudo mount /dev/nvme0n1p7 /mnt/boot
sudo mount --bind /dev /mnt/dev
sudo chroot /mnt
mount -t proc proc /proc
mount -t sysfs sys /sys
mount -t devpts devpts /dev/pts
echo ccont UUID=qwe none luks,discard,tries=3 > /etc/crypttab
update-initramfs -k all -c
# (!) Shell extensions, get manually
# Compiz alike magic lamp effect by hermes83
# Compiz windows effect by hermes83
# Dash to Dock by michele_g
# Clipboard Indicator by Tudmotu
# Todo.txt by BartL
# Applications Overview Tooltip by RaphaelR
#
#
# TODO: maybe move these to bash.sh when aknowledge how to set shortcuts programmatically
# Screenshot tool, add shortcuts
#
mkdir /home/user/Pictures/screenshots
#
# Screenshot Full
# flameshot full -c -p /home/user/Pictures/screenshots
# Print
#
# Screenshot Area
# flameshot gui
# ctrl + Print
#
# Screenshot Full Delayed
# flameshot full -c -d 3000 -p /home/user/Pictures/screenshots/
# ctrl + shift + Print
# Keyboard layout changer
#
sudo apt install -y python3-tk
sudo apt install -y python3-dev
install git+https://github.com/SanariSan/kbdf
# or pip install git+https://github.com/alexantoshuk/kbdf
#
# Set shortcut
#
# Translate
# python3 /home/user/.local/bin/kbdf.py selection
# Ctrl + Shift + Space
# Themes && Icons
# Sweet-Dark https://www.gnome-look.org/p/1253385/
# Sweet-Purple (Inherits=Yaru) https://www.opendesktop.org/p/1284047/
# TODO: move to bash.sh and make fully auto
mkdir ~/.themes && mkdir ~/.icons
tar -xf ./Sweet-Dark.tar.xz -C ~/.themes
tar -xf ./Sweet-Purple.tar.xz -C ~/.icons
# in ~/.icons/Sweet-Purple/index.theme put Inherits=Yaru,...
# then change in tweaks tool
# CHARLES registration/activation
# https://zzzmode.com/mytools/charles/
# https://go.dev/play/p/Qtt2CmHbTzU
# wtfdude : 4d1bb46d1c65d08002
# Enable nvidia brightness toggle with kb fn keys:
https://askubuntu.com/a/1247820
(in my case /usr/share/X11/xorg.conf.d/10-nvidia.conf)
At the /usr/share/X11/xorg.conf.d folder find file related to your nvidia and append following section:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "<your graphic card as it named in your system>"
Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection
You can find the name of your graphic by searching for "system" in your Ubuntu. In my case it is GeForce GTX 1660 Ti so in abovementioned configuration file it gonna be BoardName "GeForce GTX 1660 Ti" - enclosed in doublequotes.
Save and reboot.
######
# GIT (filter-repo)
# https://launchpad.net/ubuntu/+source/git-filter-repo
# last stable .deb = https://launchpad.net/ubuntu/+source/git-filter-repo/2.32.0-1/+build/21685865
# info : https://github.com/newren/git-filter-repo/#simple-example-with-comparisons
#!/bin/bash
###
# Get me with (link is dynamic so it wont get the file latest version)
# wget -O init.sh https://gist.githubusercontent.com/SanariSan/464be2d88f44782b022bd09cd85b9c2a/raw/f9c0bf0858967896b167f5665366b2ac5847a32f/vps_minimal.sh && chmod +x ./init.sh && ./init.sh
###
# Init
sudo sed -i "/^# deb .* multiverse$/ s/^# //" /etc/apt/sources.list;
sudo sed -i -e 's|eoan|focal|g' /etc/apt/sources.list
sudo apt update --yes
sudo apt upgrade --yes
sudo apt install -y curl
sudo apt install -y snapd
sudo apt install -y preload
sudo apt install -y prelink
sudo apt install -y p7zip-full
sudo apt install -y net-tools
sudo apt install -y git
sudo apt install -y nodejs
sudo apt install -y python3-pip
sudo apt install -y npm
sudo npm i -g n
sudo n lts
# git setup
git config --global user.email 'SanariSan@users.noreply.github.com'
git config --global user.name 'SanariSan'
git config --global core.autocrlf false
git config --global alias.adog 'log --all --decorate --oneline --graph'
git config --global alias.cm 'checkout master'
git config --global alias.cd 'checkout dev'
git config --global alias.md 'merge --no-ff dev'
git config --global alias.pd 'push rep dev'
git config --global alias.pm 'push rep master'
git config --global credentials.helper 'store'
# git config --global core.editor 'code --wait'
# useful to prevent ssh from dropping connection
sudo sed -i '$a ServerAliveInterval 60' /etc/ssh/ssh_config
preload
prelink -faRmv
# =================================
# Postgres
# curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
# sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
# sudo apt install -y postgresql-13
# sudo apt install -y pgadmin4
# _configure pgadmin \/
# sudo /usr/pgadmin4/bin/setup-web.sh
# Fish
# sudo add-apt-repository ppa:fish-shell/release-3
# sudo apt install -y fish
# chsh -s `which fish`
# usermod -s /usr/bin/fish root
# back => chsh -s (which bash)
# ===
# Get OMF (DO MANUALLY, WITH SYSTEM RELOAD BEFORE THAT, FROM FISH, OR SOME BUG HAPPENS!!)
# curl -L https://get.oh-my.fish | fish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment