Skip to content

My Automation Scripts For My Mac and Raspberry Pi Server

Notifications You must be signed in to change notification settings

nmbarker/automation-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

automation-scripts

Scripts I use to make my life in the CLI much easier and efficent.

Prerequisites

Installing GnuPG MacOSX

If you don't already have it, install Homebrew.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Once that is installed, install GnuPG

brew install gnupg

Password Management

  • pwd.sh - My username and password information handler.
  • wifi-password - My "I'm too lazy to get the actual password for people" handler.
  • passbox - My other secure information handler.

Password Management Installation


If you want the scripts.

git clone https://github.com/nmbarker/automation-scripts.git

Make sure to chmod each script so that you can actually use it.

(sudo) chmod u+x <script>

Alternatively

You can install wifi-password with Brew.

brew install wifi-password

You can install passbox with Curl.

curl -L https://raw.githubusercontent.com/RobBollons/passbox/master/passbox > ./passbox && chmod +x ./passbox

Password Management Usage


Using pwd.sh

  • Run the script interactively using cd pwd.sh && ./pwd.sh or symlink to a folder in $PATH and run directly.

  • Type w to write a password.

  • Type r to read a password.

  • Type d to delete a password.

  • Create password with length of 30 characters for gmail:

    ./pwd.sh w gmail 30

  • Read password for user@github:

    ./pwd.sh r user@github

  • Delete password for dropbox:

    ./pwd.sh d dropbox

  • Copy password for github to clipboard on OS X:

    ./pwd.sh r github | cut -f 1 -d ' ' | awk 'NR==3{print $1}' | pbcopy

  • To get the password for the WiFi you're currently logged onto:

    wifi-password

  • To get it for a specific SSID:

    wifi-password <ssid>

  • To put it straight in your clipboard for pasting elsewhere (OS X only):

    wifi-password | pbcopy

usage: passbox [action]

Passbox - command line password manager utility

ACTIONS
   add-field     <entry name>               Update an existing entry to add additional fields to
   delete        <entry name>               Remove an entry from the password database
   get           <entry name>               Get a particular password entry by it's name
   generate                                 Generate a new random password
   new                                      Prompt to create a new passbox entry
   remove-field  <entry name> <field name>  Update an existing entry to remove additional fields
   search        <search pattern>           Search the password database for a particular string, returns all matching entries
   update        <entry name>               Update an existing entry in the password database

Cron

Cron Usage


  • crontab -e to open vim so you can edit.
    • Press i to begin editing the file.
  • 0 6 * * * /bin/bash /Path/to/brewupdate.sh
    • this updates brew everyday at 6 am.
  • 0 21 * * * /bin/bash /Path/to/safebackup.sh
    • this backs up the pwd.sh.safe to a file server or to another folder on the computer.
  • 0 21 * * * /bin/bash /Path/to/passboxbackup.sh
    • this backs up the passbox.gpg to a file server or to another folder on the computer.
  • CTRL+C
    • to stop editing.
  • ZZ
    • saves and installs the cron jobs (Make sure the Z's are capitalized).

GPG

  • gpgdecrypt.sh - Allows quick decrypting of messages from other users.
  • encryptedmes.sh - Or encrypted message, allows me to use gpg quickly to send a message to someone who's key I have.

GPG Usage


  • cd /directory/of/gpgdecrypt.sh && ./gpgdecrypt.sh
  • Drag the file into the terminal window or type in the path of the file to decrypt.
  • Enter password when prompted.
  • cd /directory/of/encryptedmes.sh && ./encryptedmes.sh
  • Enter the email of the recipient.
  • Enter the name of the output file.
  • Write your message.

About

My Automation Scripts For My Mac and Raspberry Pi Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages