This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
OlderNewer