Skip to content

Instantly share code, notes, and snippets.

@StrikeW
StrikeW / orders_debezium.json
Created September 21, 2023 06:30
Debezium JSON payload example
{
"before": null,
"after":
{
"O_ORDERKEY": 2,
"O_CUSTKEY": 78002,
"O_ORDERSTATUS": "O",
"O_TOTALPRICE": "46929.18",
"O_ORDERDATE": "1996-12-01",
"O_ORDERPRIORITY": "1-URGENT",
@StrikeW
StrikeW / docker-compose-kafka.yml
Created September 19, 2023 07:43
Kafka docker compose
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.2.1
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
kafka1:
image: confluentinc/cp-kafka:7.2.1
container_name: kafka1
@StrikeW
StrikeW / dbserver1.inventory.t.json
Created September 12, 2023 07:05 — forked from BugenZhao/dbserver1.inventory.t.json
MySQL Debezium Examples
{
"schema": {
"type": "struct",
"fields": [
{
"type": "struct",
"fields": [
{
"type": "int32",
"optional": true,
@StrikeW
StrikeW / tmux-cheatsheet.markdown
Created July 10, 2017 11:12 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@StrikeW
StrikeW / latency.txt
Created April 15, 2017 03:21 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@StrikeW
StrikeW / getcurtime.cpp
Created February 17, 2017 03:33
Linux下获取当前时区的时间
// Linux获取当前时区的时间
#include <iostream>
#include <unistd.h>
#include <stdio.h>
#include <time.h>
int main(int argc, char *argv[])
{
@StrikeW
StrikeW / cppstr.cpp
Created February 17, 2017 03:19
C++ string当作buffer来使用
// 2017.2.17
#include <iostream>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
struct yfs_dir_entry {
uint32_t inode; /* Inode number */
uint16_t rec_len; /* Directory entry length */
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
@StrikeW
StrikeW / backup
Created October 13, 2014 03:11
Tiny script used to backup folders
#!/bin/bash
#
# backup - Tiny script used to backup folders. This
# is an exercise for learning shell programming.
#
#
# Join elements in array
#
@StrikeW
StrikeW / search
Created October 13, 2014 03:06
Search a file for text. Like grep, but prints a window