-
Delete all containers
$ docker ps -q -a | xargs docker rm
-q prints only the container IDs -a prints all containers
Notice that it uses xargs to issue a remove container command for each container ID
- Delete all untagged images
<div class="tv-main-content"> | |
<div class="main-trip"> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-6"> | |
<h2>{{agency.name}} Live Chat</h2> | |
<h4>Hi {{trip.author.first_name}}</h4> | |
{% if advisor.size > 0 %} | |
import subprocess | |
from snimpy.manager import Manager as M | |
from snimpy.manager import load | |
import paramiko | |
import MySQLdb | |
import socket | |
USER = 'zenossmon' | |
KEY_FILE = '/home/efren/.ssh/id_rsa.pub' |
r := mux.NewRouter() | |
// Single handler | |
r.HandleFunc("/form", use(http.HandlerFunc(formHandler), csrf, logging) | |
// All handlers | |
http.Handle("/", recovery(r)) | |
// Sub-routers | |
apiMiddleware := []func(http.Handler) http.Handler{logging, apiAuth, json} |
max_password_lenght = 8 | |
characters = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map { |i| i.to_a }.flatten | |
password = (0...max_password_lenght).map { characters[rand(characters.length)] }.join | |
puts password |
Delete all containers
$ docker ps -q -a | xargs docker rm
-q prints only the container IDs -a prints all containers
Notice that it uses xargs to issue a remove container command for each container ID
import urllib2 | |
import logging | |
from time import sleep | |
# how minutes wait between checks | |
time_between_check = 5 | |
# setup log output | |
logging.basicConfig(filename='publicIP.log', | |
level=logging.DEBUG, |
# download latest libevent2 and tmux sources, and extract them somewhere | |
# | |
# at the time of writing: | |
# https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
# http://sourceforge.net/projects/tmux/files/latest/download?source=files | |
# | |
# don't compile tools as root, just don't do it. | |
# install deps |
require 'faye/websocket' | |
require 'eventmachine' | |
require 'json' | |
require 'logger' | |
api_key = 'Put your API Key here' | |
url = 'wss://stream.pushbullet.com/websocket/' + api_key | |
logger = Logger.new('pushbullet.log') | |
logger.level = Logger::INFO |
import websocket | |
import json | |
import logging | |
import datetime | |
api_key = 'Put your API Key here' | |
url = 'wss://stream.pushbullet.com/websocket/' + api_key | |
logging.basicConfig(filename='pushbullet.log', level=logging.INFO, | |
format='%(asctime)s:%(levelname)s:%(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') |
ActiveSupport::Inflector.inflections do |inflect| | |
inflect.plural /([aeiou])([A-Z]|_|$)/, '\1s\2' | |
inflect.plural /([rlnd])([A-Z]|_|$)/, '\1es\2' | |
inflect.plural /([aeiou])([A-Z]|_|$)([a-z]+)([rlnd])($)/, '\1s\2\3\4es\5' | |
inflect.plural /([rlnd])([A-Z]|_|$)([a-z]+)([aeiou])($)/, '\1es\2\3\4s\5' | |
inflect.singular /([aeiou])s([A-Z]|_|$)/, '\1\2' | |
inflect.singular /([rlnd])es([A-Z]|_|$)/, '\1\2' | |
inflect.singular /([aeiou])s([A-Z]|_)([a-z]+)([rlnd])es($)/, '\1\2\3\4\5' | |
inflect.singular /([rlnd])es([A-Z]|_)([a-z]+)([aeiou])s($)/, '\1\2\3\4\5' |