shatadru / simpletools

Collection of linux tools... (mostly for rpm based distros)
GNU General Public License v3.0
4 stars 5 forks source link

Repository stats:

GitHub issues GitHub closed issues GitHub last commit

otpgen CI Status:

Fedora CI Ubuntu 18.04 CI Ubuntu 20.04 CI

RHEL CI Debian CI

Shell-Check CI

otpgen.sh : 2 Factor Authentication for Linux

Supports : Fedora, Ubuntu, RHEL, Debian (more to be added including CentOS, Manjaro, Mint)
        otpgen.sh, otpgen:   2 Factor Authettication for Linux

                             This tool allows you to generate 2 step verification codes in Linux command line

                             Features:

                                * Generate verification code offline
                                * Support for both HOTP and TOTP based tokens
                                * Automatic setup via QR Code
                                * Add multiple accounts/keys, list and genetate keys
                                * Supports : Fedora, Ubuntu, Debian, RHEL (more to be added including CentOS, Manjaro, Mint)

        Syntax:  ./otpgen.sh [-V|--version][-i|--install][--clean-install][-a|--add-key <path to image>] [-l|--list-key][-g|--gen-key]
         -V, --version       Print version

         -i, --install       Install otpgen.sh in system

         --clean-install     Clean any local data and re-install

         -a, --add-key FILE  Add a new 2FA from image containing QR Code

         -l, --list-key      List all available 2FA stored in the system

         -g, --gen-key [ID]  Generate one time password
                             Passing ID is optional, else it will ask for ID
                             for which you want to generate OTP.  
         -d, --debug [debug level]  
                             Determines debug level, Prints messages which 
                             is greater than or equal to debug level

                             4: Debug
                             3: Info 
                             2: Warning (Default)
                             1: Error
                             0: Silent
         -s, --silent        Same as "--debug 0"

You can read more details in my Blog link

fix_dup_rpm.sh

Blog link

fix-rpm.sh

blog libk

vol-control.sh :

Don't have volume control keys ? set this shell scrip in shortcut to control volumes
  1. Save this script in /usr/bin or /bin, set execute permission and create keyboard shortut

  2. In GNOME goto keyboard settings -> Custom Shortcuts -> Click on "+" to add a new one

  3. It will popup a window where set

    Name : Volume Low Command : /bin/vol-control.sh decrease

    Click on add -> Next you need to add key shortcut, click on where it is written as disabled, input the key combo you want

    Similary you can set : Name : Volume Up Command : /bin/vol-control.sh increase

    Name : Volume Mute Command : /bin/vol-control.sh mute

notifyatlogin :

Log user logins and see notification everytime a remote user logs in.
  1. Save this script in /usr/bin or /bin, set execute permission and create keyboard shortut Add below lines in /etc/profile :

    ####### Notification at login #############
    IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"
    /usr/bin/notifyatlogin $IP
    #########################################
  2. The default behavior is it logs into system logs using logger and /var/log/login_history.

  3. Additionally in case of a remote ssh login, where the $IP will be passed from /etc/profile, it will send a GUI notification using notify-send.

  4. In case that does not work for you enable a wall message which should always work (Just remove the comment)

  5. You can even enable notification for local login.

  6. The script is easy to read so you should be able to modify it without any issue.

Fedora_wallpaper_changer.sh