Keysnatcher

Source code I have written openly published for your viewing pleasure.


Keysnatcher

Postby TheeMahn » Thu Feb 13, 2014 11:52 pm

I don't know how this app has slipped me writing about it, here it is version 1.0.3 and yes there was a version 1.0.0 etc. An index of software I have written open source can be viewed here. The original intention of me writing this app? I guess to be honest Ubuntu had pissed me off with thier server being down. Guess what Ubuntu does not own the only keyserver, let me rectify the situation & while I am at it let's scan all the servers and find the fastest one for me ;) That is no longer all it does. I have expanded the app to do other things that assist in building Operating Systems, this is the 2nd deb that is installed from tmosb the very first deb to go in is the ultimate edition repositories deb. Why is it such a high priority to install? It fixes issues within the core os and accelerates the build process. It also if necessary fixes any broken repositories, this does not become so evident until you try and build an advanced os such as a trusty base, many repos that exist for precise etc. are not availible for trusty yet. The software detects this and corrects the issue(s) at hand. It also fixes an IPV6 related issue.

EDIT: 06/18/14, it is simple for me to syncronise my code with our Ultimate Edition Copy account. The latest apps will always be there.

EDIT: 04/15/15:Wow, how times fly, at version 1.0.8 and has been there for a long minute. I feel prefection has been met with this tool. I have since created our own keyserver with over 3 million keys & is faster then any of the other keyservers ;) A SSD cloud is hard to beat down.

EDIT: 09/25/15, I stand corrected, found another error it does not address and that is duplicate sources. Found this issue by accident trying to install a beta of Google Chrome. Already had it in my sources and added it anyway and here comes the errors. KeySnatcher 1.0.9 will now detect and fix this error as well.

speed.png
lower ping is better / faster.

Changelog first:
# ==============================================================================
# Change-log:
# 1.0: First public release
# 1.0.1: Added bc to dependancy list
# Removed locale was causing minor issues
# 1.0.2: Added fix routine for missing repositories
# Added Server Timeout function for IPV6
# Many bug fixes in permission rights.
# 1.0.3: Wrote help system. Not a fantastic job, but I hope it
# gets the point across.
# 1.0.4: Adjusted servers, added version dumping header.
# Now checks permissions prior to engaging software.
# Added eyecandy routines & a new one Encapsulate.
# Adjusted Help system and commands.
# 1.0.5 Added fixing of 403 Forbidden errors.
# Repaired bash_autocompletion to coincide with options
# 1.0.6 Added ability to skip connectivity tests.
# Adjusted eyecandy routines.
# Wrote a manual in man format, pdf and postscript.
# 1.0.7 Added repair of "Failure to fetch" (Architecture)
# related issues.
# 1.0.8 Added ueserver.space to the keyserver mix (3+ million keys)
# Corrected indexing of servers.
# 1.0.9 Added repair of duplicate sources.
# ==============================================================================


Lets snap open the help system:
theemahn@JackHammer:~/Downloads$ keysnatcher --help
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ KeySnatcher 1.0.8, 04/15/2015 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒ GNU KeySnatcher home page: <http://ultimateedition.info/>. ▒
▒ E-mail bug reports to: <TheeMahn@ultimateedition.info>. ▒
▒ Be sure to include the word KeySnatcher somewhere in the Subject: field. ▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒


▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒ Usage: KeySnatcher -<-COMMAND> ▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Mandatory arguments to long options are identical for short options.
possible commands...

-f --fixerrors fix 403 / 404 errors with repositories
-s --snatch snatch missing keys
-h --help this help message
-r --rescan rescan servers to determine which is fastest
-t --timeout fix IPV6 timeout issues
-v --version dump version info

KeySnatcher --help [COMMAND] for further information.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
theemahn@JackHammer:~/Downloads$


It is sitting ony your build servers by the way. I guess somewhat cryptic to a *nix noobie. I try to not re-invent the wheel, and by the same token re-explain info that can be obtained elsewhere. First what is a GPG key? Enough on with the code:
Code: Select all
#!/bin/bash
# ==============================================================================
# title         :KeySnatcher
# description   :Grabs missing GPG keys & fixes missing repositories
# author      :theemahn <theemahn@ultimateedition.info>
# date         :04/15/2015
# version      :1.0.8
# usage         :KeySnatcher --help
# manual      :man KeySnatcher
# notes         :See change-log below for further information.
# ==============================================================================
# Change-log:
#      1.0:   First public release
#       1.0.1:   Added bc to dependancy list
#         Removed locale was causing minor issues
#      1.0.2:   Added fix routine for missing repositories
#         Added Server Timeout function for IPV6
#         Many bug fixes in permission rights.
#      1.0.3:   Wrote help system. Not a fantastic job, but I hope it
#         gets the point across.
#      1.0.4:   Adjusted servers, added version dumping header.
#         Now checks permissions prior to engaging software.
#         Added eyecandy routines & a new one Encapsulate.
#         Adjusted Help system and commands.
#      1.0.5   Added fixing of 403 Forbidden errors.
#         Repaired bash_autocompletion to coincide with options
#      1.0.6   Added ability to skip connectivity tests.
#         Adjusted eyecandy routines.
#         Wrote a manual in man format, pdf and postscript.
#      1.0.7   Added repair of "Failure to fetch" (Architecture)
#         related issues.
#      1.0.8   Added ueserver.space to the keyserver mix (3+ million keys)
#         Corrected indexing of servers.
# ==============================================================================

#INTERNAL VARIBLES
PROGNAME="KeySnatcher"
BUILDDATE="04/15/2015"
VERSION="1.0.8"
EXEC=$PWD
WEBSITE="ultimateedition.info"
AUTHOR="TheeMahn"
EMAIL="<"$AUTHOR"@"$WEBSITE">"

# Retrieve number of lines & columns the screen supports.
LINEZ=$(tput lines)
COLUMNZ=$(tput cols)
SPLIT=0

# check to see if notify is installed & if sound is supported.
# a recommended (not required dependancy)
# To add notification support
# sudo apt-get install libnotify-bin notify-osd
# To add sound support
# apt-get install gnome-session-canberra
NOTIFY=$(which notify-send)
SOUND=$(which canberra-gtk-play)

# Declare integer to span eye-candy routine
declare -i RR
RR=0
declare -i TT
TT=0
declare -i CALC
CALC=0

declare -a KEYSERVERS=('ueserver.space' 'keyserver.ubuntu.com' 'pool.sks-keyservers.net' 'subkeys.pgp.net' 'keys.nayr.net' 'keys.gnupg.net');
declare -a PINGTIME=();
#LOCALE=`localectl | grep "System Locale" | cut -d'_' -f2 | cut -d'.' -f1`
#LASTRESORT='wwwkeys.'$LOCALE'.pgp.net' # UNUSED CURRENTLY & will eventually be a last resort.

