Skip to content

Instantly share code, notes, and snippets.

@OjaswinM
OjaswinM / atomic_write.c
Created November 30, 2023 09:45
Performing atomic writes using pwritev2() syscall
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/uio.h>
#include <errno.h>
#define RWF_ATOMIC (0x00000020)
@OjaswinM
OjaswinM / gist:37a90941e7e7d26415aa6aa938665e25
Created May 16, 2022 10:20
Trim a video range out using ffmpeg
#!/bin/bash
if ! [ "$#" = "3" ]
then
echo "Usage: $0 [start-time] [end-time] [file-name]"
echo
echo "Trim out the file from start-time to end-time.
exit 1
fi