Skip to content

Instantly share code, notes, and snippets.

View danieljoos's full-sized avatar

Daniel Joos danieljoos

View GitHub Profile
Install-Module TeamViewerPS
Connect-TeamViewerApi
# ----
$domain = Get-TeamViewerSsoDomain | Where-Object { $_.Name -eq 'example.com' }
# ----
@danieljoos
danieljoos / gist:22b3319dfe60cb4348d747aebd674d35
Last active February 16, 2021 07:45
TeamViewer - Add large number of SSO exclusion entries from CSV
Install-Module TeamViewerPS
Connect-TeamViewerApi
# ----
function Split-Bulk {
param([int]$Size)
Begin { $bulk = New-Object System.Collections.ArrayList($Size) }
Process { $bulk.Add($_) | Out-Null; if ($bulk.Count -ge $Size) { ,$bulk.Clone(); $bulk.Clear() } }

Keybase proof

I hereby claim:

  • I am danieljoos on github.
  • I am danieljoos (https://keybase.io/danieljoos) on keybase.
  • I have a public key whose fingerprint is 177F E1D3 5988 C4C1 BB08 F8D6 EBE2 1FD4 A953 B7B3

To claim this, I am signing this object:

@danieljoos
danieljoos / flatten.pl
Last active February 6, 2021 07:32
Flatten a hash structure in plain Perl
# Helper routine for flattening a hash structure
sub flatten {
my ($h, $r, $p) = @_; $r = {} if not $r; $p = '' if not $p;
my $typed; $typed = sub {
my ($v, $p) = @_;
if (ref $v eq 'HASH') { flatten($v, $r, $p.'.'); }
elsif (ref $v eq 'ARRAY') { foreach(0..$#$v) { $typed->(@$v[$_], $p.'['.$_.']'); } }
else { $r->{$p} = $v; }
};
foreach (keys %$h) { $typed->($$h{$_}, $p.$_); };
digraph G {
node [shape=box]
subgraph write_graph {
AsyncRequest -> Serialize [style=dashed arrowhead=vee]
Serialize -> EnqueueRequest [weight=100]
EnqueueRequest -> NextRequest [weight=100]
connectedw [label="connected?" shape="diamond"]
autoconnectw [label="auto connect?" shape="diamond"]
connectedw -> autoconnectw [label="No"]
@danieljoos
danieljoos / ConnectionClassFlow.svg
Last active August 29, 2015 14:26
ASIO flow of the `Connection` class
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danieljoos
danieljoos / produce_test.cpp
Last active August 29, 2015 14:25
Simple performance measurement of produce requests
#include <iostream>
#include <boost/asio.hpp>
#include <boost/chrono.hpp>
#include <boost/random.hpp>
#include <libkafka_asio/libkafka_asio.h>
using libkafka_asio::Client;
using libkafka_asio::ProduceRequest;
using libkafka_asio::ProduceResponse;
using libkafka_asio::Bytes;
@danieljoos
danieljoos / gist:59c6867f7d316505dad3
Created April 7, 2015 14:29
libkafka-asio: Producer Example with Hash Partitioning
#include <iostream>
#include <sstream>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/random.hpp>
#include <boost/ref.hpp>
#include <boost/shared_ptr.hpp>