Skip to content

Instantly share code, notes, and snippets.

@kanchudeep
Last active August 6, 2022 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanchudeep/bcca91f3a1f50b6e64c892b2ebc64837 to your computer and use it in GitHub Desktop.
Save kanchudeep/bcca91f3a1f50b6e64c892b2ebc64837 to your computer and use it in GitHub Desktop.
Linux - Post Install
Reduce system swappiness (for SSD based systems). Add the following line to
'/etc/sysctl.conf':
vm.swappiness=10
Use a ramdisk to store temporary data if you have enough RAM (for SSD based
systems). Add following lines to '/etc/fstab':
tmpfs /run/ tmpfs noatime,nodev,nosuid,mode=1777 0 0
tmpfs /tmp/ tmpfs noatime,nodev,nosuid,mode=1777 0 0
tmpfs /var/spool/ tmpfs noatime,nodev,nosuid,mode=1777 0 0
tmpfs /var/tmp/ tmpfs noatime,nodev,nosuid,mode=1777 0 0
Apply fix for slow USB copy
Add the following lines to '/etc/sysctl.conf':
vm.dirty_background_bytes=16777216
vm.dirty_bytes=50331648
Add custom DNS:
1. Edit the file '/etc/systemd/resolved.conf' and edit line '#DNS=' to:
DNS=1.1.1.1 8.8.8.8 1.0.0.1 8.8.4.4 2606:4700:4700::1111 2001:4860:4860::8888 2606:4700:4700::1001 2001:4860:4860::8844
2. Apply:
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
Remove legacy Intel drivers:
sudo apt purge xserver-xorg-video-intel
Debian: Remove unrequired packages:
sudo apt purge exfalso quodlibet sugar-browse-activity xterm
LinuxMint:
1. Remove unrequired packages (including blueberry):
sudo apt purge --auto-remove blueberry celluloid drawing evolution evolution-data-server evolution-data-server-common hexchat hexchat-common rhythmbox rhythmbox-data rhythmbox-plugins rhythmbox-plugin-tray-icon thunderbird thunderbird-gnome-support thunderbird-locale-en thunderbird-locale-en-us tomboy
2. Install blueman (in place of blueberry):
sudo apt install blueman
3.
LibreOffice:
1. Add repository for latest version:
sudo add-apt-repository --yes ppa:libreoffice/ppa
2. Remove unrequired packages:
sudo apt purge libreoffice-help-de libreoffice-help-es libreoffice-help-fr \
libreoffice-help-it libreoffice-help-pt libreoffice-help-pt-br \
libreoffice-help-ru libreoffice-help-zh-cn libreoffice-help-zh-tw \
libreoffice-l10n-de libreoffice-l10n-es libreoffice-l10n-fr \
libreoffice-l10n-it libreoffice-l10n-pt libreoffice-l10n-pt-br \
libreoffice-l10n-ru libreoffice-l10n-zh-cn libreoffice-l10n-zh-tw
System Time: Windows Dualboot
Set Windows to use UTC time for BIOS instead of local time (run as
Administrator):
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" /f /v RealTimeIsUniversal /t REG_DWORD /d 1
or
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" /f /v RealTimeIsUniversal /t REG_QWORD /d 1
Or (NOT RECOMMENDED)... Set Linux to use local time for BIOS instead of UTC
time:
sudo timedatectl set-local-rtc 1
Enable & configure firewall:
Enable:
sudo ufw enable
Allow local:
sudo ufw allow from 192.168.0.0/24
sudo ufw allow from 192.168.1.0/24
Enable Touchpad (login screen):
1. Edit file '/usr/share/X11/xorg.conf.d/40-libinput.conf'.
2. Edit relevant section to read:
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
Option "Tapping" "True"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
SDDM - Change date/time format:
1. Edit file 'sudo nano /usr/share/sddm/themes/breeze/components/Clock.qml'.
2. Change:
text: Qt.formatTime(timeSource.data["Local"]["DateTime"])
...to...
text: Qt.formatTime(timeSource.data["Local"]["DateTime"],"hh:mm:ss")
...and...
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate)
...to...
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "ddd, dd MMM yyyy")
Auto-unlock SSH keys on KDE
1. Install kwalletmanager:
sudo apt install kwalletmanager
2. Create a script '~/.config/autostart-scripts/ssh-add.sh' with content:
#!/bin/sh
export SSH_ASKPASS=/usr/bin/ksshaskpass
/usr/bin/ssh-add $HOME/.ssh/id_rsa </dev/null
Ignore lid switch:
Open file '/etc/UPower/UPower.conf'.
Change 'IgnoreLid=false' to 'IgnoreLid=true'.
Disable rouge GPE (specific for Asus K53Sc i.e. gpe06):
1. Add a crontab. Create a file '/etc/cron.d/disable-gpe' with following
content:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Disable rouge GPE06
@reboot root echo "disable" > /sys/firmware/acpi/interrupts/gpe06
2. To make it work even after suspend, create a file
'/etc/pm/sleep.d/30_disable_gpe' with following content:
#!/bin/bash
case "$1" in
thaw|resume)
echo disable > /sys/firmware/acpi/interrupts/gpe06 2>/dev/null
;;
*)
;;
esac
exit $?
3. Also make the file executable:
sudo chmod +x /etc/pm/sleep.d/30_disable_gpe
Add friendlier aliases. Add to '~/.bash_aliases':
alias chattr='chattr -V'
alias chmod='chmod --verbose'
alias chown='chown --verbose'
alias cp='cp --interactive --verbose'
alias dd='dd status=progress'
alias df='df --human-readable'
alias diff='diff --brief --recursive'
alias du='du --human-readable'
alias fsck='fsck -C 0 -M -V'
alias fold='fold --spaces --width=80'
alias free='free --human'
alias grub-install='grub-install --verbose'
alias kpartx='kpartx -v'
alias ln='ln --interactive --verbose'
alias ls='ls --almost-all --color=auto --group-directories-first --human-readable --indicator-style=slash --sort=extension --time-style=+%F\ %T'
alias losetup='losetup --verbose'
alias mkdir='mkdir --verbose'
alias mkinitramfs='mkinitramfs -v'
alias mount='mount --verbose'
alias mv='mv --interactive --verbose'
alias partprobe='partprobe --summary'
alias pkill='pkill --echo'
alias rename='rename -verbose'
alias rm='rm --interactive=once --verbose'
alias rmdir='rmdir --verbose'
alias rsync='rsync --human-readable --progress --recursive --verbose'
alias shred='shred --iterations=1 --remove=wipesync --verbose --zero'
alias sudo='sudo '
alias umount='umount -v'
alias watch='watch --color'
# Non standard
alias backup='rsync --delete --human-readable --modify-window=1 --progress --recursive --times --verbose'
alias clamscan='clamscan -irz --bell'
alias dump1090-mutability='dump1090-mutability --enable-agc --interactive --metric --net --write-json /run/dump1090-mutability'
alias jshint='jshint --config /path/to/JSHint.json --show-non-errors'
alias rcp='rsync -ah --progress'
alias xclip='xclip -selection clipboard'
alias uglifyjs='uglifyjs --mangle --toplevel'
Add Man via Yelp. Add to '~/.profile' or '~/.bashrc':
yman() { yelp "man:$@"; }
Set maximum compression for CLI. Add to '~/.profile' or '~/.bashrc':
export BZIP2=-9
export GZIP_OPT=-9
export XZ_OPT=-9
Set maximum compression for file-roller:
dconf write /org/gnome/file-roller/general/compression-level "'maximum'"
Add custom Grub menu entries
1. Open file '/etc/grub.d/40_custom' in text editor (elevated).
2. Append following:
# Function to boot a generic USB device (UEFI)
function boot_generic_usb {
echo 'Attempting generic USB Device UEFI boot...'
set root=(hd0)
chainloader +1
boot
}
menuentry "Boot USB Device" {
# Check if own custom USB (BIOS)
probe --set=fs --fs (hd0,msdos2)
if [ regexp 'ext[234]' "${fs}" ]; then
probe --set=label --label (hd0,msdos2)
if [ "${label}" = "Linux" ]; then
set root=(hd0,msdos2)
echo 'Loading Linux...'
linux /vmlinuz root=/dev/sdb2 ro text
echo 'Loading initial ramdisk ...'
initrd /initrd.img
boot
else
boot_generic_usb
fi
else
boot_generic_usb
fi
}
menuentry "Boot Optical Drive (UEFI)" {
insmod udf
set root=(cd0)
chainloader +1
boot
}
menuentry "Reboot" {
reboot
}
menuentry "Halt" {
halt
}
3. Update Grub files by executing:
sudo update-grub
Enable blur in Yakuake:
1. Edit file '~/.config/yakualerc'.
2. Add 'Blur=true' under '[Appearance]'.
3. Restart Yakuake.
Disable Services:
ModemManager.service - Service for 2G/3G/4G modems
* To disable:
sudo systemctl stop <service>; sudo systemctl disable <service>
Microsoft Fonts:
1. Copy over the following files from a Windows install to
'/usr/share/fonts/truetype/microsoft/':
arial.ttf
arialbd.ttf
arialbi.ttf
ariali.ttf
arialnbi.ttf
arialnb.ttf
arialni.ttf
arialn.ttf
arialuni.ttf (Office 2013)
ariblk.ttf
comic.ttf
comicbd.ttf
cour.ttf
courbd.ttf
courbi.ttf
couri.ttf
georgia.ttf
georgiab.ttf
georgiai.ttf
georgiaz.ttf
impact.ttf
tahoma.ttf
tahomabd.ttf
times.ttf
timesbd.ttf
timesbi.ttf
timesi.ttf
verdana.ttf
verdanab.ttf
verdanai.ttf
verdanaz.ttf
2. Update font cache:
sudo fc-cache --force --verbose
Software Installs:
• Packages:
apache2
* Adding sites:
1. Add entries in '/etc/apache2/mods-available/alias.conf' (need to give
permission through out the path):
# Site: /site
Alias /site "/path/to/site"
<Directory "/path/to/site">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted
</Directory>
# Site cgi-bin: /site/cgi-bin
<Directory "/path/to/site/cgi-bin/">
SetHandler cgi-script
Options +ExecCGI -MultiViews
Require all granted
</Directory>
* Note: Check permissions of directories (755) and files (644).
2. Enable CGI:
sudo a2enmod cgi
apt-transport-https
audacious
calibre
checkinstall
clamav
clamtk
cmake
dconf-cli
dconf-editor
dmg2img
easytag
exfat-fuse
exfat-utils
fatattr
ffmpeg
filezilla
fonts-roboto
g++
gcalcli # Google Calendar Command Line Interface
gcc-mingw-w64-i686
gcc-mingw-w64-x86-64
gnome-exe-thumbnailer # Windows .exe and other executable thumbnailer for GNOME
gnome-user-share # Enable receiving files via BlueTooth - run 'gnome-file-share-properties'
gparted
handbrake
hfsutils # Tools for reading and writing Macintosh volumes
hfsprogs # mkfs and fsck for HFS and HFS+ file systems
icoutils # Create and extract MS Windows icons and cursors
inkscape
kazam # Screen recording
libcrypt-rc4-perl # Perl implementation of the RC4 encryption algorithm
nero
nodejs
npm
csslint
htmlhint
jshint
uglify-js
openjdk-8-jre
p7zip-full # for support to create encrypted 7z archives
pdfgrep
perl-doc
qemu-system-arm
qemu-system-x86
qemu-utils
screen
shellcheck
smartmontools
testdisk
tlp
tor
uget
vlc
wxhexeditor # hexadecimal editor for massive files
xclip
yad
• Aircrack-ng
1. Install required tools:
sudo apt-get install curl gnupg apt-transport-https
2. Add repository key:
curl -L https://packagecloud.io/aircrack-ng/release/gpgkey | sudo apt-key add -
3. Create repository file:
echo -e "deb https://packagecloud.io/aircrack-ng/release/ubuntu/ bionic main\ndeb-src https://packagecloud.io/aircrack-ng/release/ubuntu/ bionic main" | sudo tee /etc/apt/sources.list.d/aircrack-ng_release.list
4. Install:
sudo apt update && sudo apt install aircrack-ng
• Arduino
sudo usermod -aG dialout $(whoami) # Add user to group dialout for required serial permissions
• Audacity
sudo add-apt-repository ppa:ubuntuhandbook1/audacity
sudo apt update
• Code::Blocks
sudo add-apt-repository ppa:codeblocks-devs/release
...or...
sudo add-apt-repository --yes "deb http://ppa.launchpad.net/codeblocks-devs/release/ubuntu bionic main"
sudo apt update && sudo apt install codeblocks codeblocks-contrib
• Dictionary:
1. Install dict server & Gnome Dictionary:
sudo apt install dictd dict-devil dict-freedict-eng-hin dict-gcide \
dict-moby-thesaurus dict-wn gnome-dictionary
2. Add local dictionary server to Open Gnome Dictionary:
a. Open 'Preferences'. Open 'Source' tab.
b. Click add (+). In 'Add Dictionary Source', for 'Description' set
'dictd', for 'Hostname' set 'localhost', for 'Port' set '2628' and click
'Add'.
c. Set 'dictd' as default.
• dump1090-mutability
Install latest and relevant deb from:
https://cdn-aws.deb.debian.org/debian/pool/main/d/dump1090-mutability/
* Notes:
1. Dependencies:
libjs-excanvas libjs-jquery-ui libjs-jquery-ui-theme-smoothness librtlsdr0
2. Fix dump1090-mutability service not working by default, due to missing
udev rules:
sudo wget -O /etc/udev/rules.d/rtl-sdr.rules "https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules"
3. Add a crontab. Create a file '/etc/cron.d/dump1090-init-data-directory'
with following content:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Initialize directory for Dump1090
@reboot root mkdir -p /run/dump1090-mutability; chmod 777 /run/dump1090-mutability/
4. If evoking manually from CLI use the arguments:
--net --write-json /run/dump1090-mutability
5. For adding site to Apache create and enable '/etc/apache2/conf-available/dump1090-mutability.conf':
Alias /dump1090/data /run/dump1090-mutability/
Alias /dump1090 /usr/share/dump1090-mutability/html/
<Directory /usr/share/dump1090-mutability/html/>
Options +FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex gmap.html
</Directory>
<Directory /run/dump1090-mutability/>
AllowOverride All
Require all granted
DirectoryIndex disabled
</Directory>
• FlightGear
sudo add-apt-repository ppa:saiarcot895/flightgear
sudo apt update
sudo apt install flightgear
• Geany (Latest Version)
sudo add-apt-repository ppa:geany-dev/ppa
sudo apt update
sudo apt install geany
• GIMP (Latest Version)
sudo add-apt-repository ppa:otto-kesselgulasch/gimp
sudo apt update
sudo apt install gimp
• Google Calendar Desklet (Cinnamon):
Install gcalcli (Google Calendar Command Line Interface):
sudo apt install gcalcli
Launch gcalcli with a parameter list from terminal and configure the user account:
gcalcli list
Run the following command with current date in terminal and see whether gcalcli prints your events:
gcalcli agenda "1/1/2018" "1/31/2018" --nostarted --tsv
• Google Chrome:
https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
• Google Earth:
https://dl.google.com/dl/linux/direct/google-earth-pro-stable_current_amd64.deb
• GNURadio:
1. App PPA:
sudo add-apt-repository ppa:gnuradio/gnuradio-releases
sudo apt update
2. Install:
sudo apt gnuradio
• GQRX:
1. Remove any non PPA packages:
sudo apt purge --auto-remove gqrx gqrx-sdr libgnuradio*
2. Add PPAs:
sudo add-apt-repository -y ppa:bladerf/bladerf
sudo add-apt-repository -y ppa:myriadrf/drivers
sudo add-apt-repository -y ppa:myriadrf/gnuradio
sudo add-apt-repository -y ppa:gqrx/gqrx-sdr
sudo apt update
3. Install:
sudo apt install gqrx-sdr
4. Install libvolk1-bin package and run volk_profile tool to optimize GNU Radio performance:
sudo apt install libvolk1-bin
volk_profile
• GQRX Scanner
1. Download and extract source from:
https://github.com/neural75/gqrx-scanner/archive/master.zip
2. Install dependencies:
sudo apt install cmake g++ gcc
3. Build by executing in source directory:
cmake .
make
sudo make install
• Gradio
1. Download and extract source from: 'https://github.com/haecker-felix/Gradio/archive/master.zip'.
2. Install dependencies:
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libjson-glib-dev libsoup2.4-dev libsqlite3-dev meson valac
3. Build by executing in source directory:
meson build .
cd build
ninja
sudo ninja install
• notepadqq
sudo add-apt-repository -y ppa:notepadqq-team/notepadqq
sudo apt update
sudo apt install notepadqq
• Onion Share
sudo add-apt-repository ppa:micahflee/ppa
sudo apt update
sudo apt install -y onionshare
• Papirus Icon theme:
sudo add-apt-repository ppa:papirus/papirus
sudo apt update
sudo apt install papirus-icon-theme
• PiAware:
1. Install PiAware repository package:
wget http://uk.flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_3.6.2_all.deb
sudo dpkg -i piaware-repository_3.6.2_all.deb
2. Install PiAware:
sudo apt update
sudo apt install piaware
3. To enable automatic and manual (web-based, via your request) PiAware
software updates (disabled by default):
sudo piaware-config allow-auto-updates yes
sudo piaware-config allow-manual-updates yes
• Python3 related:
sudo apt install \
python3-numpy
python3-opencv
python3-pil.imagetk
python3-pip
opencv-contrib-python
python3-serial
python3-setuptools
python3-tk
• Swift:
1. Install dependencies:
sudo apt install libz3-4 libz3-dev
2. Download binary:
https://swift.org/builds/swift-5.2.5-release/ubuntu2004/swift-5.2.5-RELEASE/swift-5.2.5-RELEASE-ubuntu20.04.tar.gz
3. Extract binaries in your PATH.
• QGIS:
1. Add key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 51F523511C7028C3
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key CAEB3DC3BDF7FB45
2. Add to apt source:
echo "deb http://qgis.org/ubuntu bionic main" | sudo tee --append /etc/apt/sources.list.d/qgis.list
echo "deb-src http://qgis.org/ubuntu bionic main" | sudo tee --append /etc/apt/sources.list.d/qgis.list
3. Install:
sudo apt update && sudo apt install qgis python-qgis qgis-plugin-grass
• TeamViewer:
1. Install dependencies:
sudo apt install qml-module-qtgraphicaleffects \
qml-module-qtquick2 \
qml-module-qtquick-controls \
qml-module-qtquick-dialogs \
qml-module-qtquick-layouts \
qml-module-qtquick-privatewidgets \
qml-module-qtquick-window2
2. Download and install DEB from:
https://www.teamviewer.com/en/download/linux/
* https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
• Tor Browser
sudo add-apt-repository ppa:micahflee/ppa
sudo apt update
sudo apt install torbrowser-launcher
• uGet Integration:
sudo add-apt-repository -y ppa:uget-team/ppa
sudo apt update
sudo apt install uget-integrator
• Veracrypt:
https://www.veracrypt.fr/en/Downloads.html
* To disable prompt for administrator password execute:
echo "ALL ALL = NOPASSWD:/usr/bin/veracrypt" | sudo tee /etc/sudoers.d/veracrypt
• VirtualBox:
1. Add repository keys:
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
2. Add repository:
sudo apt-add-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib"
3. Install:
sudo apt update
sudo apt install virtualbox-6.0
* Enable USB for VirtualBox machines:
sudo usermod -a -G vboxusers $(whoami)
* Fix GTK theme:
- Change launcher to execute 'VirtualBox -style Fusion %U'
- Add to file '/etc/environment': 'QT_QPA_PLATFORMTHEME=gtk2'
• Wine:
Installing Wine:
1. If your system is 64 bit, enable 32 bit architecture (if you haven't already):
sudo dpkg --add-architecture i386
2. Add repository:
wget -q https://dl.winehq.org/wine-builds/winehq.key -O- | sudo apt-key add -
3. Add repository:
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
4. Update packages:
sudo apt update
5. Install stable branch:
sudo apt install --install-recommends winehq-stable
Download for offline install:
1. On the machine with internet, add the WineHQ PPA, then cache just the
necessary packages without actually extracting them:
sudo add-apt-repository -y ppa:wine/wine-builds
sudo apt update
2. Then cache just the packages necessary for installing wine, without extracting them:
sudo apt clean
sudo apt-get --download-only install winehq-stable
sudo apt-get --download-only dist-upgrade
3. Files will be downloaded to /var/cache/apt/archives
• WxWidget:
1. Stable:
sudo apt update && sudo apt install libwxbase3.0-0v5 \
libwxbase3.0-dev \
libwxgtk3.0-0v5 \
libwxgtk3.0-dev \
wx3.0-headers \
wx-common \
libwxgtk-media3.0-0v5 \
libwxgtk-media3.0-dev \
libwxgtk-webview3.0-gtk3-0v5 \
libwxgtk-webview3.0-gtk3-dev \
wx3.0-i18n \
wx3.0-examples
2. Unstable:
a. Add key:
sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
b. Add repository:
sudo sudo apt-add-repository 'deb http://repos.codelite.org/wx3.1.1/ubuntu/ bionic universe'
c. Install:
sudo apt update && sudo apt install libwxbase3.1-0-unofficial3 \
libwxbase3.1unofficial3-dev \
libwxgtk3.1-0-unofficial3 \
libwxgtk3.1unofficial3-dev \
wx3.1-headers \
wx-common \
libwxgtk-media3.1-0-unofficial3 \
libwxgtk-media3.1unofficial3-dev \
libwxgtk-webview3.1-0-unofficial3 \
libwxgtk-webview3.1unofficial3-dev \
libwxbase3.1-0-unofficial3-dbg \
libwxgtk3.1-0-unofficial3-dbg \
libwxgtk-webview3.1-0-unofficial3-dbg \
libwxgtk-media3.1-0-unofficial3-dbg \
wx3.1-i18n \
wx3.1-examples
* First six packages are required; rest optional (and of decreasing
importance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment