Skip to content

Instantly share code, notes, and snippets.

View naveenkashyapdv's full-sized avatar
🎯
Focusing

naveenkashyapdv

🎯
Focusing
View GitHub Profile
chef-server-ctl stop
chef-server-ctl kill
chef-server-ctl cleanse
chef-server-ctl uninstall
pkill -9 -u opscode
pkill -9 -f postgres
pkill -9 -f beam
pkill -9 -f /opt/chef
rm -rf /etc/opscode /etc/chef /opt/opscode /opt/chef /var/chef
rm -rf /etc/chef-server /etc/chef /opt/chef-server /opt/chef /root/.chef /var/opt/chef-server
@naveenkashyapdv
naveenkashyapdv / gist:46aa2b937f6501e9dd416e7bfaf95b40
Created April 1, 2019 20:22
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
import org.jenkinsci.plugins.workflow.job.WorkflowRun
import org.jenkinsci.plugins.workflow.flow.FlowExecution;
@naveenkashyapdv
naveenkashyapdv / cleanupJenkinsWorkspaces.groovy
Created April 1, 2019 20:23 — forked from EvilBeaver/cleanupJenkinsWorkspaces.groovy
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway