Skip to content

Instantly share code, notes, and snippets.

View antsankov's full-sized avatar

Alex Tsankov antsankov

View GitHub Profile
group population income
Under 05 21434 8
05 to 09 20785 9
10 to 14 19893 10
15 to 19 21086 13
20 to 24 21154 16
25 to 29 21453 27
30 to 34 19632 32
35 to 39 19888 35
40 to 44 20559 36

In-class Learning Challenge

Name

Alexander Tsankov

##Email [email protected]

Checkpoint 1

@antsankov
antsankov / Process Killer
Last active December 12, 2015 04:18
Process Killer (Helpful for your server) So I was doing some research and I found this script to use for your server, I have tested it out and tweaked it on my own machine, so if you are interested contact me so I can start making the tweaks so it is optimized for the retrograde server. Regards, Alex Tsankov
#!/bin/bash
##Note: will kill the top-most process if the $CPU_LOAD is greater than the $CPU_THRESHOLD.
#################### FOR TEST PURPOSES ONLY STILL NEEDS TO BE TWEAKED!!!#################
echo
echo checking for run-away process ...
CPU_LOAD=$(uptime | cut -d"," -f4 | cut -d":" -f2 | cut -d" " -f2 | sed -e "s/\.//g")
CPU_THRESHOLD=75 # This needs to be customized for the server so it knows when to start killing programs.
PROCESS=$(ps aux r)
TOPPROCESS=$(ps -eo pid -eo pcpu -eo command | sort -k 2 -r | grep -v PID | head -n 1)