Skip to content

Instantly share code, notes, and snippets.

View cameronelliott's full-sized avatar

Cameron Elliott cameronelliott

View GitHub Profile
@cameronelliott
cameronelliott / twoip.sh
Last active October 19, 2022 02:36 — forked from sparkcodeuk/floating-ip-gateway.sh
Digital Ocean show how to use two IP addresses
#!/bin/bash
NET_INT="eth0"
CURL_TIMEOUT=3
echo -n "Setting floating IP as the default gateway: "
# Check there's a floating IP attached to this droplet
if [ "$(curl -s --connect-timeout $CURL_TIMEOUT http://169.254.169.254/metadata/v1/floating_ip/ipv4/active)" != "true" ]; then
echo "Error: this droplet doesn't have a floating IP assigned to it."
@cameronelliott
cameronelliott / README.md
Created October 23, 2022 20:26 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
#include <srtp2/auth.h>
#include <srtp2/cipher.h>
#include <srtp2/crypto_types.h>
#include <srtp2/srtp.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
char SKEL_RTP_PACKET[17] = {0x80, 0x60, 0x69, 0x8f, 0xd9, 0xc2, 0x93, 0xda, 0x1c, 0x64, 0x27, 0x82, 0x98, 0x36, 0xbe, 0x88, 0x9e};
@cameronelliott
cameronelliott / sqlite-kv-store-thanks-H2CO3
Last active September 23, 2024 18:48 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::path::Path;
use core::marker::PhantomData;
use core::borrow::Borrow;
use chrono::{DateTime, Utc, Days};
use rusqlite::{named_params, Connection, Statement};
use serde::{Serialize, Deserialize};
use thiserror::Error;
pub type Result<T, E = Error> = core::result::Result<T, E>;