CyberSpy

Rantings from a guy with way too much free time

Liquid Soap better than dirty Ice (DarkIce)

2023-11-10 Audio Rob Baruch

DarkIce bugs are Enough! Time to Soap Up

So, over the years, I’ve maintained a DarkIce stream for Icecast2 audio server. Mostly, I do this for DMR radio that I want to stream from my Anytone 878 handset. The challenge is the code is not maintained and is buggy. Configuration is less than desirable as well. So after finally deciding enough was enough (one can only restart a failed daemon so many times), I bit the bullet and went on the hunt for alternatives.

Continue reading

NFC Tagboard - Using NFC Tags, Grafana, and Docker

2021-12-05 Programming Rob Baruch

NFC Tags - Tracking tasks last completed

Trying to track when you last completed a long-dated task can be challenging. Writing them on a calendar makes for difficult searching. Heavy apps are overkill. So what’s a person to do? A simple soltution - use NFC tags which are pre-loaded with custom JSON, drop a little golang server, and Docker persistance with MySQL, along with a Grafana UI to easily manage tracking of tasks.

Continue reading

I'm Back!!! Diving into Rust!

2021-04-26 Programming Rob Baruch

Noobie to Rust? Let’s get started!!

So you want to get into rust? Sure, why not. Let’s do it.

The setup

Assuming you’re on a Mac, let’s get rust up and running so you’re ready to rip into learning the language. We’ll use rustup to install rust. This is the best way to manage your rust environment and toolchain. Not only can you manage toolchains using rustup, but also add-in components to make the experience a lot more enjoyable. More on that later. Not only will rustup install rust for you, but it will also be useful for maintaining the latest versions of rust. Rust has several toolchains, and using rustup will make maintaining them a whole lot easier.

Continue reading

Getting func(y) with Channels

Here’s a little golang puzzle

Take a look at the function below that computes a mystery value for the function $f(x)$. Any idea what the function is? Take a close look at the first line where we create a channel. Notice that the channel isn’t some boring int or string channel. No, this is a channel of type func(int, chan int, chan bool). Wait what??? That’s right, this channel takes a function that takes an integer and two channels as function parameters. We define such a function, x, right aftewards.

Continue reading

OS X VPN client pppd host route configuration on post-interface connection

2019-11-20 Devops Rob Baruch

VPN Client PPP daemon configuration

Recipe: Configure Default Host routes after a specific VPN connection has been established

Solution:

In order to configure the host (or network routes, although I’m solely interested in routing specific hosts between my two sites), we need to create a file with the following commands in /etc/ppp.

#!/bin/sh

# VPN_GATEWAY is the remote address of the vpn tunnel
# when ppp executes this script it will pass several values to it
# $5 will hold the remote gateway

VPN_GATEWAY=192.168.1.156
if [ "${5:-}" = "${VPN_GATEWAY}" ]
then
                /bin/echo "${5:-} routes added for interface ${5:-}" > "/tmp/pppd_ip_up_$$.log"
                /sbin/route add -host 192.168.1.92 -interface ppp0 || (/bin/echo "failed to add route 92" >> "/tmp/pppd_ip_up_$$.log")
                /sbin/route add -host 192.168.1.158 -interface ppp0|| (/bin/echo "failed to add route 158" >> "/tmp/pppd_ip_up_$$.log")
                /sbin/route add -host 192.168.1.56 -interface ppp0|| (/bin/echo "failed to add route 56" >> "/tmp/pppd_ip_up_$$.log")
                /sbin/route add -host 192.168.1.26 -interface ppp0|| (/bin/echo "failed to add route 26" >> "/tmp/pppd_ip_up_$$.log")
else
                /bin/echo "No routes added for interface ${5:-}" > "/tmp/pppd_ip_up_$$.log"
fi

This script must be owned by root and executable. We can create multiple else clauses to configure routes for our remote VPN connection based on the remote IP Address. I’ve added a log to /tmp to monitor the process.

Continue reading

Baby it's Cold Outside -- How Cold? Use an SHT31 and See!

2019-01-29 Programming Rob Baruch

ESP32 and SHT31 Temperature and Humidity Sensor Secure Web Server

In this blog post, I follow-up on the ESP32-IDF development and demonstrate how to incorporate an i2c device to measure the temperature and humidity. Specifically the SHT31. First, let’s do it plain-jane vanilla. We’ll incorporate the i2c device and simply display the measurements to the serial terminal through the uart. Next, we’ll make it more practical and send the data over the wifi network to a service that makes it convenient to visualize the time-series data.

Continue reading

Program the Esp32 with ESP-IDF on Mac OS X

2019-01-23 Programming Rob Baruch

Programming the ESP32 on your Mac!

Go out and buy yourself a cheap little ESP32 SoC and follow these basic instructions to setup your development environment on your Mac. If you want to do some advanced C-programming to control your ESP32, this is for you. If you’d rather use Arduino and play with simple sketches then this is not for you – google how to use Arduino and off you go!

What you will need

So, of course you’ll need an ESP32 SoC development board. I recommend the SparkFun Thing. Lots of other choices, but this blog post will address some of the specific configuration considerations that you’ll need to be aware of when you select this particular device.

Continue reading
Older posts