Skip to content

Latest commit

 

History

History
287 lines (202 loc) · 7.18 KB

notes.org

File metadata and controls

287 lines (202 loc) · 7.18 KB

Notes

Manual steps

This section is a reminder about steps that are still manual. They could be automated in the future.

Cloning my Org repo

  1. Add the SSH key to the authorized_keys file on the server:
    ssh-copy-id -i [key] -p 2222 [ip]
        
  2. Clone the repo:
    git clone ssh://[user]@[ip]:[port]/[path-to-repo]
        

Importing GPG keys

  1. Export keys on a computer that has them:
    gpg --export [public-id] > public.key
    gpg --export-secret-keys [secret-key] > private.key
        
  2. Copy the keys with scp:
    scp private.key public.key [user]@[ip]:[path]
        

Creating a local config

Remember to create a local config for:

  • i3
  • Emacs (alc-local.el)
  • etc.

It seems that a SSH port can’t be specified in .gitmodules. So you need to create a ~/.ssh/config file (chmod 600) that contains something like:

Host [ip]
Port 2222

Then the port will be automatically right when initialiazing the submodule. Be careful, apparently the .git/config file is updated after the first try so you need to delete any wrong entry.

Tasks

  • [X] Pull dotfiles submodules. The new workstation must register itself to Github (SSH key) or a SSH keypair must be created beforehand as a manual step.
  • [X] Do not re-execute Stow every time
  • [X] Reduce manual steps to a minimum
  • [X] Switch from tasks to roles
  • [ ] Customize the Debian installation. Interesting links:
  • [ ] Study the difference between import and include and act accordingly
  • [ ] Read about Molecule
  • [ ] Deploy Firefox with extensions
  • [ ] Create a Docker role
  • [ ] Facilitate the configuration of WSL using this Ansible repository
  • [ ] Use SDKMAN! instead of apt for SDKs
  • [ ] Roles should be independent of each other
  • [X] Install the fonts patched for Powerline

    Ansible now installs JetBrains Mono, which supports Powerline \o/

  • Optimize battery usage. Using powerstat, on idle:

    System: 26.35 Watts on average with standard deviation 0.06

    After installing tlp and rebooting:

    System: 5.91 Watts on average with standard deviation 0.03

  • Packages to install :
    • [ ] synclient
    • [ ] xserver-xorg-input-synaptics
    • [ ] veracrypt – check this.
    • [X] signal-desktop
    • [X] tlp
    • [X] zip
  • [ ] GnuPG : use the console PIN entry
  • Install zsh plugins
    • [X] zsh-syntax-highlighting
    • [ ] zsh-autocomplete
    • [ ] zsh-autosuggestions
  • [ ] Improve the management of an overall “state”: the list of packages, for example, of the fact that a specific role should be activated or not, should depend on a host. It is impossible to always maintain a specific host in a desired state by just using tags one by one.

Windows

I did not explore the possibilities of Ansible on Windows. This checklist helps me remember how to set up my system.

WSL2

  • Ansible could at least be used for WSL2 with a dedicated tag
  • To check available distributions:
    wsl -l -o
        
  • To install Debian:
    wsl --install -d Debian
        

    …and then reboot.

  • Configure Windows Terminal
  • Debian can be launched in Windows Terminal with wsl -d debian.
  • To browse WSL from the Windows Explorer, just type \\wsl$.
  • Use my usual dotfiles with fonts patched for Powerline

Emacs

Install Emacs

From here.

Launch the Emacs daemon on startup

  • Create an emacs-daemon.bat somewhere:
    @echo off
    emacs.exe "--daemon"
        
  • Create a .vbs file in the Windows startup directory:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "[path]\emacs-daemon.bat" & Chr(34), 0
Set WshShell = Nothing

Launch a client

emacsclientw.exe -c -n -a ""
-n
Do not wait for the client to finish when you’re launching

from command line.

-a
Specify an alternative editor if the emacs server isn’t running, but if you give it an empty string, it will try to start the emacs server and connect to it.
-c
In a windows shortcut, open a new frame.

Create a context menu

  • Create emacs_explorer.reg:
    Windows Registry Editor Version 5.00
    ;; Be sure to set the correct path to Emacs on your system!
    [HKEY_CURRENT_USER\Software\Classes\*\shell]
    
    ;; Open file in existing frame
    [HKEY_CURRENT_USER\Software\Classes\*\shell\emacsopencurrentframe]
    @="&Emacs: Edit in existing window"
    "icon"="C:\\path\\to\\emacs\\bin\\emacsclientw.exe"
    [HKEY_CURRENT_USER\Software\Classes\*\shell\emacsopencurrentframe\command]
    @="C:\\path\\to\\emacs\\bin\\emacsclientw.exe -n --alternate-editor=\"C:\\path\\to\\emacs\\bin\\runemacs.exe\" \"%1\""
    
    ;; Open file in new frame
    [HKEY_CURRENT_USER\Software\Classes\*\shell\emacsopennewframe]
    @="&Emacs: Edit in new window"
    "icon"="C:\\path\\to\\emacs\\bin\\emacsclientw.exe"
    [HKEY_CURRENT_USER\Software\Classes\*\shell\emacsopennewframe\command]
    @="C:\\path\\to\\emacs\\bin\\emacsclientw.exe -n --alternate-editor=\"C:\\path\\to\\emacs\\bin\\runemacs.exe\" -c \"%1\""
        
  • Replace the paths to Emacs binaries to match the location on your system.
  • Double click the file and confirm the security warning to add this to the registry.

I use it to swap Ctrl and Caps Lock.

SDKMAN!

  • Install dependencies under WSL:
    sudo apt install zip unzip curl tar gzip
        
  • Install SDKMAN!:
    curl -s "https://get.sdkman.io" | bash
        

IntelliJ

  • Add WSL to the trusted locations before using WSL in IntelliJ.