πŸ’Ύ Archived View for mkl-wlod.srht.site β€Ί notes β€Ί shell.gmi captured on 2024-02-05 at 09:21:40. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

-=-=-=-=-=-=-

Shell Utills and not only

Arch

                  -`
                 .o+`
                `ooo/
               `+oooo:
              `+oooooo:
              -+oooooo+:
            `/:-:++oooo+:
           `/++++/+++++++:
          `/++++++++++++++:
         `/+++ooooooooooooo/`
        ./ooosssso++osssssso+`
       .oossssso-````/ossssss+`
      -osssssso.      :ssssssso.
     :osssssss/        osssso+++.
    /ossssssss/        +ssssooo/-
   `/ossssso+/:-        -:/+osssso+-
  `+sso+:-`                 `.-/+oso:
 `++:.                           `-/+/
.`                                 `

βž•Package install

    $ sudo pacman -S package_name

βœ”οΈ System update

    $ sudo pacman -Syu

βœ–οΈ Remove package

    $ sudo pacman -R package_name

πŸ“‹ List installed packages sorted by size

    $pacman -Qi | awk -F: '$1~/^Name / { name=$2 } $1~/^Installed Size / { gsub(/ /, ""); size=$2; print size, name }' | sort -hr | column -t | less

Debian

         _,met$$$gg.
      ,g$$$$$$$$P.
    ,g$P""       """Y$.".
   ,$P'              `$$. 
 ',$P       ,ggs.     `$b:
 `d$'     ,$P"'   .    $$
  $P      d


     ,    $P
  $:      $.   -    ,d$'
  $;      Y$b._   _,d$P'
  Y$.    `.`"Y$$P"' 
  `$b      "-.__
   `Y$b
    `Y$.
      `$b.
        `Y$b.
          `"Y$b._
              `""""

βž•App install

    $ sudo apt install app_name

βœ–οΈ App remove

    $ sudo apt remove app_name

βœ”οΈ System update

    $ sudo apt update && sudo apt upgrade -y

