home scroll git

Ubuntu

GRUB setup

https://help.ubuntu.com/community/Grub2/Setup
https://launchpad.net/grub-customizer
sudo add-apt-repository ppa:danielrichter2007/grub-customizer sudo apt-get update sudo apt install grub-customizer
If you have multiple Ubuntu OS partitions, run grub-customizer on the most recently installed one.

Virtualbox installation

On Gigabyte B450M motherboard with AMD Ryzen 5 3600 Install Virtualbox from Ubuntu software center Create VM for Ubuntu 22.04 start: get error AMD-V is disabled in the BIOS (or by the host OS) (VERR_SVM_DISABLED). AMD-V_disabled Fix: Enter BIOS Click on Advanced Frequency Settings Gigabyte_B450_BIOS_01 Click on Advanced CPU Settings Gigabyte_B450_BIOS_02 Enable SVM Mode Gigabyte_B450_BIOS_03 Gigabyte_B450_BIOS_04 https://forums.virtualbox.org/viewtopic.php?f=1&t=62339 https://www.youtube.com/watch?v=xvr7S4HTmGg
Virtualbox Guest Additions
This will add screen size resize and other goodies
Menu Devices -> Insert Guest Additions CD image
and click yes on download.
When CD symbol appears, click on it and open terminal in CD root.
run
./VBoxLinuxAdditions.run
and reboot Ubuntu VM.

snap update status

What is snap downloading, and how much more will it download?
snap changes
will list the update status:
Status Spawn Ready Summary
91 Error yesterday at 18:04 CST yesterday at 18:07 CST Auto-refresh snaps "code", "firefox"
92 Doing today at 19:14 CST - Auto-refresh snaps "code", "libreoffice"

snap watch 92
will show the progress of the individual update.
https://askubuntu.com/questions/1144822/how-to-know-what-snapd-is-downloading-and-when-will-it-finish

snap storage space

snap packages can use a lot of storage space on your computer.
snap keeps multiple older versions of packages.
For example, view the contents of
/var/lib/snapd/snaps

To limit the number of kept old versions of packages, run

sudo snap set system refresh.retain=2

To remove unnecessary packages, create a script with the following content:

#!/bin/bash
#Removes old revisions of snaps
#CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done

and run it.

https://www.debugpoint.com/clean-up-snap/

snap automatic updates

To prevent snap from updating packages automatically:
snap refresh --hold
To turn automatic updates back on:
snap refresh --unhold
https://ubuntuhandbook.org/index.php/2022/11/turn-off-automatic-updates-snap-apps/

Using Systemd

https://dev.to/alexanderalemayhu/run-deno-apps-via-systemd-on-linux-1ok2
sudo touch /etc/systemd/system/denoapp_01.service
Copy and modify the contents as shown on the web site.

This command will make the app automatically start on boot:
sudo systemctl enable denoapp_01
This command will make the app start right now:
sudo systemctl start denoapp_01
Monitor status:
sudo systemctl status denoapp_01
View journal log:
sudo journalctl -u denoapp_01
It took a bit of tweaking until it actually ran.

One of the reason for not running was that the lock file deno.lock conflicted with the source code,
Simply deleting the file solved the problem.

Here is the working service file:
[Unit]
Description=deno_fresh_01 - deno example
Documentation=https://github.com/atmelino
After=network.target

[Service]
Type=simple
User=atmelino
WorkingDirectory=/home/atmelino/github/learn/deno/deno_Fresh/deno_fresh_01
ExecStart=/usr/local/bin/deno run --allow-env --allow-read --allow-write --allow-net --allow-run main.ts

Restart=on-failure

[Install]
WantedBy=multi-user.target

Symbolic Links

https://linuxhint.com/create_symbolic_link_ubuntu/

ln -s [Source_Directory_Path] [Symbolic_Link_Path]
This command will create a file that is symbolic link named Symbolic_Link_Path
This symbolic link will point to the Source_Directory_Path

How do you remove a symbolic link ?
Simply delete the symbolic link file.


wcd usage

wcd is an ncd clone for graphical change directory functionality in the command line.

wcd appears to not work as described, however it can be used with the following workarounds.
Installation
sudo apt install wcd
Copy this block to the end of .bashrc:
wcd () { <PATH>/wcd.exe "$@" . ${WCDHOME:-${HOME}}/bin/wcd.go }
Scan directory tree, other than home
wcd.exec -S /mnt/mymedia
Choose the desired new path
wcd.exec -g -Tc
change to the new path
wcd

Category

Follow Me

discord