Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active May 27, 2023 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacr/c7f978f4be040f1be2f0e67fab740fb4 to your computer and use it in GitHub Desktop.
Save dacr/c7f978f4be040f1be2f0e67fab740fb4 to your computer and use it in GitHub Desktop.
linux cheat sheet / published by https://github.com/dacr/code-examples-manager #72f98eec-0693-4e64-ab38-f22b3ca30010/b7178b895feb7d2a5a9582492ef897c81df42964

linux cheat sheet

sound control

select output device (for chrome => use pavucontrol)

pavucontrol
pacmd

RAID / BIOS LEVEL

  • apt-get install dmraid
  • dmraid -s : status
  • dmraid -r : disk associations
  • dmsetup ls
  • dmsetup info
  • dmsetup info /dev/dm-0

Notes:

hdd disk checks

lsblk
iostat -x 2
smartctl -a /dev/sda
iotop

Notes:

get my ip address

hostname -I | awk '{print $1}'

file system inodes

The max inodes number can only be set at file system format.

  • check current directory inodes usage : du --inode .
  • check current file system inodes statistics : df -ih .

linux grub edit

  • quiet splash => text
  • quiet splash nomodeset

linux extract information

inxi -Fxz
lshw
lshw -short
lsblk
lsusb
lscpu
lcpci
dmidecode -t bios
dmidecode -t processor
nvidia-smi

linux repair

boot from USB and then chroot using local disk file system.

mkdir /rescue

fdisk -l
mount /dev/sda6 /rescue
ls -l /rescue
mount /dev/sda4 /rescue/boot
ls -l /rescue/boot

mount -t proc proc /rescue/proc
mount -t sysfs sys /rescue/sys
mount -o bind /dev /rescue/dev
mount -t devpts pts /rescue/dev/pts

chroot /rescue

cat /etc/resolv.conf

linux random generator entropy

cat /proc/sys/kernel/random/entropy_avail
sudo apt-get install rng-tools 

iso images to USB disk

lsblk
dd if=path-to-image of=/dev/sdX

start wifi network

wpa_passphrase ESSID passphrase | tee wpa_supplicant.conf
wpa_supplicant -c wpa_supplicant.conf -i wlp5s0

imprimante laser brother CDW MFC 9330CDW

Absolument installer ce packet, pour que les documents PDF s'impriment correctement, l'impression directe n'est pas supportée

sudo apt-get install a2ps

Notes :

some file system cleanup

Keep newest directories, remove those whose file status is > 1*24h

find . -maxdepth 1 -type d -ctime +1 -exec rm -fr {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment