Skip to content

Instantly share code, notes, and snippets.

View szaydel's full-sized avatar

Sam Zaydel szaydel

  • RackTop Systems
  • Moss Beach
View GitHub Profile
#define _GNU_SOURCE
#include <getopt.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>
filebeat.inputs:
- type: kafka
hosts: 'the.kafka.server.com:9092'
topics: 'my_topic'
group_id: 'my_group'
ssl.enabled: yes
username: <API KEY>
password: <API SECRET>
cat /proc/[pid]/statm | awk '{print $6 * lshift(1, 12) / lshift(1, 20)}'
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
/*
PCG code taken from:
https://github.com/imneme/pcg-c-basic/blob/bc39cd76ac3d541e618606bcc6e1e5ba5e5e6aa3/pcg_basic.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/random.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
fd_set rfds;
struct timeval tv;
package main
import (
"io"
"io/ioutil"
"log"
"net"
"os"
"syscall"
"time"
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
3;fio-2.2.6-2927-g4008;file1;0;0;0;0;0;0;0;0;0.000000;0.000000;0;0;0.000000;0.000000;1.000000%=0;5.000000%=0;10.000000%=0;20.000000%=0;30.000000%=0;40.000000%=0;50.000000%=0;60.000000%=0;70.000000%=0;80.000000%=0;90.000000%=0;95.000000%=0;99.000000%=0;99.500000%=0;99.900000%=0;99.950000%=0;99.990000%=0;0%=0;0%=0;0%=0;0;0;0.000000;0.000000;0;0;0.000000%;0.000000;0.000000;8598323200;1279532;2499;6719894;0;0;0.000000;0.000000;134;10428;168.737727;39.463957;1.000000%=148;5.000000%=150;10.000000%=152;20.000000%=154;30.000000%=156;40.000000%=160;50.000000%=162;60.000000%=164;70.000000%=166;80.000000%=168;90.000000%=177;95.000000%=185;99.000000%=387;99.500000%=411;99.900000%=544;99.950000%=610;99.990000%=684;0%=0;0%=0;0%=0;143;10439;178.321020;39.524847;140;3174400;100.000000%;2499552.634395;822870.655989;2.637065%;69.134096%;7489920;0;12283;100.0%;0.0%;0.0%;0.0%;0.0%;0.0%;0.0%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;97.21%;2.66%;0.12%;0.01%;0.01%;0.01%;0.01%;0.01%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%;0.00%
3;fio-2
import selectors
import socket
import io
import threading
import time
import queue
def worker(q: queue.Queue):
while True:
print(q.get())
@szaydel
szaydel / alarm.c
Last active December 18, 2020 14:16
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \
} while (0)