Skip to content

Latest commit

 

History

History
380 lines (327 loc) · 18.1 KB

ubuntu-22.04_jammy_framework.md

File metadata and controls

380 lines (327 loc) · 18.1 KB

Created as a copy of the 21.04 document on 2022-07-16.

>> lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04 LTS
Release:	22.04
Codename:	jammy
>> python3 --version
Python 3.10.4

Notes and Assumptions

  • When ordering a computer you do NOT want vPro in your Wifi chip. From what I read it has a remote machine takeover. Was designed for corporations to have access to employee laptops.
  • As a whole this document lists steps to do in order. Or at least an order that should work. That said, mix and match and YMMV.
  • This set of assumptions are based on installing Ubuntu 22.04 LTS(July 7, 2022). By default:
    • Some level of Wi-fi works
    • Firefox is installed
    • External Monitor plug-in works
    • Connecting a printer works
    • LibreOffice is installed
  • You want a computer mirroring Alison's setup. Mix-and-match as desired. Use at your own risk as the GNU GPLv2 license says.
  • You will need a USB key (portable USB) that is at least 4 GB large. This will allow you to make an Ubuntu bootable USB so you can install the OS on your new machine. PLEASE BE AWARE you have to DELETE everything on it in order to do this*... pick a USB key to use accordingly.
  • These instructions will get out of date relatively quickly.

Remember

Shift+Cnl+C or +V to copy and paste into terminal.

INSTALL

Default Install

I integrated lots of info from lots of thread, however the Official Frame.work Ubuntu 22.04 Install Guide is available.

  1. Install stuff in Terminal that you'll need later.
    sudo apt-get update
    sudo apt upgrade -y
    sudo apt-get install vim
    sudo apt-get python3-gpg            #needed for Dropbox file signature verification and otherwise handy
    sudo apt install gnome-tweaks       #to get 2 finger right click to work.
    sudo apt install gdebi              #GUI for package installation. recommended by Zoom install page.
    mkdir ~/Sites                       #directory to clone repos to so that you don't have problems with Dropbox sync
    sudo vim /etc/modprobe.d/alsa-base.conf     #enable headset mic input
    [scroll to end of file]
    i
    enter
    options snd-hda-intel model=dell-headset-multi
    esc
    :qw
  2. Run all updates in Ubuntu Software.
  3. Run all updates in Software Updater.
  4. Probably a good place to restart if you haven't recently.
  5. Plug-in external monitor.
  6. Login to Firefox account. Confirm Firefox Extensions. This adds bookmarks and passwords too.
  7. Mozilla VPN. instructions
    sudo add-apt-repository ppa:mozillacorp/mozillavpn
    sudo apt-get update
    sudo apt-get install mozillavpn
    Open the MozillaVPN app. Login via web browser to Firefox account.
  8. Improve power usage on sleep/suspend.
    # On some SSDs (e.g. SN750 with older firmware), there is a workaround to improve suspend battery life
    #   How to change grub options in general https://linuxhint.com/change-grub-options/
    #   why change from deep sleep like used in 21.04 https://community.frame.work/t/linux-battery-life-tuning/6665#suspend-power-usage-2 AND default enabled in 22.04
    #   from frame.work instructions: sudo sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvme.noacpi=1/g' /etc/default/grub
    
    sudo cp /etc/default/grub /etc/default/grub.bak     #make backup of file before changing it
    sudo vim /etc/default/grub
    [scroll to end of tile]
    i
    enter
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvme.noacpi=1"
    esc
    :qw
  9. confirm change
    cat /sys/power/mem_sleep
    ## note this isn't updating for me from the `[s2idle] deep` response even after reboot
    
    # Then refresh the GRUB configuration
    sudo update-grub
    
    # And reboot
    sudo reboot
  10. Deep sleep seems to be enabled already for 22.04. Confirm that cat /sys/power/mem_sleep returns [s2idle] deep or see Enable Deep Sleep
  11. Install Sublime Text
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
    "translate_tabs_to_spaces": true, 
    "highlight_modified_tabs": true, 
    "bold_folder_labels": true, 
    "show_encoding": true, 
    "binary_file_patterns": ["*.epub"],
    "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS"],

}

