socat -d -d TCP4-LISTEN:15432,fork UNIX-CONNECT:/srv/mongodb-27017.sock./forward-port-to-socket.sh 15432 /srv/mongodb-27017.sock| # remove all trash images | |
| docker rmi $(docker images | grep "^<none>" | awk '{print $3}') | |
| # or | |
| docker rmi $(docker images -q -f dangling=true) | |
| # stop all projects by name | |
| docker stop $(docker ps | grep "container_name" | awk '{print $1}') | |
| # get public port by private port and container name | |
| docker port container_name_or_id 27017 | awk -F':' '{print $2}' |
| mongoexport --collection collectioname --db databasename --out /tmp/output | |
| mongoimport --collection collectioname --db databasename --file /tmp/list-to-import.json --jsonArray --stopOnError |
| for code in {0..255}; do echo -e "\e[38;05;${code}m $code: Test"; done |
| // before | |
| { 'content[title]': 'test', | |
| 'content[excerpt]': 'test', | |
| 'content[content]': 'test', | |
| 'content[featuredImage][title]': 'test', | |
| 'content[source][title]': 'test', | |
| 'content[source][url]': 'http://google.com', | |
| 'content[source][author]': 'test', | |
| 'content[source][publishedAt]': '25/07/2014', | |
| 'content[topics]': '539f11bcfdf15258000d9922' } |
| var nodemailer = require('nodemailer'), | |
| env = require('../env'); | |
| var Service = module.exports = function () {}; | |
| Service.prototype.sendByCurrentUserEmailAccount = function(opt, user) { | |
| var smtpTransport = nodemailer.createTransport('SMTP', { | |
| service: 'Gmail', | |
| auth: { | |
| XOAuth2: { |
| ^(?!One|Two|Four)+.* |
| curl -H "Content-Type: application/json" -d '{ "field": "value" }' http://someurl.com |
| if (typeof x !=== 'undefined' && x !=== '') { | |
| // not emtpy | |
| } |
| #!/usr/bin/env python | |
| """ | |
| Check all existing Docker containers for their mapped paths, and then purge any | |
| zombie directories in docker's volumes directory which don't correspond to an | |
| existing container. | |
| """ | |
| import logging | |
| import os | |
| import sys |