Redhat

           .MMM..:MMMMMMM                
          MMMMMMMMMMMMMMMMMM             
          MMMMMMMMMMMMMMMMMMMM.          
         MMMMMMMMMMMMMMMMMMMMMM          
        ,MMMMMMMMMMMMMMMMMMMMMM:         
        MMMMMMMMMMMMMMMMMMMMMMMM         
  .MMMM'  MMMMMMMMMMMMMMMMMMMMMM         
 MMMMMM    \`MMMMMMMMMMMMMMMMMMMM.       
MMMMMMMM      MMMMMMMMMMMMMMMMMM .       
MMMMMMMMM.       \`MMMMMMMMMMMMM' MM.    
MMMMMMMMMMM.                     MMMM    
\`MMMMMMMMMMMMM.                 ,MMMMM. 
 \`MMMMMMMMMMMMMMMMM.          ,MMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 
      MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM: 
         MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM  
            \`MMMMMMMMMMMMMMMMMMMMMMMM:  
                \`\`MMMMMMMMMMMMMMMMM'   

βž•App install

    $ sudo yum/dnf install app_name

βœ–οΈ App remove

    $ sudo yum/dnf remove app_name

βœ”οΈ System update

    $ sudo yum update

    $ dnf upgrade --refresh

App .rpmfiles install, remove

    $ sudo rpm -i/r app_name.rpm

Arch and not only things

πŸ’½ HDD poweroff

    $ udisksctl power-off -b /dev/sdx

🌐 Network manager cli, wifi connect

    $ nmcli device wifi connect β€œSSID” password "xxxxx"

πŸ“ Copy, move, remove files/folders

    $ cp, mv, rm filename
    $ rm -r folder

πŸ–ŠοΈ Change name

    $ mv filename newfilename

πŸ“‹ Ip adress check

    $ ip a

πŸ’Ώ Create qcow2 image

    $ qemu-img create -f qcow2 disk1.img 10G

πŸ“± Mount android phone as storage (download android-file-tranfer)

    $ aft-mtp-mount /mnt

πŸ’Ώ Mount iso like dvd or cd disk

    $ mount -o loop /path/to/image.iso /media/mountpoint

πŸ—οΈ Show windows product key

    $ sudo strings /sys/firmware/acpi/tables/MSDM

🏁 Show startup times by system.d

    $ systemd-analyze

πŸ”“ tar.zst extract

    $ tar -I zstd -xf

πŸ”‘ Password secured zip

    $ zip -er outputfolder.zip Folder-to-zip/

πŸ“ Show folder/file size

    $ du -sh foldername

πŸ“€ Make bootable GNU/Linux drive ( dont use partition )

    $ dd bs=4M if=path/to/input.iso of=/dev/sdX conv=fdatasync status=progress

πŸ“€ Make bootable windows or GNU/Linux drive, also gui available

gui

    $ sudo woeusb -v --device /windows/iso/path /dev/sdx

❌Format partition to FAT32 file system

    $ mkfs.fat -F 32 /dev/sdXY

❌Format partition to NTFS file system (add -f flag to fast format)

    $ mkfs.ntfs /dev/sdXY

❌Format partition to ext4 file system

    $ mkfs.ext4 /dev/sdXY          

🧠 Display free and used memory

    $ free -m

πŸ“– Display systemd last boot journal

    $ journalctl -b

πŸ’Ώ Create iso from cd/dvd

Check sector size and sector
    $ isosize -x /dev/sr0

Create iso
    $ dd if=/dev/sr0 of=discmage.iso bs=sector_size count=sector_count status=progress

πŸ”— Create symbolic link

    $ ln -s /path/to/folder /path/to/place/symbolic/link

πŸ“‚ Display path of current directory

    $ pwd

βœ–οΈ ❕"Hardreset" format drives to zero

    $ dd if=/dev/zero of=/dev/sdX bs=16M status=progress

πŸ“± Mount iPhone

Download

ifuse

from AUR

Start usbmuxd.service

    $ systemctl start usbmuxd.service

Pair iPhone (Device must be unlocked)

    $ idevicepair pair

Mount iPhone

    $ ifuse -o allow_other /mountpoint

Probably you have to change config in /etc/fuse.conf and uncomment #user_allow_other

Umount iPhone

    $ fusermount -u /mountpoint 

🎧 Bluetooth Headphones

Needed packages pulseaudio-bluetooth and bluez-utils.

Start bluetooth service

    $ systemctl start bluetooth.service

Open bluetooth utility

    $ bluetoothctl

Bluetooth utility

    [bluetooth]# power on
    [bluetooth]# agent on
    [bluetooth]# default-agent

Scan for devices
    [bluetooth]# scan on

Pair device
    [bluetooth]# pair XX:XX:XX:XX:XX (MAC)

Connect to paired device
    [bluetooth]# connect XX:XX:XX:XX:XX

For automatically connect
    [bluetooth]# trust XX:XX:XX:XX:XX

    [bluetooth]# scan off
    [bluetooth]# exit

To switch PulseAudio switch on connected module you need to add this lines to /etc/pulse/default.pa

    $ load-module module-switch-on-connect

Also if you want, enable auto power on bluetooth edit /etc/bluetooth/main.conf

    $ AutoEnable=true

🌐 Share internet over Ethernet

Install dnsmasq and nm-connection-editor

🌐 Share internet over Wi-Fi

Install dnsmasq and nm-connection-editor

🧑 Git

New

    $ git init
    $ git add
    $ git commit -m "commit message"
    $ git remote add origin git@github.com:username/new_repo.git
    $ git push origin master

Exist repo

    $ git add .
    $ git commit -m "commit message"
    $ git push origin master

Rename last no pushed commit

    $ git commit --amend -m "commit message"

Rename last pushed commit

    $ git commit --amend -m "commit message"
    $ git push --force origin master