Install as One-offs

  1. Install Zoom Zoom's Instructions
    • Login to Zoom.
  2. Install Dropbox Downloads page
    • Login to Dropbox.
    • Pause Syncing
    • Select folders for selective sync. Do a set, then another set, then another set so that you have the files you most need available first.
  3. Install Webex (yes there are people who still use this) where to download .deb package

Install from Ubuntu Software

  • Audacity (audio)
  • Calibre (ebook library) (copy your existing library into place from a backup first)
  • dBeaver and/or BeeKeeper Studio (DB client)
  • GIMP (non-vector art, but easier). Note "digital signatures" in this app means signed certificate signatures. To add an image signature you have to add a new layer based on opening a file. Then you have to scale the image signature layer by clicking on the layer name and scaling that layer specifically.
  • Inkscape (vector art)
  • postman (API call making and testing)
  • ?? qownnotes (notes) / Joplin
  • Slack
    • Login to Slack
  • VLC (video)
  • Brasero (burn cd, dvd)

Install from Snap ("Software" app)

  1. Microsoft Teams. There are reports that Microsoft Teams doesn't work unless installed through Snap. So, do this.
    #install Microsoft Teams without error by using snap
    #https://techviewleo.com/install-and-use-microsoft-teams-on-ubuntu/
    sudo apt install snap                       #confirm installed
    sudo systemctl enable --now snapd.socket    #enable snap
    sudo ln -s /var/lib/snapd/snap /snap        #make sym link
    sudo snap install teams-for-linux           #install Microsoft Teams
  2. I never use VSCodium, so strike it from instructions. VSCodium - the privacy-aware Visual Studio Code. Text-based coding IDE. Binary releases of VS Code without MS branding/telemetry/licensing
  3. Extension Manager

Install from Flatpak

  1. Toggl stopped supporting Linux desktop app. -Install Toggl Timer. Linux instructions with flatpak.
    • install flatpak
      sudo apt install flatpak
      sudo apt install gnome-software-plugin-flatpak
      flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
    • Restart.
    • Open "Software" app. Search for toggl and install "Toggl Track".-
  2. Install the Github Desktop app.
    • In the app, login to Github.
    • Clone repos from Gitlab with your Gitlab personal access token in Terminal.

Install for Development Environment

  1. Python

Note, python does not work in the Terminal. That's because there's no alias from python3 to python. If python does work then .bashrc has to refer to /usr/bin/python instead of what's below. Yes, the lack of this alias then creates a mis-match between virtualenv(wrapper) and the VSCodium python interpreter setting. That said, I have yet to try VSCodium to run Python, so maybe it can't detect the /python3(non-alias) version? Python 3.10.4 is the result in the Terminal and and Python 3.10.6 is mentioned in the VSCodium dialogue to select a python interpreter, which strengthens this theory.

🤷 You will have virtualenv and virtualenvwrapper for MyCroft and python scripting without Docker containers.

```bash
python3 --version
    > Python 3.10.4
sudo apt-get install python3-pip build-essential # python-dev was here but no longer has an installation candidate

# Both `pip --version` and `pip3 --version` work and are the same result.

sudo pip install --upgrade pip              # --upgrade pip3 won't work
sudo pip install --upgrade virtualenv 
sudo pip install --upgrade virtualenvwrapper

# Setup virtualenvwrapper
# Reference, but not enough https://virtualenvwrapper.readthedocs.io/en/latest/
cd ~/
export WORKON_HOME=~/Envs
mkdir -p $WORKON_HOME
sudo vim .bashrc
[scroll to bottom] 
i
#virtualenvwrapper config
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=~/Envs
source /usr/local/bin/virtualenvwrapper.sh
[ESC]
:w
:q
```