#Pull info we will use to compare against later
IUSER=${SUDO_USER:-$USER}
IHOME="/home/$IUSER"

# set colors so errors etc. stand out.
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White
bldblk='\e[1;30m' # Black - Bold
bldred='\e[1;31m' # Red
bldgrn='\e[1;32m' # Green
bldylw='\e[1;33m' # Yellow
bldblu='\e[1;34m' # Blue
bldpur='\e[1;35m' # Purple
bldcyn='\e[1;36m' # Cyan
bldwht='\e[1;37m' # White
unkblk='\e[4;30m' # Black - Underline
undred='\e[4;31m' # Red
undgrn='\e[4;32m' # Green
undylw='\e[4;33m' # Yellow
undblu='\e[4;34m' # Blue
undpur='\e[4;35m' # Purple
undcyn='\e[4;36m' # Cyan
undwht='\e[4;37m' # White
bakblk='\e[40m'   # Black - Background
bakred='\e[41m'   # Red
badgrn='\e[42m'   # Green
bakylw='\e[43m'   # Yellow
bakblu='\e[44m'   # Blue
bakpur='\e[45m'   # Purple
bakcyn='\e[46m'   # Cyan
bakwht='\e[47m'   # White
txtrst='\e[0m'    # Text Reset

# Currently Unused function. I have thought about using this function for the help system.
function Columnize () {
   # Columnize is an internally called function exclusively.
   # EXAMPLE
   # -t to shove through the column titles we will count the number of switches and
   # calculate spacing eventually.
   if [[ $1 == '-t' ]]; then
      #echo -e "${bldgrn}Number of switches passed: $#"
      for ARG in "$@"
      do
         array_counter=$(($array_counter + 1))
         if [[ $array_counter -gt 2 ]]; then
            #echo "Switch $array_counter: $ARG"
            ARGUMENTS[$array_counter]=$ARG
            tLen=${#ARGUMENTS[$array_counter]}
            if [[ $tLen -ge $WIDEST ]]; then
               WIDEST=$tLen
            fi
            #echo "Length of ${ARGUMENTS[$array_counter]} is $tLen"
         fi
         #echo "The widest passed varible is $WIDEST"
      done
   else
      #echo -e "${bldgrn}Number of switches passed: $#"
      for ARG in "$@"
      do
         array_counter=$(($array_counter + 1))
         if [[ $array_counter -gt 1 ]]; then
            #echo "Switch $array_counter: $ARG"
            ARGUMENTS[$array_counter]=$ARG
            tLen=${#ARGUMENTS[$array_counter]}
            if [[ $tLen -ge $WIDEST ]]; then
               WIDEST=$tLen
            fi
            #echo "Length of ${ARGUMENTS[$array_counter]} is $tLen"
         fi
         #echo "The widest passed varible is $WIDEST"
      done
   fi
   #echo "#: $# VARS: $*"
   LONGESTLENGTH=${#2}
   #echo "Length of $2 is $LONGESTLENGTH"
   #echo $COLUMNZ
   MAINS=$(echo "scale=2; $COLUMNZ-30" | bc)
   MAINS=${MAINS%.*}
   #echo $MAINS
   MAINS=$(expr $MAINS - 2)
   MAINS=$(expr $MAINS / 4)
   #echo $MAINS
   if [[ $1 = '-t' ]]; then
      #"#" "DEV" "VENDOR" "LABEL" "TYPE" "SIZE"
      printf "%-0s %-16s %-7s %-16s %-7s %-3s %-13s %-3s %-16s %-1s\n" "▒" "$2" "$3" "$4" "$5" "$6" "$7" "$8"
   else
      #MAINS=$(expr $MAINS / 2)
      printf "%-0s %-16s %-7s %-16s %-7s %-3s %-13s %-3s %-16s %-1s\n" "▒" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8"
   fi
}

function Error () {
   echo -en "${bldred}"
   #FullBar
   Center "$1" "--ERROR"
   #echo -en "${bldred}"
   #FullBar
   echo -en "${txtrst}"
}

# Function for outputting to X-11 screen a notification of completion and playing sound.
# The sound file is from the "Optional" ultimate-edition-sound-theme
function Notification () {
   # Is X11 running?
   X=$( pidof X )
   # Does the user have the optional Ultimate Edition Sound scheme installed?
   if [[ -f "/usr/share/sounds/Ultimate Edition Sound Scheme/stereo/itisdone.wav" ]]; then
      WAVE=1
   fi
   # Is the user in an X11 GUI environment and have notification OSD installed?
   if [[ $X && $NOTIFY ]]; then
      a=$((notify-send "KEYSNATCHER" "$1" -i /usr/share/ultimate_edition/logo.png -t 5000) 2>/dev/null)
   fi
   # Does the user have pre-requisites? If so, break out the Cylon voice.
   if [[ $SOUND && $WAVE ]]; then
      a=$(canberra-gtk-play -i itisdone 2>/dev/null)
   fi
   # Display message in terminal unconditionally
   Center "$1"
   FullBar
}

# Usage: Eye Candy "Message"
function EyeCandy() {
   # Verify a message has been sent to this function otherwise do squat.
   # Example: Eye Candy ('Repostorm $REPOVERSION is entering extraction mode.')
   # ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
   # ▒ Repostorm 1.7.7 is entering extraction mode. ▒
   # ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
   STP="$1"
   if [[ $STP ]]; then
      STRLEN=${#STP}
      STRLEN=$(expr $STRLEN + 3)
      GREPPED=$(echo $STP | grep -E '\e')
      if [[ $GREPPED ]]; then
         STRLEN=$(expr $STRLEN - 13)
      fi
      RR=0; while [ $RR -le $STRLEN ]; do echo -n "▒"; RR=RR+1; done; echo;
      echo -e "▒ "$STP" ▒"
      RR=0; while [ $RR -le $STRLEN ]; do echo -n "▒"; RR=RR+1; done; echo;
   fi
}

function Encapsulate() {
   # Verify a message has been sent to this function otherwise do squat.
   # Example: Encapsulate ('Repostorm $REPOVERSION is entering extraction mode.')
   # ▒ Repostorm 1.7.7 is entering extraction mode.                       ▒

   STP="$1"
   if [[ $STP ]]; then
      STRLEN=${#STP}
      STRLEN=$(expr $STRLEN + 3)
      DISTANCE=$(expr $COLUMNZ - $STRLEN)
      GREPPED=$(echo $STP | grep -E '\e')
      if [[ $GREPPED ]]; then
         STRLEN=$(expr $STRLEN - 13)
      fi
      echo -en "▒ "$STP
      RR=0; while [ $RR -lt $DISTANCE ]; do echo -n " "; RR=RR+1; done; echo "▒";
   fi
}

# Draws a bar across the screen based on screen size detected (columnz)
function FullBar() {
   RR=1; while [ $RR -le $COLUMNZ ]; do echo -n "▒"; RR=RR+1; done; echo;
}

# Center data passed to function on screen
function Center () {
   STP=$1
   ERROR=$2
   if [[ $STP ]]; then
      STRLEN=${#STP}
      CENTER=$(expr $STRLEN / 2 )
      #CENTER=CENTER-1
      TCENTER=$(expr $COLUMNZ / 2 )
      #TCENTER=TCENTER-1
      DISTANCE=$(expr $TCENTER - $CENTER)
      DISTANCE=$(expr $DISTANCE - 2)
      if ! [[ $ERROR ]]; then
         echo -en "${txtrst}"
      else
         echo -en "${bldred}"
      fi
      RR=0; while [ $RR -lt $DISTANCE ]; do echo -n "▒"; RR=RR+1; done;
      echo -en "${bldgrn} $STP "
      if ! [[ $ERROR ]]; then
         echo -en "${txtrst}"
      else
         echo -en "${bldred}"
      fi
      TT=0; while [ $TT -lt $DISTANCE ]; do echo -n "▒"; TT=TT+1; done;
      CALC=$(expr $RR + $TT + $STRLEN + 2)
      if [[ $CALC -lt $COLUMNZ ]]; then
         while [ $CALC -lt $COLUMNZ ]; do echo -n "▒"; CALC=CALC+1; done; echo;
      fi
   fi      # echo "STRING LEN: $STRLEN CENTER: $CENTER TOTAL CNTER: $TCENTER RR=$RR TT=$TT COLUMNZ: $COLUMNZ CALC: $CALC DISTANCE: $DISTANCE"
   echo -en "${txtrst}"
}

function VersionDump {
   Center "$PROGNAME $VERSION, $BUILDDATE"
   Encapsulate "GNU $PROGNAME home page: <http://$WEBSITE/>."
   Encapsulate "E-mail bug reports to: $EMAIL."
   Encapsulate "Be sure to include the word $PROGNAME somewhere in the Subject: field."
   FullBar
}

function GrabKeys {
   #VersionDump
#KEY SERVER                     AVG PING

#keyserver.ubuntu.com           100
#pool.sks-keyservers.net        47
#subkeys.pgp.net                DOWN
#pgp.mit.edu                    DOWN
#keys.nayr.net                  64
#keys.gnupg.net                 32
#Setting default keyserver as fastest server: keys.gnupg.net | 32
#Scanning for missing keys.
#Hit http://us.archive.ubuntu.com raring Release.gpg
#...
#Fetched 316 B in 40s (7 B/s)

#Processing key: 2E183FA1E260F5B0
#gpg: requesting key E260F5B0 from hkp server keys.gnupg.net
#gpg: /home/tonie/.gnupg/trustdb.gpg: trustdb created
#gpg: key E260F5B0: public key "Launchpad PPA for Ubuntu Tweak Testing Team" imported
#gpg: Total number processed: 1
#gpg:               imported: 1  (RSA: 1)

#In the above example the software has determined keys.gnupg.net is the
#fastest server, this operation is only performed once to accelerate any future
#grabbing of missing keys. The sofware then scans for missing keys and retrieves
# any missing key from that server.
   if ! [[ -w /etc/apt/sources.list ]]; then
      Error "Insufficent privilages. Please prefix sudo, or perform as super user." "--error"
      Encapsulate "sudo keysnatcher --snatch"
      FullBar
      exit 0;
   fi
   Encapsulate "Scanning for missing keys."
   FullBar
   if [[ -f ~/.keysnatcher ]]; then
      KEYSERVER=`cat ~/.keysnatcher`
   fi
   if [[ $IUSER != $USER ]]; then
      apt-get update 2> /tmp/keymissing; for key in $(grep "NO_PUBKEY" /tmp/keymissing |sed "s/.*NO_PUBKEY //"); do echo -e "\nProcessing key: $key"; gpg --keyserver $KEYSERVER --recv $key && gpg --export --armor $key | apt-key add -; done
   else
      sudo apt-get update 2> /tmp/keymissing; for key in $(grep "NO_PUBKEY" /tmp/keymissing |sed "s/.*NO_PUBKEY //"); do echo -e "\nProcessing key: $key"; gpg --keyserver $KEYSERVER --recv $key && gpg --export --armor $key | apt-key add -; done
   fi
   FullBar
   Notification "Missing keys if any successfully snatched."
}

function Connectivity {
   VersionDump
   GREPIR=$(echo "$*" | grep -i 'skip')
   if ! [[ $GREPIR ]]; then
      if ! [[ -f ~/.keysnatcher ]]; then
      
      Center "Scanning for fastest host, this only needs to be done once.  Please wait..."
      FullBar
      echo -e "${bldwht}${undwht}"
      printf '%-30s %s\n' \
      "KEY SERVER" "AVG PING"
      echo -en "${txtrst}"
      FullBar
      array_counter=0
         for number in ${KEYSERVERS[@]}
         do
            TESTVALUE=${KEYSERVERS[$array_counter]}
            if [[ $TESTVALUE ]]; then
      
               PINGTIME[$array_counter]=`ping -qc 10 $TESTVALUE | awk -F/ '/^rtt/ { print $5 }' | bc | sed 's/[.].*//'`
               PINGSPEED=${PINGTIME[$array_counter]}
      
               if [[ $PINGSPEED ]]; then
                  
                  echo -e -n "${bldgrn}";
                  printf '%-30s %s\n' \
                  "$TESTVALUE" "$PINGSPEED"
               else
                  echo -e -n "${bldred}";
                  printf '%-30s %s\n' \
                  "$TESTVALUE" "DOWN"
               fi
            fi
            array_counter=$(($array_counter + 1))
         done
   
         FASTEST=9999
         INDEX=0
         for i in ${PINGTIME[@]}
         do
            INDEX=$(($INDEX + 1))         
            if [[ $i -lt $FASTEST ]]; then
               FASTEST="$i"
               CURRENT=$(($INDEX - 1))
            fi
   
         done
         echo -e "${txtrst}"
         FullBar
         Center "Setting default keyserver: ${KEYSERVERS[$CURRENT]} | $FASTEST"
         FullBar
            echo ${KEYSERVERS[$CURRENT]} > ~/.keysnatcher
      else
         Center "Fastest keyserver has already been set"
         FullBar
         cat ~/.keysnatcher
      fi
   else
      Center "Skipping connectivity test as requested."
      FullBar
   fi
}

function FixErrors(){
   VersionDump
   if [[ $UID != '0' ]]; then
      Error "Insufficent privilages. Please prefix sudo, or perform as super user."
      Encapsulate "sudo keysnatcher --fixerrors"
      FullBar
      exit 0;
   fi
   #verify there is an error log
   if [[ -s /tmp/keymissing ]]; then
      #strip empty lines from error log
      sed -i '/^\s*$/d' /tmp/keymissing
      #read error log, turn on IFS to keep things contingent
      Encapsulate "Fixing 404 (File not found) error(s) if any."
      while IFS= read line
      do
         #parse error long, searching... seek and destroy. ;)
         #comment out 404 repositories.
         for FILEZ in $(ls /etc/apt/sources.list.d/*.list)
         do
            #Nullify varible each pass.
            GREPIT=''
            #chop out only necessary information. SS is for search string.
            SS=$(echo "$line" | grep '404' | cut -d' ' -f5 | cut -d'/' -f1-4)

            #echo "Processing $FILEZ looking for $SS"
            GREPIT=$(cat $FILEZ | grep "$SS")
            if [[ $GREPIT && $SS ]]; then
               if [[ -w $FILEZ ]]; then
                  sed -i 's/^deb/# deb/g' $FILEZ
                  Encapsulate "Fixing error in "$FILEZ": Success"
               else
                  Error "Fixing error in "$FILEZ": Error, insufficient privilages, please prefix sudo."
               fi
            fi
         done
      done <"/tmp/keymissing"
      # Fix 403 Error(s)
      Encapsulate "Fixing 403 (Forbidden) error(s) if any."
      while IFS= read line
      do
         #parse error long, searching... seek and destroy. ;)
         #comment out 404 repositories.
         for FILEZ in $(ls /etc/apt/sources.list.d/*.list)
         do
            #Nullify varible each pass.
            GREPIT=''
            #chop out only necessary information. SS is for search string.
            SS=$(echo "$line" | grep '403' | cut -d' ' -f5 | cut -d'/' -f1-4)

            #echo "Processing $FILEZ looking for $SS"
            GREPIT=$(cat $FILEZ | grep "$SS")
            if [[ $GREPIT && $SS ]]; then
               if [[ -w $FILEZ ]]; then
                  sed -i 's/^deb/# deb/g' $FILEZ
                  Encapsulate "Fixing error in "$FILEZ": Success"
               else
                  Error "Fixing error in "$FILEZ": Error, insufficient privilages, please prefix sudo."
               fi
            fi
         done
      done <"/tmp/keymissing"
      # Fix Arch related issue(s)
      Encapsulate "Fixing \"Failed to fetch\" (Architecture) error(s) if any."
      while IFS= read line
      do
         #comment out missing repositories (architecture related issues).
         for FILEZ in $(ls /etc/apt/sources.list.d/*.list)
         do
            #Nullify varible each pass.
            GREPIT=''
            #chop out only necessary information. SS is for search string.
            SS=$(echo "$line" | grep 'Failed to fetch' | cut -d' ' -f5 | cut -d'/' -f1-4)

            #echo "Processing $FILEZ looking for $SS"
            GREPIT=$(cat $FILEZ | grep "$SS")
            if [[ $GREPIT && $SS ]]; then
               if [[ -w $FILEZ ]]; then
                  sed -i 's/^deb/# deb/g' $FILEZ
                  Encapsulate "Fixing error in "$FILEZ": Success"
               else
                  Error "Fixing error in "$FILEZ": Error, insufficient privilages, please prefix sudo."
               fi
            fi
         done
      done <"/tmp/keymissing"
      FullBar
   else
      Center "Fix Errors"
      Encapsulate "There are no errors to fix."
      FullBar
   fi
   exit 0;
}

function ServerTimeOut(){
#Fix for the following:
#[Connecting to mirror1.mate-desktop.org (2a01:4f8:100:7003::10)]
#(2a01:4f8:100:7003::10) is IPV6 and causes great delays in retriving package lists
#The Fix or "Workaround" is to set a 2 second timeout in apt conf
   VersionDump
   # Turn of case sensitivity ReMoVe will work ;)
   shopt -s nocasematch
   # check [optional] secondary switch.
   if [[ $2 == "remove" || $2 == '--remove' ]]; then
      # Make sure the file exists, if not bail out.
      if ! [[ -f /etc/apt/apt.conf.d/70debconf ]]; then
         Error "ERROR: /etc/apt/apt.conf.d/70debconf does not exist."
         exit 0;
      fi
      if ! [[ -w /etc/apt/apt.conf.d/70debconf && -f /etc/apt/apt.conf.d/70debconf ]]; then
         Error "Insufficent privilages. Please prefix sudo, or perform as super user."
         Encapsulate "sudo keysnatcher --timeout remove"
         FullBar
         exit 0;
      fi
      
      sed -i '/^\/\/Server down takes too long, add timeout/ d' /etc/apt/apt.conf.d/70debconf
      sed -i '/^Acquire::http::Timeout "2";/ d' /etc/apt/apt.conf.d/70debconf
      sed -i '/^Acquire::ftp::Timeout "2";/ d' /etc/apt/apt.conf.d/70debconf
      GREPPED=$(cat /etc/apt/apt.conf.d/70debconf | grep -i "Timeout")
      if ! [[ $GREPPED ]]; then
         Encapsulate "Removing server timeout setting: Success"
         FullBar
      else
         Error "Removing server timeout setting: Failure"
      fi
   else
      if [[ -f /etc/apt/apt.conf.d/70debconf ]]; then
         SUCCESS=$(cat /etc/apt/apt.conf.d/70debconf | grep -i 'Timeout')
         if ! [[ $SUCCESS ]]; then
            if ! [[ -w /etc/apt/apt.conf.d/70debconf ]]; then
               Error "Insufficent privilages. Please prefix sudo, or perform as super user."
               Encapsulate "sudo keysnatcher --timeout"
               FullBar
               exit 0;
            fi
            SUCCESS=$(echo '//Server down takes too long, add timeout' | tee -a  /etc/apt/apt.conf.d/70debconf)
            SUCCESS=$(echo 'Acquire::http::Timeout "2";' | tee -a  /etc/apt/apt.conf.d/70debconf)
            SUCCESS=$(echo 'Acquire::ftp::Timeout "2";' | tee -a  /etc/apt/apt.conf.d/70debconf)
            if [[ $SUCCESS ]]; then
               Encapsulate "Setting 2 second server timeout a fix for IPV6 issues: Success"
               FullBar
            else
               Encapsulate "Setting 2 second server timeout a fix for IPV6 issues: Failure"
               FullBar
            fi
         else
            Encapsulate "Server Timeout has already been configured."
            FullBar
         fi
      
      else
         echo -e -n "${bldgrn}Setting 2 second server timeout a fix for IPV6 issues: "
         SUCCESS=$(echo '//Server down takes too long, add timeout' | sudo tee -a  /etc/apt/apt.conf.d/70debconf)
         SUCCESS=$(echo 'Acquire::http::Timeout "2";' | sudo tee -a  /etc/apt/apt.conf.d/70debconf)
         SUCCESS=$(echo 'Acquire::ftp::Timeout "2";' | sudo tee -a  /etc/apt/apt.conf.d/70debconf)
         if [[ $SUCCESS ]]; then
            Encapsulate "Setting 2 second server timeout a fix for IPV6 issues: Success"
         else
            Encapsulate "Setting 2 second server timeout a fix for IPV6 issues: Failure"
         fi
      fi
   fi
}

function ReScan(){
   if [[ -f ~/.keysnatcher ]]; then
      if [[ -w ~/.keysnatcher ]]; then
         SUCCESS=$(rm ~/.keysnatcher)
         Connectivity
      else
         VersionDump
         Error "Insufficent privilages. Please prefix sudo, or perform as super user."
         Encapsulate "sudo keysnatcher --rescan"
         exit 0;
      fi
   else
      VersionDump
      Error "Error: No configuration found, please run keysnatcher --snatch first."
      exit 0;
   fi
}

function Help() {
   VersionDump
   if [[ $1 == "" ]];
   then
      PRAM="ALL"
   else
      PRAM=$1
   fi

   case $PRAM in
      ALL)
echo -e "\n"
EyeCandy "${bldgrn}Usage: $PROGNAME -<-COMMAND>${txtrst}"
echo -e "Mandatory arguments to long options are identical for short options."
echo -e "   possible commands..."
echo -e ""
echo -e "   -f   --fixerrors   fix 403 / 404 errors with repositories"
echo -e "   -s   --snatch   snatch missing keys"
echo -e "   -h   --help      this help message"
echo -e "   -r   --rescan   rescan servers to determine which is fastest"
echo -e "   -t   --timeout   fix IPV6 timeout issues"
echo -e "   -v   --version   dump version info"
echo -e ""
echo -e "${bldgrn}$PROGNAME --help [COMMAND] for further information.${txtrst}";;
      ALL|f|fixerrors)
      echo -e ""
EyeCandy "${bldgrn}Usage fixerrors;${txtrst}"
echo -e "${txtgrn}$PROGNAME -f${txtrst}"
echo -e "  Fixes repository based error(s). Any repository that gives a 404 or 403 error"
echo -e "  is pushed into a error log, this error log is parsed and scans your"
echo -e "  software sources looking for the offending repository.  The offending"
echo -e "  repository is then commented out allowing you to if so desired reverse"
echo -e "  it's effect, for example if the server should happen to come back online.\n";;
      ALL|s|snatch)
      echo -e ""
EyeCandy "${bldgrn}Usage snatch;${txtrst}"
echo -e "${txtgrn}$PROGNAME -s [OPTION]${txtrst}"
echo -e "  Snatches missing GPG keys. The software will determine the fastest GPG"
echo -e "  key server this operation is only performed once (see help rescan) to"
echo -e "  accelerate any future grabbing of missing keys. The sofware then scans"
echo -e "  for missing keys and retrieves any missing key from the fastest detected"
echo -e "  key server.  You may optionally [skip] the connectivity test.\n"
echo -e "${bldgrn}Example: keysnatcher --snatch skip\n${txtrst}";;
      ALL|r|rescan)
      echo -e ""
EyeCandy "${bldgrn}Usage rescan;${txtrst}"
echo -e "${txtgrn}$PROGNAME -r${txtrst}"
echo -e "  Rescans GPG key servers and sets the fastest server as your default for"
echo -e "  retriving GPG keys.\n";;
      ALL|t|timeout)
      echo -e ""
EyeCandy "${bldgrn}Usage timeout [remove];${txtrst}"
echo -e "${txtgrn}$PROGNAME -t${txtrst}"
echo -e "  Sets the default timeout for a server response to 2 seconds.  IPV6"
echo -e "  servers can take up to 3 minutes to resolve, this \"workaround\" accelerates"
echo -e "  this operation. If you are for some reason not happy with this resolve"
echo -e "  you can remove it with the [OPTIONAL] remove switch.\n"
echo -e "${bldgrn}Example: keysnatcher --timeout remove\n${txtrst}";;
      ALL|v|version)
echo -e ""
EyeCandy "${bldgrn}Usage version;${txtrst}"
echo -e "${txtgrn}$PROGNAME -v${txtrst}"
echo -e "  Displays $PROGNAMEs version number and exits.\n";;
      ALL|h|help|\?)
echo -e ""
EyeCandy "${bldgrn}Useage Help [COMMAND];${txtrst}"
echo -e "${txtgrn}$PROGNAME -h [COMMAND]${txtrst}"
echo -e "  Displays this message. For futher information $PROGNAME help [COMMAND]"
echo -e "  or refer to the manpages.\n"
echo -e ""
echo -e "man $PROGNAME"
echo -e "${txtgrn}"
echo -e "Example: $PROGNAME -h version"
echo -e "${txtwht}Will display help about the command version${txtrst}";;
      *)
echo -e ""
EyeCandy "${bldgrn}Useage Help [COMMAND];${txtrst}"
echo -e "${txtgrn}$PROGNAME -h [COMMAND]${txtrst}"
echo -e "  Displays this message. For futher information $PROGNAME help [COMMAND]"
echo -e "  or refer to the manpages."
echo -e ""
echo -e "man $PROGNAME"
echo -e "${txtgrn}"
echo -e "Example: $PROGNAME -h version"
echo -e "${txtwht}Will display help about the command version${txtrst}\n";;
esac
FullBar
exit 0
}

# Command line pre-processor

case "$1" in
   -r|--rescan) ReScan; exit 0;;
   -f|--fixerrors) FixErrors; exit 0;;
   -t|--timeout) ServerTimeOut $*; exit 0;;
   -s|--snatch) Connectivity $*; GrabKeys; exit 0;;
   -h|--help|-\?) Help $2; exit 0;;
   -v|--version) VersionDump; exit 0;;
   *) Help; exit 0;;
esac


Bash autocompletion:
Code: Select all
# Debian keysnatcher(8) completion.

have keysnatcher &&
_keysnatcher()
{
   dashify()
   {
      local i

      for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do
         if [ ${#COMPREPLY[i]} -le 2 ]; then
            COMPREPLY[i]=-${COMPREPLY[i]}
         else
            COMPREPLY[i]=--${COMPREPLY[i]}
         fi
      done
   }

   local cur cur_nodash prev

   COMPREPLY=()
   cur=${COMP_WORDS[COMP_CWORD]}
   cur_nodash=${cur#-}
   prev=${COMP_WORDS[COMP_CWORD-1][COMP_CWORD-2]}

   if [ $COMP_CWORD = 1 ]; then
      # first parameter on line
      case "$cur" in
      -s*)
         COMPREPLY=( $( compgen -W 'snatch' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      -f*)
         COMPREPLY=( $( compgen -W 'fixerrors' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      -t*)
         COMPREPLY=( $( compgen -W 'timeout' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      -r*)
         COMPREPLY=( $( compgen -W 'rescan' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      -h*)
         COMPREPLY=( $( compgen -W 'help' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      -v*)
         COMPREPLY=( $( compgen -W 'verbose version' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      --*)
         COMPREPLY=( $( compgen -W 'fixerrors snatch help timeout rescan version' ${cur_nodash#-} ) )
         dashify;
         return 0
         ;;
      *)
         COMPREPLY=( $( compgen -W 'f s h r t v' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      esac
   fi
   if [ $COMP_CWORD = 2 ]; then
      case "${COMP_WORDS[1]}" in
      --t*)
         # analyze completion
         COMPREPLY=( $( compgen -W 'remove' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      -t*)
         # analyze completion
         COMPREPLY=( $( compgen -W 'remove' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      -s*)
         # analyze completion
         COMPREPLY=( $( compgen -W 'skip' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      --s*)
         # analyze completion
         COMPREPLY=( $( compgen -W 'skip' \
                   $cur_nodash ) )
         dashify
         return 0
         ;;
      --h*)
         # complete on list of relevant options
         COMPREPLY=( $( compgen -W 'fixerrors help rescan snatch timeout version' ${cur_nodash#-} ) )
         #dashify;
         return 0
         ;;
      -h)
         # complete on list of relevant options
         COMPREPLY=( $( compgen -W 'fixerrors help rescan snatch timeout version' ${cur_nodash#-} ) )
         #dashify;
         return 0
         ;;
      esac
   fi
   case "${COMP_WORDS[2]}" in
   timeout)
      # standard filename completion
      COMPREPLY=( $( compgen -W 'remove' ${cur_nodash#-} ) )
      return 0
      ;;
   -t*)
      # standard filename completion
      COMPREPLY=( $( compgen -W 'remove' ${cur_nodash#-} ) )
      return 0
      ;;
   snatch)
      # standard filename completion
      COMPREPLY=( $( compgen -W 'skip' ${cur_nodash#-} ) )
      return 0
      ;;
   -s*)
      # standard filename completion
      COMPREPLY=( $( compgen -W 'skip' ${cur_nodash#-} ) )
      return 0
      ;;
   esac

}
complete -F _keysnatcher keysnatcher


The App:
http://os-builder.com/UETOYS/

There are comments in the code for any further reading. Any questions please feel free to ask.
Attachments
ultimate-edition-keysnatcher-1.0.3_all.deb
(7.44 KiB) Downloaded 290 times
ultimate-edition-keysnatcher-1.0.4_all.deb
1.0.4 , yes it did exist.
(9.07 KiB) Downloaded 133 times
ultimate-edition-keysnatcher-1.0.5_all.deb
(10.06 KiB) Downloaded 132 times
ultimate-edition-keysnatcher-1.0.6_all.deb
(25.81 KiB) Downloaded 135 times
ultimate-edition-keysnatcher-1.0.7_all.deb
(25.89 KiB) Downloaded 145 times
ultimate-edition-keysnatcher-1.0.8_all.deb
(23.84 KiB) Downloaded 163 times
keysnatcher.pdf
PDF of manpage
(9.17 KiB) Downloaded 131 times
ultimate-edition-keysnatcher-1.0.9_all.deb
(23.82 KiB) Downloaded 154 times
Home of Ultimate Edition. Got a question? Please review the F.A.Q. Browse the How to section.

Main O/S: Builder of O/S Guess.
Mainboard: ASUS Hero VI (AM4)
CPU: AMD 1700X water cooled (Deepcool Captain Genome Cooling tower)
Ram: 16 GB GSkill Trident RGB Series Dual Channel DDR4 3200
Video: MSI RX470 8GB Gaming card.
Hard Disks: MASSIVE on the network.(10 Gigabit, 48 port, multiple servers)
Monitors: 4K Samsung 28", HannsG HH281, Various others
750 Watt modular PSU (Rosswell)
1100 Watt Amp & 4 X 600 Watt speakers

Servers in the basement.
User avatar
TheeMahn
Site Admin
 
Posts: 4199
Joined: Fri Oct 12, 2007 10:02 am
Location: U.S.A.
Age: 47
Operating System: Ultimate Edition Developer



Re: Keysnatcher

Postby BBOSAK2143 » Fri Feb 14, 2014 9:56 am

Was 3rd in line for this one! Must be sleeping too long! Will be putting this in ASAP and be using it! Maybe now after this brilliance I can finally build a viable system!!! Never can thank you enough for being here for all of us! Should get a chance to get this in after a few other tasks get done. Will let you know the output! THANK YOU!!!
Firm believer in Asus, Linux and Technology
"Art is to be enjoyed by all that enjoy it"
Asus M5A97 Plus motherboard
AMD FX 4350 Processor
Asus R7250 2GD5 graphics card
16gig DDR3-1333
2TB Hitachi Hard Drive
24in Asus VE248 LED Monitor
OS=My 8th OS Star Trek(Ubuntu 16.04)
Desktops=Gnome 3.20 and LXDE
Warp Speed!
ASUS Laptop R503U
AMD E2-1800
ATI HD7340
4gig Memory
500gig Hitachi HD
OS= Win7 SP1/8th OS Star Trek(Ubuntu 16.04)
Desktops Gnome 3.20 and LXDE
2nd 500gig Seagate HD R.I.P
User avatar
BBOSAK2143
U.E. God
U.E. God
 
Posts: 923
Joined: Tue Jul 03, 2012 7:56 pm
Location: Mount Pleasant, Tennessee
Age: 55
Operating System: Ultimate Edition 3.5 64 BIT



Re: Keysnatcher

Postby BBOSAK2143 » Fri Feb 14, 2014 2:40 pm

Oh Yeah!!! You know, I am not gifted with Linux whatsoever! The gpg keys astound me and always mess them up some way or another! With this tool, is DONE! Can you say BYE BYE???? Love it TheMahn is awesome! Here's output:

Code: Select all
Fetched 1129 kB in 52s (21.4 kB/s)
Reading package lists...
W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages)
W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main i386 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems
root@bob-System-Product-Name:/# apt-get upgrade
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@bob-System-Product-Name:/# keysnatcher --help
KeySnatcher 1.0.3, 02/13/2014
GNU KeySnatcher home page: <http://ultimateedition.info/>.
E-mail bug reports to: <theemahn@ultimateedition.info>.
Be sure to include the word KeySnatcher somewhere in the Subject: field.
Usage: KeySnatcher -<-COMMAND>
Mandatory arguments to long options are identical for short options.
   possible commands...

   -e   --errors   fix 404 errors with repositories
   -f   --fetch      fetch missing keys
   -h   --help      this help message
   -r   --rescan   rescan servers to determine which is fastest
   -t   --timeout   fix IPV6 timeout issues
   -v   --version   dump version info

KeySnatcher --help [COMMAND] for further information.
root@bob-System-Product-Name:/# keysnatcher -e
There are no errors to fix.
root@bob-System-Product-Name:/# keysnatcher -f
KeySnatcher 1.0.3, 02/13/2014
GNU KeySnatcher home page: <http://ultimateedition.info/>.
E-mail bug reports to: <theemahn@ultimateedition.info>.
Be sure to include the word KeySnatcher somewhere in the Subject: field.
Scanning for fastest host, this only needs to be done once.  Please wait...

KEY SERVER                     AVG PING

keyserver.ubuntu.com           190
pool.sks-keyservers.net        199
subkeys.pgp.net                DOWN
pgp.mit.edu                    DOWN
keys.nayr.net                  152
keys.gnupg.net                 178
Setting default keyserver as fastest server: keys.nayr.net | 152
Scanning for missing keys.
Ign http://us.archive.ubuntu.com saucy-security InRelease
Hit http://download.virtualbox.org saucy InRelease
Ign http://dl.google.com stable InRelease
Ign http://archive.ubuntu.com saucy-updates InRelease
Ign http://us.archive.ubuntu.com saucy-updates InRelease
Hit http://deb.opera.com stable InRelease
Ign http://ppa.launchpad.net saucy InRelease
Ign http://download.videolan.org  InRelease
Hit http://download.virtualbox.org saucy/contrib amd64 Packages
Ign http://dl.google.com stable InRelease
Get:1 http://us.archive.ubuntu.com saucy-security Release.gpg [933 B]
Get:2 http://archive.ubuntu.com saucy-updates Release.gpg [933 B]
Hit http://download.virtualbox.org saucy/contrib i386 Packages
Hit http://deb.opera.com stable/non-free amd64 Packages
Ign http://ppa.launchpad.net saucy InRelease
Hit http://download.videolan.org  Release.gpg
Hit http://dl.google.com stable Release.gpg
Get:3 http://us.archive.ubuntu.com saucy-updates Release.gpg [933 B]
Hit http://archive.getdeb.net saucy-getdeb InRelease
Hit http://dl.google.com stable Release.gpg
Get:4 http://archive.ubuntu.com saucy-updates Release [49.6 kB]
Hit http://deb.opera.com stable/non-free i386 Packages
Ign http://ppa.launchpad.net saucy InRelease
Get:5 http://us.archive.ubuntu.com saucy-security Release [49.6 kB]
Hit http://download.videolan.org  Release
Hit http://dl.google.com stable Release
Ign http://ppa.launchpad.net saucy InRelease
Hit http://download.videolan.org  Packages
Hit http://dl.google.com stable Release
Hit http://archive.getdeb.net saucy-getdeb/apps amd64 Packages
Ign http://ppa.launchpad.net saucy InRelease
Hit http://dl.google.com stable/main amd64 Packages
Get:6 http://archive.ubuntu.com saucy-updates/main amd64 Packages [202 kB]
Hit http://archive.getdeb.net saucy-getdeb/apps i386 Packages
Get:7 http://us.archive.ubuntu.com saucy-updates Release [49.6 kB]
Ign http://download.virtualbox.org saucy/contrib Translation-en
Hit http://dl.google.com stable/main i386 Packages
Ign http://ppa.launchpad.net saucy InRelease
Ign http://ppa.launchpad.net saucy InRelease
Hit http://dl.google.com stable/main amd64 Packages
Hit http://dl.google.com stable/main i386 Packages
Get:8 http://us.archive.ubuntu.com saucy-security/main amd64 Packages [83.8 kB]
Ign http://deb.opera.com stable/non-free Translation-en
Ign http://ppa.launchpad.net saucy InRelease
Ign http://download.videolan.org  Translation-en
Ign http://ppa.launchpad.net saucy InRelease
Ign http://ppa.launchpad.net saucy InRelease
Get:9 http://archive.ubuntu.com saucy-updates/restricted amd64 Packages [14 B]
Get:10 http://us.archive.ubuntu.com saucy-security/multiverse amd64 Packages [1161 B]
Ign http://ppa.launchpad.net saucy InRelease
Get:11 http://archive.ubuntu.com saucy-updates/main i386 Packages [201 kB]
Get:12 http://us.archive.ubuntu.com saucy-security/main i386 Packages [83.5 kB]
Ign http://ppa.launchpad.net saucy InRelease
Ign http://ppa.launchpad.net saucy InRelease
Get:13 http://us.archive.ubuntu.com saucy-security/multiverse i386 Packages [1385 B]
Ign http://ppa.launchpad.net saucy InRelease
Ign http://archive.getdeb.net saucy-getdeb/apps Translation-en
Hit http://us.archive.ubuntu.com saucy-security/main Translation-en
Ign http://ppa.launchpad.net saucy InRelease
Ign http://ppa.launchpad.net saucy InRelease
Ign http://ppa.launchpad.net saucy InRelease
Hit http://us.archive.ubuntu.com saucy-security/multiverse Translation-en
Ign http://ppa.launchpad.net saucy InRelease
Ign http://dl.google.com stable/main Translation-en
Get:14 http://us.archive.ubuntu.com saucy-updates/main amd64 Packages [202 kB]
Ign http://ppa.launchpad.net saucy InRelease
Ign http://dl.google.com stable/main Translation-en
Get:15 http://archive.ubuntu.com saucy-updates/restricted i386 Packages [14 B]
Ign http://ppa.launchpad.net saucy InRelease
Hit http://archive.ubuntu.com saucy-updates/main Translation-en
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://archive.ubuntu.com saucy-updates/restricted Translation-en
Get:16 http://us.archive.ubuntu.com saucy-updates/multiverse amd64 Packages [1563 B]
Hit http://ppa.launchpad.net saucy Release.gpg
Get:17 http://us.archive.ubuntu.com saucy-updates/main i386 Packages [201 kB]
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Get:18 http://us.archive.ubuntu.com saucy-updates/multiverse i386 Packages [1777 B]
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://us.archive.ubuntu.com saucy-updates/main Translation-en
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://us.archive.ubuntu.com saucy-updates/multiverse Translation-en
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release.gpg
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy Release
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Hit http://ppa.launchpad.net saucy/main amd64 Packages
Hit http://ppa.launchpad.net saucy/main i386 Packages
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en
Fetched 1129 kB in 51s (21.9 kB/s)
Reading package lists...
Missing keys if any successfully snatched.
root@bob-System-Product-Name:/#


You will notice starts out with all my lovely gpg errors. Then boom just use keysnatcher and wipes that out! Now what could be easier and simpler than this???? As will always say Love Your Style TheeMahn! This is once again a very classy program. Just proves who is the true master of Linux! Thanks once again, you know I will always use this too! Some people as myself just have not mastered gpg keys, but Ubuntu developers think we all have! Thank God, we have someone like TheeMahn that understands not everyone of us is a developer!
Firm believer in Asus, Linux and Technology
"Art is to be enjoyed by all that enjoy it"
Asus M5A97 Plus motherboard
AMD FX 4350 Processor
Asus R7250 2GD5 graphics card
16gig DDR3-1333
2TB Hitachi Hard Drive
24in Asus VE248 LED Monitor
OS=My 8th OS Star Trek(Ubuntu 16.04)
Desktops=Gnome 3.20 and LXDE
Warp Speed!
ASUS Laptop R503U
AMD E2-1800
ATI HD7340
4gig Memory
500gig Hitachi HD
OS= Win7 SP1/8th OS Star Trek(Ubuntu 16.04)
Desktops Gnome 3.20 and LXDE
2nd 500gig Seagate HD R.I.P
User avatar
BBOSAK2143
U.E. God
U.E. God
 
Posts: 923
Joined: Tue Jul 03, 2012 7:56 pm
Location: Mount Pleasant, Tennessee
Age: 55
Operating System: Ultimate Edition 3.5 64 BIT



Re: Keysnatcher

Postby TheeMahn » Fri Feb 14, 2014 6:08 pm

Thanks, brother.

The -e switch will technically not work w/o using the fetch switch first. I guess another revision is in order ;) I suppose I could have it check for the existence of /tmp/keysmissing then execute the -f switch. Always nice to see how people use the software to provide insight & improvements.

Thanks again,
Home of Ultimate Edition. Got a question? Please review the F.A.Q. Browse the How to section.

Main O/S: Builder of O/S Guess.
Mainboard: ASUS Hero VI (AM4)
CPU: AMD 1700X water cooled (Deepcool Captain Genome Cooling tower)
Ram: 16 GB GSkill Trident RGB Series Dual Channel DDR4 3200
Video: MSI RX470 8GB Gaming card.
Hard Disks: MASSIVE on the network.(10 Gigabit, 48 port, multiple servers)
Monitors: 4K Samsung 28", HannsG HH281, Various others
750 Watt modular PSU (Rosswell)
1100 Watt Amp & 4 X 600 Watt speakers

Servers in the basement.
User avatar
TheeMahn
Site Admin
 
Posts: 4199
Joined: Fri Oct 12, 2007 10:02 am
Location: U.S.A.
Age: 47
Operating System: Ultimate Edition Developer



Re: Keysnatcher

Postby BBOSAK2143 » Sat Feb 15, 2014 5:19 pm

It's a nice tool, have to state that fact! Just found out seems to be no permanance to it. Had to run it again today as saw the same gpg errors. Oh this stuff is giving me a headache! Honestly, how you do it and put up with this stuff at points, leads me to believe you have a very high amount of patience!!!! My Dad was like that too! Sure wish more of his patience would have rubbed off on me! This 13.10 is knocking my head off my shoulders! Loaded it with ThumbOS but of course I think I did a stupid thing as did not erase it with ThumbOS first. Gparted leaves junk behind. Was in a rush to try it and see where I was at. A few things did not make any sense so I suspect whatever got left behind bleeded out to the system on the flash! My dad use to yell at me for rushing things and to be honest, wish he was still around to do it! So for ThumbOS will always have to remember erase with same program or may not work correctly! Still not sure about this mouse on Flashback desktop. Some of these new ideas are just tearing me apart since I have no knowledge what to do!

Either the setting I did was correct and I should have formatted with ThumbOS before loading or it will still not show a visible cursor for Flashback desktop. Logging in and out of desktops is smooth as silk, never saw it better. A setting claimed nautilus.desktop was not in org.settings so am suspecting did not load correctly due to my rushing and not formatting! Still, with you years of experience and know how figured would run those by you. Figure is worth a shot to get your opinion as who would know better?????

Am going to say this again as is 100% true. I see your drive and motivation. It is so rich and inspirational! I find myself pushing harder and harder all the time with this stuff! Is just awesome to know someone has as much drive and pushes as hard as you do! I just can not help but do my best to move forward on all this in hopes one day, I will be maybe half as brilliant as you are! Any way know you are busy with everything you do and just always wish you the best! Thanks for being who you are!!!!
Firm believer in Asus, Linux and Technology
"Art is to be enjoyed by all that enjoy it"
Asus M5A97 Plus motherboard
AMD FX 4350 Processor
Asus R7250 2GD5 graphics card
16gig DDR3-1333
2TB Hitachi Hard Drive
24in Asus VE248 LED Monitor
OS=My 8th OS Star Trek(Ubuntu 16.04)
Desktops=Gnome 3.20 and LXDE
Warp Speed!
ASUS Laptop R503U
AMD E2-1800
ATI HD7340
4gig Memory
500gig Hitachi HD
OS= Win7 SP1/8th OS Star Trek(Ubuntu 16.04)
Desktops Gnome 3.20 and LXDE
2nd 500gig Seagate HD R.I.P
User avatar
BBOSAK2143
U.E. God
U.E. God
 
Posts: 923
Joined: Tue Jul 03, 2012 7:56 pm
Location: Mount Pleasant, Tennessee
Age: 55
Operating System: Ultimate Edition 3.5 64 BIT


Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests