bash

  • 2024
  • 08. Aug 2024 Run a Script on Startup in Linux
  • To add a startup script on Linux that runs whenever the server is started or restarted, using systemd First, your /path/to/startup_script.sh #!/bin/bash # Your commands here echo "Server started

  • 16. Sep 2024 python code checks
  • Some code checks I do while reviewing python code.

    Using [] instead of generator expressions grep -rn –exclude-dir=venv –include="*.py" '(sum|min|max|any|all|list|tuple|set)(\


  • 16. Sep 2024 git – set your commit email address in folders
  • You can use git config user.email to set a different email address from global one for each folder. Here’s a bash snippet. #!/bin/bash # Define the root directory containing all your folders RO

  • 12. Oct 2024 Convert images to gif
  • #!/bin/bash # input images pattern input_images="*.png" output_gif="output.gif" # delay between frames (100 = 1 second) delay=100 # loop forever (0), or specify number of loops loop=0

  • 2022
  • 28. Feb 2022 rsync examples
  • https://linux.die.net/man/1/rsync

    rsync current directory to remote recursively rsync -azP –delete . root@remoteip:/mnt/ rsync -chavzP –stats source target rsync -avz /localpath/file root@remoteip


  • 2021
  • 22. Mar 2021 Frequently used Bash Commands
  • find first level js, and grep find /.js -print0 | xargs -0 grep –color 'treemap' # find lines of code find /.html *.html -print0 | xargs -0 wc -l -c # Search word in files grep -rnw &#3