#  5. Run: workon
#  6. A list of environments, empty, is printed.
#  7. Run: mkvirtualenv temp
#  8. Run: workon
#  9. This time, the "temp" environment is included.
# 10. Run: workon temp
# 11. The virtual environment is activated. Maybe you want to install pandas.
```

1. Open VSCodium(privacy version of Visual Studio Code) that was installed above. * Color Theme: Monokai Dimmed * Language support: * Search @builtin will have the following installed: HTML, JavaScript, JSON, Markdown, Python, Shell Script, SQL, and YAML Language Basics * Search with @sort:rating or @sort:installs to find the following * Don't install SQLTools - it's not great. Use a dedicated SQL client. * YAML from Redhat * Better Jinja from samuelcolvin * an icon package (Material Icon Theme by PKief with 107k+ downloads) * Rainbow CSV * Consider in future: Bookmarks, XML, Python Extension Pack, Bootstrap 4 and/or Bootstrap 5 & Font Awesome Snippets, Debugger for Firefox, Highlight Matching Tag, Paste JSON as Code, MySQL, Github Respositories, AWS Toolkit, Docker, Snowflake Driver for SQLTools, SQLTools PostgreSQL/Redshift Driver, SQL(BigQuery), sqlfluff, one of the dbt ones, Color Picker or Color Highlight or something else, a TODO one * Select your python interpreter (Recommended: /usr/bin/python Python 3.10.6 64-bit)

  1. Docker for Ubuntu and follow the post-install linux instructions

  2. Postgres Source (CHECK THESE to ensure they are up-to-date)

    sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
    wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
    sudo apt-get update
    sudo apt-get install postgresql postgresql-contrib
    sudo su - postgres
    psql

    Make sure postgres is running and get to a place you can run commands:

    sudo systemctl start postgresql.service
    sudo -i -u postgres
    

    Find the port Postgres is running on. Default is 5432.

    \conninfo
    \q
    

    Create user for postgres and system. Assumes postgresql-contrib installed above. Reference page

    #in shell prompt
    createuser [username]
    su - [admin username]
    cd [directory to save postgres db]
    sudo adduser [username]
    sudo -u [username] psql
    #in postgres prompt
    createuser [new_username] --interactive
    #answer prompts
    createdb [new_username]
    \conninfo #to check, especially port
    \password #set password
    exit
    # bash back to yourself `sudo -i -u [computer_user]`
    # bash create a linux user to match the postgres user `sudo adduser [new_username]` #use the same pw as the postgres user to avoid confusion.
    #answer prompts
    
  3. Navicat After downloaded, cd to directory in terminal and ./navicat16-premium-en.AppImage.

  4. Install some servers. Source

    sudo apt-get install git nginx gunicorn
  5. In .bashrc, [change HISTFILESIZE=2000 to 20000] ```

Configuration

  1. If you haven't for awhile, this is a good time to restart.
  2. Favorite Apps to your dock/sidebar. You want a minimum of: Terminal, System Monitor, Settings, Firefox, Files, Slack, Zoom, Calculator, Note-taking app(Joplin)), Thunderbird or email client, and "Software"(instead of Ubuntu Software)
  3. Change dot files to personal defaults
    • DO WITH CAUTION, these are out of date and probably are missing things from above. .bash_profile on Mac = .profile on Linux Ubuntu. See Mac OS in this repo.
  4. Log into Zoom and Microsoft Teams (and Webex) to make sure your mic and video are permissioned and working.
  5. Log into Pocket and Pinterest from your browser.
  6. Setup relevant email accounts in Thunderbird or other smail client.
  7. Plug-in printer to get it recognized and print test page.
  8. Install GNOME Extensions. I'm experimenting with the following.

Configure via Terminal

  1. sudo apt-get install chrome-gnome-shell to be able to add gnome extensions from the browser (later linux versions gnome-browser-connector)
  2. gnome-tweaks will open some configuration settings.
    • General > "Suspend when laptop lid is closed" to on
    • Startup Applications >
      • Dropbox (should be there already)
      • Mozilla VPN (consider)
    • Top Bar >
      • Flip Weekday to on
    • Window Titlebars >
      • Under Titlebar Buttons change Placement to Left. (Make it easier to switch between Mac and Linux.)
      • Under Titlebar Actions change Double-Click to "Toggle Maximize Vertically". (Might be the Xoom answer.)

Settings

  1. Tweak setting on how long to wait before sleeping (1 minute is too short)
    • Settings > Power > Power Saving > Automatic Suspend.
    • On Battery Power 15 minutes.
    • On Plugged In 30 minutes.

Takes Time but worth doing

  1. Setup addiitonal permissions groups
  2. Setup a guest account
  3. Disk level encryption
  4. Copy to or create new SSH keys for commputer

Chosen against

  1. Flameshot - way too easy to accidently upload to public web
  2. VSCodium - I can't get used to it.

TODO

  1. Screenshots
  2. Note-taking (Joplin ATM)
  3. Passwords
  4. Shortcut to put computer to sleep
  • Yes, if you're really geeky/knowledgeable/willing to take risks this is not an absolute.