Skip to content

Commit

Permalink
tmux feature added
Browse files Browse the repository at this point in the history
  • Loading branch information
B34MR committed Jul 7, 2021
1 parent d445b95 commit 9d9131b
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 5 deletions.
2 changes: 1 addition & 1 deletion configs/aliases.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[aliases]
alias ll='ls -al'
alias mkvenv='mkdir venv && virtualenv -p /usr/bin/python3 venv'
alias mkvenv='virtualenv -p /usr/bin/python3 venv'
alias activate='source venv/bin/activate'
alias python='python3'
alias t='tmux'
Expand Down
1 change: 1 addition & 0 deletions configs/internal.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ https://github.com/SecuraBV/CVE-2020-1472
https://github.com/SecureAuthCorp/impacket
https://github.com/sho-luv/mount_shares
https://github.com/skelsec/pypykatz
https://github.com/tmux-plugins/tpm
https://github.com/todonnal-r7/ResponderMITM
# https://github.com/danielmiessler/SecLists

Expand Down
34 changes: 34 additions & 0 deletions configs/tmux.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none

# modes
setw -g clock-mode-colour colour5
setw -g mode-style 'fg=colour1 bg=colour18 bold'

# panes
set -g pane-border-style 'fg=colour19 bg=colour0'
set -g pane-active-border-style 'bg=colour0 fg=colour9'

# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-style 'bg=colour18 fg=colour137 dim'
set -g status-left ''
set -g status-right '#[fg=colour233,bg=colour19] %d/%m #[fg=colour233,bg=colour8] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20

setw -g window-status-current-style 'fg=colour1 bg=colour19 bold'
setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '

setw -g window-status-style 'fg=colour9 bg=colour18'
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '

setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'

# messages
set -g message-style 'fg=colour232 bg=colour16 bold
44 changes: 40 additions & 4 deletions tooltime.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from utils import install
from utils import richard as r
import os
import shutil
import logging
import time

Expand Down Expand Up @@ -43,6 +44,22 @@ def make_threaded(func, urls):
logging.warning(f'{e}')
else:
logging.info(f'Downloaded: {data}')


def copy_file(src, dst):
'''
Copy file from src to dst via the shutil module.
Return filepath.
arg(s) src:str, dst:str'''

try:
filepath = shutil.copy(src, dst)
except IOError as e:
raise e
except Exception as e:
raise e
else:
return filepath


def append_str(mystr, filepath):
Expand Down Expand Up @@ -81,9 +98,28 @@ def main():
# Args - Configfile path
filepath = args.configfile

# Set delimiter ':' for 'aliases.ini' configfile.
# filename provided on cli.
filename = os.path.basename(filepath)
if filename == 'aliases.ini':

# Tmux.ini mode.
if filename == 'tmux.ini':
r.banner('Tmux.conf')
# Config filepath.
tmux_ini = './configs/tmux.ini'
# tmux.conf and tmux.conf.bak filepaths.
tmux_conf = os.path.join(os.path.expanduser('~'), '.tmux.conf')
tmux_bak = tmux_conf + '.bak'
if os.path.isfile(tmux_conf):
# Create 'tmux.conf.bak' backup.
r.logging.warning(f'File already exists: {tmux_conf}')
filepath = copy_file(tmux_conf, tmux_bak)
r.logging.info(f'Created backup: {filepath}')
# Copy 'tmux.ini' to 'tmux.conf'.
filepath = copy_file(tmux_ini, tmux_conf)
r.logging.info(f'Copied: {tmux_ini} to {filepath}')

# Alias mode - set delimiter ':' for 'aliases.ini' configfile.
elif filename == 'aliases.ini':
config = ConfigParser(allow_no_value=True, delimiters='*')
config.optionxform = str
config.read(filepath)
Expand All @@ -97,7 +133,7 @@ def main():
# Append list to file.
results = append_lst(ALIASES, filepath)
# Print results.
[logging.info(f'Append {filepath}: {result}') for result in results]
[logging.info(f'Appended {filepath}: {result}') for result in results]
# Check if exports are in configfile.
r.banner('Exports')
if EXPORTS:
Expand All @@ -107,7 +143,7 @@ def main():
# Print results.
[logging.info(f'Appended {filepath}: {result}') for result in results]

# Set delimiter '=' for all other configfiles.
# Tool mode - set delimiter '=' for all other configfiles.
else:
config = ConfigParser(allow_no_value=True, delimiters='=')
config.optionxform = str
Expand Down

0 comments on commit 9d9131b

Please sign in to comment.