Notepad:Linux: Difference between revisions

From Amar
Jump to navigationJump to search
→‎IoT: Supress messages at boot
→‎IoT: raspberry pi4 boot
Line 90: Line 90:
* Create a user password hash to automatically add
* Create a user password hash to automatically add
   mkpasswd -m sha-512 PASSWORD [SALT]
   mkpasswd -m sha-512 PASSWORD [SALT]
* [https://www.simplylinuxfaq.com/2020/03/how-to-completely-disable-boot-or-startup-messages.html supress message at boot]
* [https://www.simplylinuxfaq.com/2020/03/how-to-completely-disable-boot-or-startup-messages.html x86 Suppress message at boot]
   /etc/default/grub
   /etc/default/grub
   GRUB_TIMEOUT_STYLE=hidden
   GRUB_TIMEOUT_STYLE=hidden
Line 98: Line 98:


   grub2-mkconfig -o /boot/grub2/grub.cfg
   grub2-mkconfig -o /boot/grub2/grub.cfg
* Raspberry Pi4 ubuntu suppress log at boot
  /boot/firmware/cmdline.txt
  (eliminate console=tty1)
  rd.plymouth=0 plymouth.enable=0 --log-level=0 systemd.log_level=0 systemd.show_status=0


== LVM ==
== LVM ==

Revision as of 17:10, 21 June 2023

Linux Tips and Tricks

Linux stuff I often have to lookup. Just my personal list of things.


shutdown -rF now
xauth add `hostname`/unix:0 . `openssl rand -hex 32`
  • yum versionlock - allows to lock an rpm
  • install faster random for dns etc.
 yum install haveged;
 systemctl enable haveged;
 systemctl start haveged
sudo visudo -f /mnt/etc/sudoers
netstat -tulpn
xargs yum -y install < file
  • Create Default Home Directory
mkhomedir_helper username
use tmpfiles.d and have your package create at startup or boot a file or directory /usr/lib/tmpfiles.d/mydaemon.conf :
man tmpfiles.d

#Type Path            Mode UID      GID    Age Argument
d     /run/mydaemon   0755 myuser myuser   -   -
rpm -Uvh --nodeps $(repoquery --location <module>)
  sudo journalctl --vacuum-time=3weeks
  ip -br l | awk '$1 !~ "lo|vir|eth" { print $3 }'

IoT

  wpa_passphrase <ssid> [passphrase]

Change the restart command in ```/etc/needrestart/needrestart.conf``` to 'i'

  sed "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
  • Create a user password hash to automatically add
  mkpasswd -m sha-512 PASSWORD [SALT]
  /etc/default/grub
  GRUB_TIMEOUT_STYLE=hidden
  GRUB_HIDDEN_TIMEOUT_QUIET=true
  GRUB_CMDLINE_LINUX_DEFAULT="rhgb quiet rd.plymouth=0 plymouth.enable=0 --log-level=0 systemd.log_level=0 systemd.show_status=0" 
  grub2-mkconfig -o /boot/grub2/grub.cfg
  • Raspberry Pi4 ubuntu suppress log at boot
  /boot/firmware/cmdline.txt
  (eliminate console=tty1)
  rd.plymouth=0 plymouth.enable=0 --log-level=0 systemd.log_level=0 systemd.show_status=0

LVM

LVM Expand

Expand the physical size

gparted

Expand the logical volume

lvextend -l +100%FREE /dev/vg.../lv....

Resize the file system

resize2fs /dev/vg.../lv...

LVM Snapshot


← Back to Notepad



<insert>googlesearchwiki</insert> <insert>paypal</insert> <insert>analytics</insert>