Skip to content

Instantly share code, notes, and snippets.

@marcelomgarcia
Last active April 3, 2024 10:47
Show Gist options
  • Save marcelomgarcia/d5eba8d0294a1b0a5ed2263dbb27cdec to your computer and use it in GitHub Desktop.
Save marcelomgarcia/d5eba8d0294a1b0a5ed2263dbb27cdec to your computer and use it in GitHub Desktop.
Configuration after a fresh install of Ubuntu
alias ll='ls -lh'
alias lll='ll -tr'
alias lls='ll -Sr'
alias tnew='tmux new -s ARDA'
alias ta='tmux a -d'
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Useful bindings
bind ^ command-prompt -p "joinp>" "join-pane -s %1"
bind / command-prompt -p "man>" "split-window -h -l 80 'exec man %%'"
bind S command-prompt -p "ssh>" "new-window -n %1 'ssh %1'"
bind m swapp -s 0 -t 1
bind e attach -d
bind C-a last-window
# don't rename windows automatically
set-option -g allow-rename off
# VI binging
set -g mode-keys vi
# Environment
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
syntax on
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set smartindent
set expandtab
Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p.socket
ControlMaster auto
ControlPersist 10m
Host test
Hostname lthlibtest.kaust.edu.sa
User a-garcm0b
Host prod
Hostname lthlibprod.kaust.edu.sa
User a-garcm0b
Host elk
Hostname 10.254.147.159
User a-garcm0b
Host pub
Hostname lthlibpub.kaust.edu.sa
User a-garcm0b
Host mig
Hostname 10.127.6.30
User a-garcm0b
Host lthlibdb
Hostname 10.127.6.29
User a-garcm0b
Host ibex
Hostname ilogin.ibex.kaust.edu.sa
User garcm0b
Host nomad
Hostname 10.127.6.89
User a-garcm0b

After installing Ubuntu

Enable minimise on click

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'focus-minimize-or-appspread'

Firefox

Firefox ppa

sudo snap remove firefox

sudo add-apt-repository ppa:mozillateam/ppa

echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox

echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox

sudo apt install firefox

optional:
sudo apt install gnome-shell-extension-manager

Firefox extensions

Suggested Firefox extensions

DEB

sudo apt install gnome-tweaks gnome-clocks gnome-weather
sudo apt install ubuntu-restricted-extras
sudo apt install vlc
sudo apt install git
sudo apt install python3-venv python-is-python3
sudo apt install vim
sudo apt install tmux
sudo apt install ncal
sudo apt install htop

Snap

mgarcia@arda:~$ snap info keepassxc
name:      keepassxc
summary:   Community-driven port of the Windows application “KeePass Password Safe”
publisher: Jonathan White (keepassxreboot)

Configuration

  • Download Keepass db from Google drive.
  • Gnome wallpaper

SSH

Create ssh keys with comment as hostname and Ubuntu code name, like the following comment (-C)

ssh-keygen -C arda_kinetic

Copy the key to the server

mgarcia@arda:~$ ssh-copy-id -i .ssh/id_rsa.pub a-garcm0b@lthlibtest.kaust.edu.sa

The .ssh/config it's easier to just copy-and-paste from a open window on the server.

$ ssh -l a-garcm0b lthlibtest.kaust.edu.sa
a-garcm0b@lthlibtest:~$ cat .ssh/config
Host *
    ControlMaster auto
    ControlPath ~/.ssh/master-%r@%h:%p.socket
    ControlMaster auto
    ControlPersist 10m

Host test
    Hostname lthlibtest.kaust.edu.sa
    User a-garcm0b

Host prod
    Hostname lthlibprod.kaust.edu.sa
    User a-garcm0b

Host elk
    Hostname 10.254.147.159
    User a-garcm0b

Host pub
    Hostname lthlibpub.kaust.edu.sa
    User a-garcm0b


a-garcm0b@lthlibtest:~$ 

Access the library servers and download the configuration files:

mgarcia@arda:~$ scp test:.vimrc .
.vimrc                                                        100%  104    10.2KB/s   00:00    
mgarcia@arda:~$ scp test:.tmux.conf .
.tmux.conf                                                    100% 1213   116.0KB/s   00:00    
mgarcia@arda:~$ 
mgarcia@arda:~$ scp test:.bash_aliases .
.bash_aliases                                                 100%  134    13.9KB/s   00:00    
mgarcia@arda:~$ 

Extras

Virtualization

  • Virtualbox
  • Vagrant
  • Docker Desktop

Reference

https://ubuntuhandbook.org/index.php/2022/10/top-things-ubuntu-22-10/

Windows Configuration

WSL

To install the WSL component on Windows, use the Opitional Features instead of suggested command:

Settings -> Apps -> Optional features -> More Windows Features -> Windows Subsystem for Linux

Also enable support for VM:

Settings -> Apps -> Optional features -> More Windows Features -> Virtual Machine Platform

Install the Linux kernel update package (step 4) in Manual installation steps for older versions of WSL

Set WSL 2 as default (step 5)

wsl --set-default-version 2

Install Ubuntu from the Microsoft Store, and at the end, open it to finish the installation.

Docker

Adding a regular user to docker group

PS C:\Windows\System32> net localgroup docker-users "mgarcia" /ADD

VirtualBox

Instalation of VirtualBox 7.X requires Microsoft C++ 2019 redistributable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment