shatadru / simpletools

Collection of linux tools... (mostly for rpm based distros)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)
  • Open a new issue for any Linux support and I will try to add it.
Help page
        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

  • Can be used to remove duplicate rpms if package-cleanup is failing
Syntax:  bash fix_dup_rpm.sh [-v][-d]
         -d/--dry-run: Dry Run, do not make any changes, checks for duplicates, 
                       lists rpms need which will be removed. 
                       
         -v/--verbose: Prints verbose log

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
#########################################
  1. The default behavior is it logs into system logs using logger and /var/log/login_history.

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

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

  4. You can even enable notification for local login.

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

Fedora_wallpaper_changer.sh

  • What does it do ?

    1. Let's face it windows 10 does have some cool features when its comes to user interface, like everytime you get awesome wallpaper whenever you boot up the system.

    2. With this script you can use online API like unsplash to set awesome wallpapers based on your choice.

    3. You can use other APIs as well to retrieve pics with little tweaking...

    4. Feel free to add features.

    5. Should ideally work in linux distros with GNOME 3 + systemd. but might need tweaking in other distros only tested in Fedora 25, 26

  • How to install and run ?

# Fedora_wallpaper_changer.sh -s
# systemctl daemon-reload
# systemctl  fedora-wallpaper.service
  • How to enable this on boot ?
#  systemctl enable fedora-wallpaper.service
  • Config file :
/etc/fedora_wallpaper_changer.conf

About

Collection of linux tools... (mostly for rpm based distros)

License:GNU General Public License v3.0


Languages

Language:Shell 100.0%