Skip to content
Nils Deppe edited this page Nov 25, 2020 · 127 revisions

Welcome to the MyEnvironment wiki!

Installs

Things I always need to install:

From command line:

sudo apt-get update -y && \
sudo apt-get install -y gcc g++ gfortran \
                        gdb git autoconf \
                        libopenblas-dev liblapack-dev \
                        libhdf5-dev hdf5-tools \
                        libgsl0-dev \
                        clang clangd clang-format clang-tidy \
                        wget libncurses-dev \
                        lcov cppcheck ninja-build \
                        libboost-dev libboost-program-options-dev \
                        libboost-thread-dev libboost-tools-dev libssl-dev \
                        libbenchmark-dev curl protobuf-compiler libprotobuf-dev && \
sudo add-apt-repository universe && sudo apt-get update -y && \
sudo apt-get install -y curl python3-pip python-is-python3 python3-numpy \
                        python3-ipython python3-scipy python3-h5py && \
sudo apt-get install -y texlive-base texlive-latex-recommended texlive \
                        texlive-latex-extra texlive-science texlive-pstricks && \
sudo apt-get install -y ccache doxygen libc++-dev libc++1 libc++abi-dev && \
sudo apt-get update -y && sudo apt-get install -y libjemalloc2 libjemalloc-dev && \
sudo apt-get install -y zsh && \
sudo apt-get install -y fonts-powerline jupyter gnome-tweaks emacs tmux xsel \
                        ripgrep linux-tools-common linux-tools-generic \
                        lm-sensors htop darktable vlc gufw sshfs python3-numpy \
                        python3-scipy python3-matplotlib python3-pandas earlyoom && \
sudo pip3 install thefuck python-language-server plotnine

CMake

  • In order to use CMake with ninja-build we need to build the latest version of CMake from source.
  • wget https://github.com/Kitware/CMake/archive/v3.18.2.tar.gz
    tar xf  v3.18.2.tar.gz
    cd cmake
    ./bootstrap
    make -j4
    sudo make install
    

Gnome tweaks

  • Keyboard & Mouse:
    • Emacs Input: On
    • Additional Layout Options:
      • Caps Lock Behavior: Caps Lock is also a Ctrl
      • Alt/Win key behavior: Alt is swapped with Win
  • Top Bar:
    • Battery Percentage: On
    • Seconds: On
    • Weekday: On
  • Startup Applications:
    • Dropbox
    • Google Chrome
    • Insync
    • Signal
    • Slack
    • Private Internet Access
  • Appearance
    • Applications: Yaru-dark (or some other dark theme)

Settings

  • Appearance:
    • Auto-hide the dock: on
    • Icon size: really tiny
  • Keyboard Shortcuts:
    • Move to workspace above: Ctrl+Alt+P
    • Move to workspace below: Ctrl+Alt+N
    • Switch applications: Alt+Tab
    • Switch windows: Super+Tab
    • Lock screen: Ctrl+Alt+L
  • Displays
    • Enable Night Light
  • Universal Access
    • Always Show Universal Access Menu (Use for "Large Text" on HiDPI displays)

Removing snap

  • The snap system and store basically results in running apps installed via a snap in containers. It's much better to get a PPA to install from or to build from source. I also had snapd use 100% CPU a few times, which was rather annoying.
  • Run
    snap list
    
    which will give you a list of all the snaps installed.
  • Run
    sudo snap remove snap-store
    sudo snap remove gtk-common-themes
    sudo snap remove gnome-3-34-1804
    sudo snap remove core18
    
    If there are other snaps installed, remove them too. Note that you can't remove the snap core in this step.
  • Stop the daemon:
    sudo systemctl stop snapd
    
    and then unmount every directory inside /snap/core by running
    sudo umount /snap/core/xyz
    
  • Purge snap:
    sudo apt purge snapd
    
  • Remove straggler directories and files
    rm -rf ~/snap
    sudo rm -rf /snap /var/snap /var/lib/snapd
    
  • If you want the gnome/ubuntu app store but without snap do:
    sudo apt install gnome-software
    sudo apt purge snapd
    

Nautilus (Ubuntu file manager)

  • Zoom: 50%
  • Preferences -> Views -> Sort -> disable Sort folders before files
  • Preferences -> List Columns -> Modified -- Time

Terminal

  • Profile -> Text -> Initial terminal size: 81 columns x 24 rows
  • Custom font size monospace 9
  • Colors: Built-in schemes: white on black (you might need to set cursor color to white+white to have the cursor show up...)
    • Palette: Linux console

ZSH

  • Set up oh-my-zsh
  • Symlink .zshrc file from MyEnv directory

Emacs

  • Build YCMD in ~/Research/ycmd
  • Symlink .emacs.el
  • A systemd unit is included in Emacs 26.1. The unit is installed with Emacs, but it must be enabled after installing Emacs:
    systemctl --user enable --now emacs
  • To have the option to connect to the Emacs daemon as the "Default Application" in the file browser add the file ~/.local/share/applications/EmacsGuiDaemon.desktop with:
    #!/usr/bin/env xdg-open
    [Desktop Entry]@geoffrey4444 can you review this?
    Version=1.0
    Terminal=false
    Name=Emacs Daemon (GUI)
    GenericName=Text Editor
    Comment=View and edit files
    MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++/x-python;
    Exec=/usr/bin/emacsclient -c -a "/usr/bin/emacs" %F
    Type=Application
    Terminal=false
    Categories=Utility;Development;TextEditor;
    
  • To get GPG pinentry working on Debian/Ubuntu you need to build pinentry yourself. This is easy to do, e.g. http://www.linuxfromscratch.org/blfs/view/svn/general/pinentry.html First install the dependencies:
    sudo apt install libassuan-dev libgpg-error-dev
    
    The following configure command is reasonable:
    ./configure --prefix=/usr/local --enable-pinentry-tty --enable-inside-emacs=yes --enable-pinentry-gtk2=yes
    
    Then you need to update ~/.gnupg/gpg-agent.conf to have
    pinentry-program /usr/local/bin/pinentry
    allow-emacs-pinentry
    
    and run
    gpgconf --reload gpg-agent
    
    to reload the GPG agent.

