./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
<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. |
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
--- | |
- hosts: k8s_master,k8s_workers | |
become: true | |
remote_user: ansible | |
tasks: | |
# Docker installation | |
- name: Install helper packages | |
yum: |
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
package main | |
import ( | |
"sort" | |
"strings" | |
) | |
var romanIntMap = map[string]int{ | |
"M": 1000, | |
"D": 500, |
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 | |
#include <algorithm> // find | |
using std::vector; | |
using edges_t = vector<std::array<int, 2>>; | |
using graph_t = vector<edges_t>; |
NewerOlder