linux
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux [2025/12/07 12:25] – reddy | linux [2026/03/01 20:25] (current) – reddy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | # Linux | + | ====== |
| - | Topics | + | ===== Popular |
| - | * [[SystemD Unit Files]] | + | * [[bash]] |
| - | * [[tuned]] | + | * [[bind]] |
| * [[Docker]] | * [[Docker]] | ||
| + | * [[diff]] | ||
| * [[Git]] | * [[Git]] | ||
| - | * [[VNC]] | + | * [[rsync]] |
| * [[Samba]] | * [[Samba]] | ||
| + | * [[SystemD Unit Files]] | ||
| + | * [[tuned]] | ||
| + | * [[Vim]] | ||
| + | * [[VNC]] | ||
| + | |||
| + | ===== Miscellaneous ===== | ||
| + | |||
| + | ==== Suppressing the Service Restart prompt for "apt install" | ||
| + | |||
| + | < | ||
| + | / | ||
| + | $nrconf{verbosity} = 0; | ||
| + | $nrconf{restart} = ' | ||
| + | |||
| + | export DEBIAN_FRONTEND=noninteractive | ||
| + | export APT_LISTCHANGES_FRONTEND=none | ||
| + | export NEEDRESTART_MODE=a | ||
| + | export NEEDRESTART_SUSPEND=1 | ||
| + | # echo 'libc6 libraries/ | ||
| + | |||
| + | sudo apt-get remove apt-listchanges --assume-yes --force-yes | ||
| + | sudo apt-get --force-yes -o Dpkg:: | ||
| + | </ | ||
| + | |||
| + | ==== Upgrade to Ubuntu 24.04 LTS ==== | ||
| + | |||
| + | < | ||
| + | sudo apt install -y ubuntu-release-upgrader-core | ||
| + | |||
| + | # Ensure " | ||
| + | |||
| + | do-release-upgrade | ||
| + | |||
| + | # apt dist-upgrade | ||
| + | </ | ||
| + | |||
| + | ==== Limiting Resources ==== | ||
| + | |||
| + | < | ||
| + | mkdir / | ||
| + | CPU_QUOTA=50 | ||
| + | CPU_PERIOD=100 | ||
| + | echo " | ||
| + | RAM_QUOTA=" | ||
| + | echo " | ||
| + | cp / | ||
| + | #rm -Rf / | ||
| + | |||
| + | With tools: | ||
| + | apt install -y cgroup-tools | ||
| + | cgcreate -g cpu, | ||
| + | cgset -r cpy.max=" | ||
| + | cgset -r memory.max=" | ||
| + | cgclassify -g cpu, | ||
| + | cgexec -g cpu, | ||
| + | #cgdelete -g cpu, | ||
| + | |||
| + | systemd-run -u myappd -p CPUQuota=50% -p MemoryMax=1024M / | ||
| + | systemd-cgls --all | ||
| + | systemd-cgtop | ||
| + | |||
| + | |||
| + | / | ||
| + | [Slice] | ||
| + | CPUQuota=50% | ||
| + | MemoryMax=1024M | ||
| + | systemctl edit --full myappd.service | ||
| + | Slice=myapp.slice | ||
| + | |||
| + | systemd-run -u myappd --slice=myapp.slice / | ||
| + | |||
| + | # To run with Docker | ||
| + | docker run -d --name db --cgroup-parent=myapp.slice myappimg | ||
| + | </ | ||
| + | |||
| + | ==== ssh-copy-id ==== | ||
| + | |||
| + | < | ||
| + | ssh-keygen -f key_file_name | ||
| + | |||
| + | # To make it non-interactive (we cannot pass the StrictHostKeychecking so we direct the " | ||
| + | sshpass -p mypassword ssh-copy-id -i key_file_name.pub myuser@myserver <<< | ||
| + | |||
| + | # ssh-copy-id doesn' | ||
| + | # ...but it passes along options to ssh | ||
| + | ssh-copy-id -i ~/ | ||
| + | |||
| + | # This can also be done with ssh-agent | ||
| + | eval $(ssh-agent -s) # Start the agent | ||
| + | ssh-add ~/ | ||
| + | ssh-copy-id -i ~/ | ||
| + | eval $(ssh-agent -k) # Stop the agent | ||
| + | </ | ||
| + | |||
| + | |||
linux.1765106745.txt.gz · Last modified: (external edit)
