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
[Unit] | |
Description=Kafka publish-subscribe messaging system | |
Requires=zookeeper@kafka.service | |
After=network.target zookeeper@kafka.service | |
[Service] | |
ExecStart=/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties | |
[Install] | |
WantedBy=multi-user.target |
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 | |
dev=$1 | |
b=0 | |
while : | |
do | |
a=`cat /proc/net/dev | grep $dev | sed "s/\s\{1,\}/ /g" | cut -d" " -f 11` | |
#echo $(($a-$b)) | |
byte=`expr $a - $b` | |
echo `expr $byte \* 8` |
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 <time.h> | |
#include <stdio.h> | |
int main(void) { | |
printf("time_t: %d\n", sizeof(time_t)); | |
printf("long: %d\n", sizeof(long)); | |
printf("timespec: %d\n", sizeof(struct timespec)); | |
return 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
import sys | |
from PIL import Image | |
im = Image.open(sys.argv[1]) | |
(w, h) = im.size | |
im.crop((0, 0, w/2, h/2)).save("f/a.png") | |
im.crop((w/2, 0, w, h/2)).save("f/b.png") |
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
'use strict'; | |
const readline = require("readline"); | |
const fs = require("fs"); | |
const {spawn} = require("child_process"); | |
//<flag 2byte><timestamp 4><addr 4><mask 4><asn 4> | |
const packEvent = ev => { | |
const buf = Buffer.alloc(18, 0); | |
const timestamp = +new Date/1000|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
set nocompatible | |
set number | |
set autoindent | |
set shiftwidth=2 | |
set softtabstop=2 | |
set tabstop=2 | |
set expandtab | |
set list | |
set listchars=tab:>-,trail:-,extends:> | |
set noundofile |
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
brctl addbr yabai | |
ip link set dev yabai up | |
ip a a 192.168.100.10/24 dev yabai | |
ip link add y-to-ns1 type veth peer name ns1-to-y | |
ip link add y-to-ns2 type veth peer name ns2-to-y | |
ip netns add ns1 | |
ip netns add ns2 |
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
#!/usr/bin/env python3 | |
import argparse | |
import logging | |
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) | |
from scapy.all import * | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-r", "--read", required=True, help="filename", default=None) | |
args = parser.parse_args() |
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
set nocompatible | |
set number | |
set autoindent | |
set shiftwidth=2 | |
set softtabstop=2 | |
set tabstop=2 | |
set expandtab | |
set list | |
set listchars=tab:>-,trail:-,extends:> | |
set noundofile |
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
v=2.10.0 | |
version=v$v | |
file=gobgp_${v}_linux_amd64 | |
service=gobgpd | |
wget https://github.com/osrg/gobgp/releases/download/${version}/${file}.tar.gz \ | |
-O /tmp/$file.tar.gz | |
NewerOlder