Giter Site home page Giter Site logo

perinm / bash-scripts Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 17.61 MB

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

License: MIT License

Shell 1.13% Python 61.98% JavaScript 16.47% Jinja 11.85% CSS 1.00% Less 1.84% SCSS 0.05% C++ 4.94% G-code 0.72% Batchfile 0.01%
bash automation ubuntu

bash-scripts's Introduction

bash-scripts

Contents

In this repository I store bash scripts that I develop, useful or time-saving for me
  • new_system.sh:

    1. useful and time-saving when starting new linux install

    2. updates system system, and install many useful packages for me

  • install_flutter.sh

    1. install flutter, and android-studio, and configure some system things
  • extra_things.sh

    1. Install nordvpn app.

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

-> 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

bash-scripts's People

Contributors

perinm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

msandipinheiro

bash-scripts's Issues

Add default startup and automatic configuration

Right now i run each separate command, would like to have a .sh added to startup with all the following commands:

# 1
discord --start-minimized
# 2
slack -u
# 3
telegram-desktop -startintray
# 4 - couldn't figure it out how to start this one minimized
upwork

Such commands should be automatically configured in ubuntu startup using new_system.sh, and parhaps other .sh file to just store this commands.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.