Skip to content

Instantly share code, notes, and snippets.

View jeansymolanza's full-sized avatar

Jeansy Molanza jeansymolanza

View GitHub Profile
// ... (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
#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"
#include <stdio.h>
#include <librdkafka/rdkafka.h>
int main() {
printf("librdkafka is installed and the header is accessible.\n");
return 0;
}
#!/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
#!/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
RANDOM_SECONDS=$((RANDOM % 60))
DATE_WITH_RANDOM_SECONDS=$(date -d "+${RANDOM_SECONDS} seconds" "+%Y%m%d%H%M%S")
=DATE(RIGHT(B1,4),MID(B1,4,2),LEFT(B1,2)) + TIME(MID(B1,12,2),MID(B1,15,2),MID(B1,18,2))
padded_number=$(printf "%02d" "${string//[!0-9]}")
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
<div>
<label for="email" class="block text-sm font-medium text-gray-700">Search candidates</label>
<div class="mt-1 flex rounded-md shadow-sm">
<div class="relative flex items-stretch flex-grow focus-within:z-10">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<!-- Heroicon name: solid/users -->
<svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path d="M9 6a3 3 0 11-6 0 3 3 0 016 0zM17 6a3 3 0 11-6 0 3 3 0 016 0zM12.93 17c.046-.327.07-.66.07-1a6.97 6.97 0 00-1.5-4.33A5 5 0 0119 16v1h-6.07zM6 11a5 5 0 015 5v1H1v-1a5 5 0 015-5z" />
</svg>
</div>