Skip to content

Instantly share code, notes, and snippets.

View theqwan-chengwei's full-sized avatar

Cheng Wei theqwan-chengwei

  • The Qwan 得寬科技
  • Taipei, Taiwan
View GitHub Profile
@theqwan-chengwei
theqwan-chengwei / ClearBeanstalkdQueueCommand.php
Last active August 29, 2015 14:06 — forked from lukaswhite/ClearBeanstalkdQueueCommand.php
Clear Beanstalkd Queue of all queue connections in Laravel ( Get list of all queue connections by additional config file )
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class ClearBeanstalkdQueueCommand extends Command {
/**
@theqwan-chengwei
theqwan-chengwei / check_docker_container.sh
Created February 26, 2016 04:24 — forked from ekristen/check_docker_container.sh
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
# find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(