Setup
bin/kafka-topics.sh \
--zookeeper zookeeper.example.com:2181 \
--create \
#!/bin/sh | |
# converts IPv4 as "A.B.C.D" to integer | |
# ip4_to_int 192.168.0.1 | |
# => 3232235521 | |
ip4_to_int() { | |
IFS=. read -r i j k l <<EOF | |
$1 | |
EOF | |
echo $(( (i << 24) + (j << 16) + (k << 8) + l )) |
#!/bin/bash -e | |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"). You | |
# may not use this file except in compliance with the License. A copy of | |
# the License is located at | |
# | |
# http://aws.amazon.com/apache2.0/ | |
# | |
# or in the "license" file accompanying this file. This file is |
See, also KUBERNETES-8523, KUBERNETES-8575 and ETCD-1137 |
See, also |
# Converts between dot.separated.case and SNAKE_CASE (app caps). | |
# dot.separated.case to SNAKE_CASE | |
# | |
# echo 'mysql.user' | dots_to_snake | |
# => MYSQL_USER | |
# | |
alias prop_to_env="tr '[a-z].' '[A-Z]_'" | |
# SNAKE_CASE to dot.separated.case |
10 | |
10-ea | |
10-ea-32 | |
10-ea-32-experimental | |
10-ea-32-jdk | |
10-ea-32-jdk-experimental | |
10-ea-32-jdk-slim | |
10-ea-32-jdk-slim-experimental | |
10-ea-32-jre | |
10-ea-32-jre-experimental |
# Get window info | |
xwininfo | |
# Save screenshot animation as a PNG format into outputs | |
ffmpeg -video_size $widthx$height -framerate 24 -f x11grab -i :0.0+$x,$y outputs/%04d.png | |
# Generate GIF from PNG images | |
ffmpeg -y -i outputs/%04d.png -ss 2.3 -t 15 -filter_complex "[0:v]setpts=0.7*PTS,split [a][b];[a] palettegen [p];[b][p] paletteuse" screenshot.gif |
struct Document<'a> { | |
fields: Vec<Box<Field + 'a>>, | |
} | |
impl<'a> Document<'a> { | |
fn new() -> Document<'a> { | |
Document { fields: Vec::new() } | |
} | |
fn add_field<T>(&mut self, field: T) |
package main | |
import ( | |
"bufio" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"os" | |
"strings" | |
) |