def show_speed(hash_file=None, session=None,
               wordlist=None, hash_mode=1000, speed_session=None,
               attack_mode=None, mask=None, rules=None,
               pot_path=None, brain=False, username=False,
               name=None, wordlist2=None):
    """
    Method to run hashcat with 'show' and 'speed_only' options to
    gather information relevant to brain use, and also for quick wins
    to skip the queue. It will pause the current job then run in the
    above modes to get passwords from the potfile and an estimated speed.

    Arguments
    ---------
    crack: object
        Hashcat execution python object for rq to execute
    hash_file: string
        File containing hashes to feed to hashcat
    session: Hashcat session
    wordlist: Wordlist to feed Hashcat

    Returns
    -------
    """
    started = rq.registry.StartedJobRegistry(queue=redis_q)
    cur_list = started.get_job_ids()
    speed_job = speed_q.fetch_job(speed_session)
    if len(cur_list) > 0:
        cur_job = redis_q.fetch_job(cur_list[0])
        if cur_job:
            if del_check(cur_job):
                logger.debug('Job stop already requested, not pausing')
                time.sleep(10)
            else:
                cur_job.meta['CrackQ State'] = 'Pause'
                logger.debug('Pausing active job')
                cur_job.save_meta()
        else:
            logger.debug('Failed to pause current job')
            raise ValueError('Speed check error')
    if attack_mode:
        if not isinstance(attack_mode, int):
            attack_mode = None
    # create initial json state, run show check and create file
    job_dict = {}
    job_dict['hash_mode'] = hash_mode
    job_dict['attack_mode'] = attack_mode
    job_dict['mask'] = mask
    if wordlist:
        job_dict['wordlist'] = [wl for wl, path in CRACK_CONF['wordlists'].items() if path == wordlist][0]
    if wordlist2:
        job_dict['wordlist2'] = [wl for wl, path in CRACK_CONF['wordlists'].items() if path == wordlist2][0]
    if rules:
        job_dict['rules'] = [rl for rl, path in CRACK_CONF['rules'].items() if path == rules]
    job = redis_q.fetch_job(speed_session[:-6])
    if brain:
        job_dict['brain_check'] = None
    else:
        logger.debug('Writing brain_check')
        job_dict['brain_check'] = False
        if job:
            job.meta['brain_check'] = False
            speed_job.save_meta()
    if job:
        job_dict['timeout'] = job.timeout
    job_dict['name'] = name
    job_dict['restore'] = 0
    job_dict['Cracked Hashes'] = 0
    job_dict['Total Hashes'] = 0
    status_file = valid.val_filepath(path_string=log_dir,
                                     file_string='{}.json'.format(speed_session[:-6]))
    cq_api.write_template(job_dict, status_file)
    outfile = valid.val_filepath(path_string=log_dir,
                                 file_string='{}.cracked'.format(speed_session[:-6]))
    # clear contents of previous cracked passwords file before running show
    try:
        with open(outfile, 'w') as fh_outfile:
            fh_outfile.truncate(0)
    except FileNotFoundError:
        logger.debug('No cracked file to clear')

    # run --show check
    hcat = runner(hash_file=hash_file, mask=mask,
                  session=speed_session, wordlist=wordlist,
                  outfile=str(outfile), attack_mode=attack_mode,
                  hash_mode=hash_mode, wordlist2=wordlist2,
                  username=username, pot_path=pot_path,
                  show=True, brain=False)
    hcat.event_connect(callback=cracked_callback,
                       signal="EVENT_POTFILE_HASH_SHOW")
    hcat.event_connect(callback=any_callback,
                       signal="ANY")
    counter = 0
    while counter < 100:
        if hcat is None or isinstance(hcat, str):
            return hcat
        hc_state = hcat.status_get_status_string()
        logger.debug('SHOW loop')
        if speed_job:
            if 'CrackQ State' in speed_job.meta:
                if del_check(speed_job):
                    break
        if hc_state == 'Running':
            break
        if hc_state == 'Paused':
            break
        elif hc_state == 'Aborted':
            event_log = hcat.hashcat_status_get_log()
            raise ValueError(event_log)
        time.sleep(1)
        counter += 1
    logger.debug('SHOW loop complete, quitting hashcat')
    hcat.hashcat_session_quit()
    hcat.reset()
    if brain:
        logger.debug('Brain not disabled by user')
        hcat = runner(hash_file=hash_file, mask=mask,
                      wordlist=wordlist, speed=True,
                      attack_mode=attack_mode,
                      hash_mode=hash_mode, rules=rules,
                      pot_path=pot_path, show=False,
                      brain=False, session=speed_session,
                      wordlist2=wordlist2)
        hcat.event_connect(callback=any_callback,
                           signal="ANY")
        mode_info = dict(hash_modes.HModes.modes_dict())[str(hash_mode)]
        logger.debug('Mode info: {}'.format(mode_info))
        salts = hcat.status_get_salts_cnt()
        logger.debug('Salts Count: {}'.format(salts))
        speed_counter = 0
        logger.debug('SPEED loop')
        while counter < 180:
            if hcat is None or isinstance(hcat, str):
                return hcat
            if speed_job.meta:
                if 'CrackQ State' in speed_job.meta:
                    if del_check(speed_job):
                        return hcat
            hc_state = hcat.status_get_status_string()
            if hc_state:
                speed_job = speed_q.fetch_job(hcat.session)
                logger.debug('Speed job:\n{}'.format(speed_job))
                if hc_state == 'Bypass':
                    if speed_job and mode_info:
                        logger.debug('Populating speed meta')
                        speed_info = int(hcat.status_get_hashes_msec_all() * 1000)
                        mode_info.append(speed_info)
                        mode_info.append(salts)
                        speed_job.meta['Mode Info'] = mode_info
                        speed_job.save_meta()
                        hc_state = hcat.status_get_status_string()
                    cur_list = started.get_job_ids()
                    cur_job = redis_q.fetch_job(cur_list[0])
                    if cur_job:
                        if not del_check(cur_job):
                            cur_job.meta['CrackQ State'] = 'Run/Restored'
                            cur_job.save_meta()
                            logger.debug('Resuming active job: {}'.format(cur_job.id))
                    else:
                        logger.debug('No job to resume')
                    hcat.status_reset()
                    hcat.hashcat_session_quit()
                    hcat.reset()
                    hc_state = hcat.status_get_status_string()
                    return hc_state
                elif 'Aborted' in hc_state:
                    event_log = hcat.hashcat_status_get_log()
                    raise ValueError('Aborted: {}'.format(event_log))
                else:
                    job = redis_q.fetch_job(session)
                    if job:
                        if del_check(job):
                            hcat.hashcat_session_quit()
                            hcat.reset()
            logger.debug('No hc_state')
            time.sleep(1)
            speed_counter += 1
        logger.debug('SPEED loop finished')
        event_log = hcat.hashcat_status_get_log()
        hcat.status_reset()
        hcat.hashcat_session_quit()
        hcat.reset()
        if len(cur_list) > 0:
            cur_job = redis_q.fetch_job(cur_list[0])
        else:
            cur_job = None
        if cur_job:
            if cur_job.meta['CrackQ State'] == 'Pause':
                cur_job.meta['CrackQ State'] = 'Run/Restored'
                cur_job.save_meta()
                logger.debug('Resuming active job')
        raise ValueError('Speed check error: {}'.format(event_log))
    else:
        logger.debug('Brain user-disabled')
        job = redis_q.fetch_job(session)
        if job:
            job.meta['brain_check'] = False
        if len(cur_list) > 0:
            cur_job = redis_q.fetch_job(cur_list[0])
        else:
            cur_job = None
        if cur_job:
            cur_job.meta['CrackQ State'] = 'Run/Restored'
            cur_job.save_meta()
            logger.debug('Resuming active job')
    return hc_state

    Method to run hashcat with 'show' and 'speed_only' options to
    gather information relevant to brain use, and also for quick wins
    to skip the queue. It will pause the current job then run in the
    above modes to get passwords from the potfile and an estimated speed.

    Arguments
    ---------
    crack: object
        Hashcat execution python object for rq to execute
    hash_file: string
        File containing hashes to feed to hashcat
    session: Hashcat session
    wordlist: Wordlist to feed Hashcat

    Returns
    -------
    
crackq/run_hashcat.py