Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove newlines #675

Merged
merged 5 commits into from
Feb 27, 2024
Merged

Remove newlines #675

merged 5 commits into from
Feb 27, 2024

Conversation

nullmonk
Copy link
Collaborator

Remove all excess newlines from tomes
remove redundant tomes (hostname and get_net_info)
clean up table printing on a few tomes

for i, c in enumerate(r):
row.append(rpad(c, counts[i]+2))
print("".join(row))

def ifconfig():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename the tome from ifconfig to something less loaded like get_net_info or network_recon
Then in the future if we have other net info like trace route we can include it here as well.

@@ -216,13 +216,12 @@ def persist_service(service_name, service_desc, executable_name, executable_url)
executable_path = "/var/root/"+executable_name
launch_daemon(service_name, executable_path, executable_url)
else:
print("OS not supported\n")
print("OS not supported")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch to eprint


for proc in procs:
rows = [["PID", "PPID", "USER","COMMAND"]]
for proc in sorted(procs, key=lambda x:x["pid"]):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorting by PID? smh - if possible we should sort by spawn time (which i think is the default unsure thogh)

str(proc['pid']),
str(proc['ppid']),
proc['username'],
current_proc_command.replace("\n","\\n")[:80] # trim absurdly long cmds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not trim the command - in tavern we don't wrap so it won't look gross.
But if we avoid truncating that's more searchable fields.
Good for situations like REALLY long java commands with a "PASSWORD" arg.

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.03%. Comparing base (3532985) to head (997cd3d).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #675      +/-   ##
==========================================
+ Coverage   71.76%   72.03%   +0.27%     
==========================================
  Files         175      175              
  Lines       12111    12219     +108     
==========================================
+ Hits         8691     8802     +111     
+ Misses       3205     3202       -3     
  Partials      215      215              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay let the freeze begin

@hulto hulto merged commit 33b6eab into main Feb 27, 2024
6 checks passed
@hulto hulto deleted the remove-newlines branch February 27, 2024 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants