User Tools

Site Tools


linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux [2026/03/09 11:37] – reddylinux [2026/10/25 21:18] (current) – Added sysctl commands reddy
Line 5: Line 5:
   * [[bash]]   * [[bash]]
   * [[bind]]   * [[bind]]
 +  * [[chrony]]
   * [[Docker]]   * [[Docker]]
   * [[diff]]   * [[diff]]
 +  * [[dnsmasq]]
 +  * [[FirewallD]]
   * [[Git]]   * [[Git]]
 +  * [[keepalive]]
 +  * [[lxc]]
 +  * [[mail]]
   * [[rsync]]   * [[rsync]]
   * [[Samba]]   * [[Samba]]
 +  * [[SELinux]]
   * [[SystemD Unit Files]]   * [[SystemD Unit Files]]
   * [[tuned]]   * [[tuned]]
 +  * [[ufw]]
   * [[Vim]]   * [[Vim]]
   * [[VNC]]   * [[VNC]]
Line 122: Line 130:
 nmcli c modify 'cloud-init ens5' ipv4.dns '127.0.0.1,8.8.8.8' nmcli c modify 'cloud-init ens5' ipv4.dns '127.0.0.1,8.8.8.8'
 nmcli c modify 'cloud-init ens5' ipv4.ignore-auto-dns yes nmcli c modify 'cloud-init ens5' ipv4.ignore-auto-dns yes
 +# The above commands are an alternative to modifying the config file at
 +# /etc/NetworkManager/system-connections/ens5.nmconnection
 +</code>
 +
 +For the change to take effect:
 +<code>
 +nmcli c down 'cloud-init ens5' && nmcli c up 'cloud-init ens5'
 +</code>
 +
 +These settings also exist at the device level ("nmcli d", "nmcli d show ens5 | grep IP4.DNS") but we generally set these at the connection level.
 +
 +==== Setting the Default Runlevel ====
 +
 +<code>
 +# Get the current default run-level
 +systemctl get-default
 +
 +# Start in text mode
 +sudo systemctl set-default multi-user.target
 +
 +# Start with a GUI desktop
 +sudo systemctl set-default graphical.target
 +</code>
 +
 +==== Disable SystemD Resolv from port 53 ====
 +
 +Edit /etc/systemd/resolved.conf 
 +<code>
 +#DNSStubListener=yes
 +DNSStubListener=no
 +</code>
 +
 +Then, restart the systemd-resolved service.
 +
 +==== Send SystemD Resolv requests to another DNS server ====
 +
 +In /etc/system/resolved.conf.d/otherservice.conf
 +<code>
 +[Resolve]
 +DNS=1.2.3.4
 +Domains=~mytest
 +</code>
 +
 +==== Scan for bad sectors ====
 +
 +<code>
 +badblocks -v /dev/sda1 > bs.txt
 +fsck -l bs.txt /dev/sda1  # -l adds adds the bad block list to the filesystem
 +
 +smartctl -H /dev/sda  # Perform health check
 +smartctl -A /dev/sda  # Look at Reallocated_Sector_CT and Current_Pending_Sector
 +</code>
 +
 +==== Grub Boot ====
 +
 +<code>
 +sudo grub-install --recheck /dev/sda
 +sudo update-grub
 +</code>
 +
 +==== Sysctl ====
 +
 +<code>
 +sysctl -a  # List all parameters
 +sysctl <param>  # List a specific parameter Eg. kernel.hostname, vm.swappiness
 +sysctl -w <param>=<value>  # Temporary change to parameter
 +sysctl -p <config_file>  # Reload from config (If no file specified, /etc/sysctl.conf)
 </code> </code>
  
linux.1773052678.txt.gz · Last modified: by reddy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki