Stop all containers:
docker ps -aq | xargs docker stop
Remove all containers:
docker ps -aq | xargs docker rm
Remove all images:
docker images -aq | xargs docker rmi
Remove all networks:
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# Explained | |
wget \ | |
--recursive \ # Download the whole site. | |
--page-requisites \ # Get all assets/elements (CSS/JS/images). | |
--adjust-extension \ # Save files with .html on the end. | |
--span-hosts \ # Include necessary assets from offsite as well. | |
--convert-links \ # Update links to still work in the static version. |
<configuration> | |
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender"> | |
<target>System.err</target> | |
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | |
<level>WARN</level> | |
</filter> | |
<encoder> | |
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> | |
</encoder> | |
</appender> |
Stop all containers:
docker ps -aq | xargs docker stop
Remove all containers:
docker ps -aq | xargs docker rm
Remove all images:
docker images -aq | xargs docker rmi
Remove all networks:
Here are several different ways to test a TCP port without telnet.
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
-- Create a group | |
CREATE ROLE readaccess; | |
-- Grant access to existing tables | |
GRANT USAGE ON SCHEMA public TO readaccess; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
-- Grant access to future tables | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
// Option A: | |
const React = require('react'); | |
const counterState = React.createState(); | |
const counterReducer = (action, state) => { | |
switch (action) { | |
case "INCREMENT": { | |
return React.updateState({counter: state.counter + 1}); | |
} | |
} |
(defn arg-find | |
"Helper function for defroute that extracts code from the body and | |
organizes it as bindings, symbols and body. Function calls within | |
the body are replaced by their corresponding gensyms. (:symbols is | |
just a list of the gensyms in :bindings, for convenience)" | |
[body] | |
(reduce (fn [acc [k v]] | |
(if (list? v) | |
(let [sym (gensym (str (name k) "-"))] |
async function walk (dir, visitor) { | |
const filenames = await fs.readdirAsync(dir) | |
await* filenames | |
.map(filename => path.join(dir, filename)) | |
.map(async filename => { | |
const stat = await fs.statAsync(filename) | |
if (stat.isDirectory()) { | |
await walk(filename, visitor) | |
} else { |
{ | |
"curly": true, | |
"eqeqeq": true, | |
"bitwise": true, | |
"camelcase": true, | |
"expr": true, | |
"esnext": true, | |
"forin": true, | |
"freeze": true, | |
"immed": true, |
getters = (cls, getters) -> | |
cls.__base.__index = (key) => | |
if getter = getters[key] | |
getter @ | |
else | |
cls.__base[key] | |
setters = (cls, setters) -> | |
cls.__base.__newindex = (key, val) => | |
if setter = setters[key] |