ccache

  • Edit ~/.ccache/ccache.conf to be:
    max_size = 40G
    

CTags and GNU Global

  • Need to install universal CTags from scratch
    git clone [email protected]:universal-ctags/ctags.git && \
    cd ctags && \
    ./autogen.sh && \
    ./configure && \
    make -j4 && \
    sudo make install && \
    cd .. && rm -rf ./ctags
    
  • Need to install GNU Global from scratch, e.g.
    wget http://tamacom.com/global/global-6.6.5.tar.gz && \
    tar xzf global-6.6.5.tar.gz && \
    cd ./global-6.6.5 && \
    ./configure --with-universal-ctags=/usr/local/bin/ctags --prefix=/usr/local/ && \
    make -j4 && \
    sudo make install && \
    cd .. && \
    rm -rf ./global-6.6.5 ./global-6.6.5.tar.gz
    

tmux

  • Install https://github.com/thewtex/tmux-mem-cpu-load/
  • Need a fresh clone of tmux plugin manager, tpm: git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  • Use M-[ i to install plugins
  • Use M-[ u to update plugins
  • Use M-: resize-pane -x 105 to resize panes
  • Use M-: select-layout even-horizontal to evenly distribute panes horizontally

Nautilus

  • To have Documents go to the Dropbox and disable desktop edit ~/.config/user-dirs.dirs with:
    #XDG_DESKTOP_DIR="$HOME/Desktop"
    XDG_DOWNLOAD_DIR="$HOME/Downloads"
    XDG_TEMPLATES_DIR="$HOME/Templates"
    XDG_PUBLICSHARE_DIR="$HOME/GoogleDrive/Public"
    XDG_DOCUMENTS_DIR="$HOME/GoogleDrive/Documents"
    #XDG_MUSIC_DIR="$HOME/GoogleDrive/Music"
    XDG_PICTURES_DIR="$HOME/GoogleDrive/Pictures"
    #XDG_VIDEOS_DIR="$HOME/GoogleDrive/Videos"
    
  • Have files and folders intermixed: Preferences -> Views -> Sort -> uncheck Sort folders before files

LaTeX

  • Install additional things from CTAN using tlmgr:
    tlmgr install bbold --verify-repo=none
    
    if you get a verify_checksum: -5 then the repo is not correctly checked, likely because PGP key is wrong. That's why there's the --verify-repo=none

Dolphin

  • Best built from scratch so that Vulkan can be used. Need:

    sudo apt install git ffmpeg libavcodec-dev libevdev-dev libusb-1.0-0-dev libavformat-dev libswscale-dev libsfml-dev libminiupnpc-dev libmbedtls-dev curl libhidapi-dev libwxbase3.0-dev libwxgtk3.0-gtk3-dev libpangocairo-1.0-0 libgtk2.0-dev libbluetooth-dev qt5-default qtbase5-private-dev libudev-dev libfmt-dev libasound2-dev
    
  • To get the GC adapter to work:

    Open /etc/udev/rules.d/51-gcadapter.rules

    Add:

    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", MODE="0666"
    

    Reboot

Insync

  • Install insync-nautilus to get file browser integration

  • Ignore rules:

    *build_*
    *.o
    */charm_*/multicore-linux64-gcc
    */charm_*/multicore-linux64-clang
    *__pycache__
    
  • Preferences: Zoom: 150%

    Preferences: Uncheck Anonymously send usage data to Insync otherwise the app seems to have trouble syncing when using PIA mace to prevent contacting of ad sites

SpECTRE

Docker

  • To use Docker with out sudo:
    • sudo groupadd docker
    • sudo gpasswd -a $USER docker
    • Logout/in, restart, or run newgrp docker
  • Logging into Docker Hub do docker login, which will ask you for your username and password.

Uncomplicated Firewall

  • Open the GUI app and enable

Mosh

  • Install mosh from the git repo: https://mosh.org/#getting

  • Open SSH port (22 TCP, in only) on firewall (could use a non-standard port for extra security)

  • Open UDP port for mosh (60000 UDP, in only) on firewall (I use 60000)

  • Add SSH public key to ~/.ssh/authorized_keys for passwordless connection

  • Run mosh -p 60000 SERVER to connect.

  • Unlike SSH, you can't forward SSH keys with Mosh. This is intentional and the way SSH actually forwards SSH keys is spooky. Your private key is effectively copied to the remote server and anyone with root access on that machine can access your private key. To forward SSH keys for use with Mosh there is Guardian Agent. While still fairly young and not nearly as well-vetted as Mosh, it is still much safer than SSH key forwarding. Every time the remote server needs to access your SSH keys you will be requested to approve on your local machine. Without your approval there is no access to the private key(s).

    Another option is that if you're using Mosh to connect to a work desktop which has SSH keys is to simply add the SSH keys to your session. This is done by running ssh-add.

Early OOM Killer

Singularity

Clone this wiki locally