Skip to content

Instantly share code, notes, and snippets.

Contributor License Agreement

Thank you for your interest in Linen.dev (the "Project"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Project must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Project and its users; it does not change your rights to use your own Contributions for any other purpose.

This version of the Agreement allows an entity (the "Corporation") or an individual to submit Contributions to the Project, to authorize Contributions submitted by its designated employees to the Project, and to grant copyright and patent licenses thereto.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Project. Except for the license granted herein to the Project and recipients of software distribut

Bash Explained: Chained Killing

In my previous roles with more devops responsibility I’ve found myself having to kill multiple process with the same name quite frequently and often times I find myself coming back to these chain of commands: ps aux | grep stupid_process | awk '{print $2}' | xargs sudo kill -9

Now in my development roles I’ve often found myself still leveraging the bash skills I’ve learned quite frequently in my day to day. I want to break down this command down in to its individual pieces and explain how they might be used in other scenarios. So hopefully next time you are aggressively stack overflowing a problem and sees a long chain of bash you can do the same.

So lets start with ps aux

ps returns a list of current running processes where aux is 3 separate flags that shows every process running on the system.

@cheeseblubber
cheeseblubber / cf_env_resources.rb
Last active August 29, 2015 14:08
Compiles the CPU, RAM, and Disk usage of our Pivotal Cloud environments
#!/usr/bin/env ruby
require 'rbvmomi'
def vCenter_session
# host is a vCenter, not an ESXi host
RbVmomi::VIM.connect host: ENV['VCENTER_HOST'], user: 'root', password: ENV['VCENTER_PASSWORD']
end
def find_datacenter(datacenter_name)