Skip to content

Instantly share code, notes, and snippets.

View jhadev's full-sized avatar

Josh A jhadev

View GitHub Profile
@jhadev
jhadev / kill_old_ssh_agents
Created November 21, 2022 17:49 — forked from gubatron/kill_old_ssh_agents
Linux command (script) to kill old ssh-agent processes, (could be parametrized to change the process name)
#!/usr/bin/env python
# Author: @gubatron
# License: MIT License, Copyright 2019
import os
import sys
if __name__ == '__main__':
cmd_get_process_list = 'ps -ef --sort=start_time | grep ssh-agent | grep -v grep'
output = os.popen(cmd_get_process_list)
lines = output.read().split("\n")