./bin/kafka-configs.sh --zookeeper zookeeper1:2181/kafka \
--alter --entity-type topics \
--entity-name test \
--add-config segment.ms=60000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bin/bash | |
table=$1 | |
pattern=$2 | |
if [[ -z "$table" ]] || [[ -z "$pattern" ]]; then | |
echo "Usage: $0 <iptables-table-name> <iptables-chain-name-grep-pattern>" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
kubeadm reset -f | |
yum remove -y kube* containerd* docker* nginx cri* | |
rm -rf /etc/containerd /etc/cni/net.d /home/docker /var/log/nginx /home/cert-deploy /home/containerd /etc/ansible-iptables | |
iptables-save | awk '/^[*]/ { print $1 } | |
/^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <array> | |
#include <climits> // INT_MAX | |
using namespace std; | |
struct Node { | |
int p = -1; | |
int d = INT_MAX; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function debounceFetch (fn, delay, onCancel = () => {}) { | |
let timer = 0, isFetching = false | |
return function (...args) { | |
clearTimeout(timer) | |
if (isFetching) { | |
onCancel() | |
isFetching = false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getImage = url => ( | |
new Promise((resolve, reject) => { | |
const image = new Image() | |
image.onload = e => { | |
resolve(image) | |
} | |
image.onerror = e => { | |
reject(Error("Network Error")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.text { | |
position: relative; | |
} | |
.text.type-finished::before { | |
animation: .5s steps(2, jump-none) 0s infinite alternate pulse; | |
} | |
.text::before { | |
content: ''; | |
height: 1em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stack> | |
#include <iomanip> | |
#include <map> | |
#include <cctype> | |
#include <cstdlib> | |
using namespace std; | |
#define SIZE(arr) (sizeof(arr) / sizeof((arr[0]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro_rules! postfix { | |
// Terminating rule | |
(() -> ($res:expr)) => {$res}; | |
// Addition | |
((+ $($rest:tt)*) -> ($a:tt $b:tt $($stack:tt)*)) => { | |
postfix!(($($rest)*) -> (($b + $a) $($stack)*)) | |
}; | |
// Subtraction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TYPE DATABASE USER ADDRESS METHOD | |
# "local" is for Unix domain socket connections only | |
local all all password | |
# IPv4 local connections: | |
host all all 127.0.0.1/32 password | |
# IPv6 local connections: | |
host all all ::1/128 ident | |
# Allow replication connections from localhost, by a user with the | |
# replication privilege. |
NewerOlder