Skip to content

perinm/bash-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

354 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bash-scripts

Contents

In this repository I store bash scripts that I develop, useful or time-saving for me

How to use

Run:

chmod +x <script_name>.sh
./<script_name>.sh

Extra info (source)

When sideloading ubuntu with windows previously installed, select manually by using "Something else" option.

  • swap
    • type: primary
    • beginning of space
    • use as: swap area
  • / (root)
    • type: logical
    • location: beginning of space
    • use as: ext4
    • mount point: /
    • size: (10 - 20gb) (20480mb) [if installing cuda in a nvidia machine make it 35gb or 35840mb]
  • /home
    • 4 first options same as / (root)
    • choose your home size accordingly (all free space in hard drive)
  • device for boot loader being main drive (if there is windows, choose the same one)

Useful commands

ssh-keygen -t ed25519 -C "<[email protected]>"
  • create bootable liveimage using hdd partition instead of usb

  • fix slow boot by defining suspend/hibernate SWAP UUID

  • move spotify to system tray

  • change ubuntu actions for sleep (supend/hibernate) on lid close, etc

  • fix acer predator fan

  • # scan local network
    sudo nmap -sn 192.168.18.0/24
    # for simple ip up scan, faster
    sudo nmap -sn -n -host-timeout 1 192.168.18.0/24
  • # generate a random password
    pwgen -s 50 -c -n -y | tr -d ")(}{][\!\"#$%'.\\\/\`><"
    ```
    
  • # All commits started from the next after 8fd7b22 will be rebased with no changes except signing
    git rebase --exec 'git commit --amend --no-edit -n -S' -i 8fd7b22
    # To change all commits started from the very first one you may use --root
    git rebase --exec 'git commit --amend --no-edit -n -S' -i --root
    #Return commit date as author date and force push (don't forget to backup before).
    git rebase --committer-date-is-author-date -i --root # return 
    git push --force

    -> source

  • echo "Host personal\nHostname github.com\nIdentityFile /home/ubuntu/.ssh/rasp_2023_08_27\nIdentitiesOnly yes" >> ~/.ssh/config
    git remote rm origin
    # swap username and repository accordignly
    git remote add origin git@personal:username/repository.git

    -> source

  • # set chrome as default browser inside snaps
    xdg-mime default google-chrome.desktop x-scheme-handler/http
    xdg-mime default google-chrome.desktop x-scheme-handler/https
    
    gio mime x-scheme-handler/https google-chrome.desktop
    gio mime x-scheme-handler/http google-chrome.desktop

    -> source

  • # set other terminal as default
    sudo update-alternatives --config x-terminal-emulator

    -> source

  • # concat all images in current folder to a PDF
    convert *.jpg -quality 20 file20.pdf
    
    # before running that, make sure to disable conflicting policy
    sudo mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml.off
    
    # when done, restore policy by running
    sudo mv /etc/ImageMagick-6/policy.xml.off /etc/ImageMagick-6/policy.xml

    -> source

    for KEY in $(apt-key --keyring /etc/apt/trusted.gpg list | grep -E "(([ ]{1,2}(([0-9A-F]{4}))){10})" | tr -d " " | grep -E "([0-9A-F]){8}\b" ); do K=${KEY:(-8)}; apt-key export $K | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/imported-from-trusted-gpg-$K.gpg; done

    -> source

    # remove an app and its data
    flatpak uninstall --delete-data <app_name>
    
    # remove all unused apps and their data
    flatpak uninstall --unused --delete-data
    
    # run an update just for the ifs
    sudo flatpak update

    -> source

-> config bashrc to show only currrent directory instead of full relative path to home source

-> change vs code to LF instead of CRLF source

-> fix slack screenshare on wayland source

-> fix slack screenshare on wayland debian package source

-> CopyQ Not Saving Clipboard Copy Paste in Ubuntu 23.04 source

-> 2024-04-17, fix to google-chrome on ubuntu, stopped working on wayaland source

Gnome must have shell extensions

About

In this repository I store bash scripts that I develop, useful or time-saving for me

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors