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
// ... (previous code remains the same) | |
void* check_stop_file(void* arg) { | |
while (!stop_requested) { | |
if (access(STOP_FILE, F_OK) != -1) { | |
// Stop file exists, set the stop flag | |
stop_requested = 1; | |
break; | |
} | |
// Sleep for a short interval before checking again |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <pthread.h> | |
#include <librdkafka/rdkafka.h> | |
#include <signal.h> | |
#define PIPE_NAME "/path/to/pipe" |
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 <stdio.h> | |
#include <librdkafka/rdkafka.h> | |
int main() { | |
printf("librdkafka is installed and the header is accessible.\n"); | |
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 | |
# Wrapper script to run commands with simulated interactive activity | |
# Command and arguments to run | |
CMD="$@" | |
# Function to simulate interactive activity | |
keep_alive() { | |
while true; do |
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 | |
num_threads=<num_threads> | |
pattern_file="pattern_list.txt" | |
output_file="output.txt" | |
directory_path="directory_path" | |
# Read each pattern from the pattern file | |
while IFS= read -r pattern; do | |
# Run grep in the background for each pattern |
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
RANDOM_SECONDS=$((RANDOM % 60)) | |
DATE_WITH_RANDOM_SECONDS=$(date -d "+${RANDOM_SECONDS} seconds" "+%Y%m%d%H%M%S") |
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
=DATE(RIGHT(B1,4),MID(B1,4,2),LEFT(B1,2)) + TIME(MID(B1,12,2),MID(B1,15,2),MID(B1,18,2)) |
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
padded_number=$(printf "%02d" "${string//[!0-9]}") |
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
ps -eo pid,etime,comm,user | awk '{if ($3 ~ /KL/ || $3 ~ /kl/ && $2>604800) print $1, $4}' | while read pid user; do kill $pid; echo "Killed $pid process owned by $user which started running at $(ps -o lstart= -p $pid)" >> processes.txt; done |