Skip to content

Instantly share code, notes, and snippets.

View zSoNz's full-sized avatar
🏠
Working from home

Bohdan Kikacheishvili zSoNz

🏠
Working from home
View GitHub Profile
@CanTheAlmighty
CanTheAlmighty / DisplayLink.swift
Last active March 10, 2024 08:43
DisplayLink for OSX
@mysteryjeans
mysteryjeans / AudioCaptureModule.cc
Created March 10, 2017 00:22
WebRTC AudioDeviceModule implementation for custom source
/*
* libjingle
* Copyright 2012, Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
import UIKit
import AVFoundation
public func createSampleBufferBy<T>(pcm: [T], timeStamp: AudioTimeStamp, bd: AudioStreamBasicDescription) -> CMSampleBuffer? {
var basicDescription = bd
var formatDescription: CMAudioFormatDescription?
_ = CMAudioFormatDescriptionCreate(allocator: kCFAllocatorDefault,
asbd: &basicDescription,
layoutSize: 0,
layout: nil,
@hellvesper
hellvesper / hetzner.sh
Last active May 3, 2023 09:18
Replication TrueNAS's apple time machnine snapshots with hetzner's cloud storage box [draft]
#!/bin/sh
LAST_LOCAL_SNAPSHOT=`zfs list -t snapshot | sort -r | egrep '^.+aapltm-[0-9]+' -o -m 1`
LAST_REMOTE_SNAPSHOT=`rclone ls storagebox:/home/ | sort -k 2 -r | grep aapltm -m 1 | xargs | cut -d ' ' -f 2 | cut -d '.' -f 1`
DATASET_PREFIX=`zfs list -t snapshot | grep aapltm -m 1 | cut -d ' ' -f 1 | cut -d '@' -f 1`
LOCAL_SNAPSHOT_POSTFIX=`echo $LAST_LOCAL_SNAPSHOT | cut -d '@' -f 2`
RCLONE_REMOTE="storagebox"
RCLONE_REMOTE_SNAPSHOT_PATH="/home/"
echo "LAST_LOCAL_SNAPSHOT:$LAST_LOCAL_SNAPSHOT"
echo "LAST_REMOTE_SNAPSHOT:$LAST_REMOTE_SNAPSHOT"