Vim - Save file as root without reopening file

File requires root permission to be written, but sometimes we forget to add sudo before vim command. The result is after editing the file with a lot of changes, :w cannot save them.

This can be avoided by adding a simple command to $HOME/.vimrc:

cmap w!! w !sudo tee > /dev/null %

Then when we type :w!!, it will be mapped to :w !sudo tee > /dev/null %, which will let we save the file with sudo without re-opening the file.

[Read More]
vim 

Setup Bridged Wireless Access Point on Raspberry Pi 4

                                         +- RPi -------+
                                     +---+ 10.10.0.2   |          +- Laptop ----+
                                     |   |     WLAN AP +-)))  (((-+ WLAN Client |
                                     |   |  Bridge     |          | 10.10.0.5   |
                                     |   +-------------+          +-------------+
                 +- Router ----+     |
                 | Firewall    |     |   +- PC#2 ------+
(Internet)---WAN-+ DHCP server +-LAN-+---+ 10.10.0.3   |
                 |   10.10.0.1 |     |   +-------------+
                 +-------------+     |
                                     |   +- PC#1 ------+
                                     +---+ 10.10.0.4   |
                                         +-------------+
[Read More]

Upgrade Fedora 36 to Fedora 37

  • Update Fedora 36:

    sudo dnf upgrade --refresh
    
  • Reboot.

  • Install dnf-plugin-system-upgrade if not installed:

    sudo dnf install dnf-plugin-system-upgrade
    
  • Download Fedora 37 packages:

    sudo dnf system-upgrade download --releasever=37
    
  • Start upgrading. This will reboot machine:

    sudo dnf system-upgrade reboot
    
  • Wait until upgrading finish.

References

https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/

fedora