setting up openvpn server with ipv6 on an IPS

There are a variety of reasons to use a vpn. The other sites you’ve visited on this topic already cover why.
The main reason I’m adding my own version to the pile is because of ipv6 support. If your ISP gives you a ipv6 address, much (most?) of your traffic will bypass the vpn without these extra settings.
To test where your traffic is going I like to do this:

The first command checks where ipv4 traffic goes. The second tests ipv6. Both should go through VPN.
I have a script that can implement the needed changes for you. I’ve only tested it on a based ubuntu 16.04 machine.
There’s really not much more for me to say in the post because the script is heavily commented. Even if you don’t run the script, I think the comments will be helpful to many. The comments explain why the steps are taken as well as how to know they’re successful.
There are a handful of sites out there that have helped me get a working server. It still took a couple days of effort. Perhaps this post will help you reduce your time to success. The sites:

6 ways to communicate with stm32, part 2. UART and GDB

This post is part of a series: how to talk to the stm32 in 6 different ways as well as some interesting things to do with each method. The code mentioned in this post, a working example, can be found in my github.
In my last post, I talked about how to start from zero to the point where you can blink a light on the cheap stm32f103c8t6 “blue pill” board.

In that post (and its associated video), I showed how to use:

  • STMCubeMX to get the basic register settings,
  • the additional code needed to blink an LED,
  • how to compile (including where to get the compiler),
  • and how to upload to the module via GDB/OpenOCD

In this post, I build on that to show how to talk to the module via the UART from a terminal window on your computer. Topics/steps I’ll cover:

  • Needed changes in STMCubeMX
  • Some tips on reading the HAL manual published by ST corp.
  • How to send UART messages using two available methods. (polling and interrupt)
  • How to receive these messages using the minicom terminal
  • Bonus: how to unbrick an unresponsive module using the stm32flash utility

This video shows many of the concepts of this post, more details below.…

6 ways to communicate with STM32F103C8T6. Part 1. Zero to blinking an led

This is the first in a series of posts about 6 ways to communicate with the stm32f103c8t6. In each of the posts, I will talk about a way to communicate with the part as well as something interesting that can be done with that mode of communication.
I have a video for this post:

The first way is to blink an LED on the stm32. To do this, you need a couple things:

  • Two cheap pieces of hardware
  • To generate boilerplate code which sets up the runtime environment, initializes the clock and some other low level stuff
  • To add code that blinks the LED pin
  • To compile the resulting code
  • To transfer the binary to the board

This post describes how to do these in the linux environment.

Needed hardware

To reproduce what I do in this post, you’ll need two things:

  1. stm32f103c8t6 board from aliexpress/ebay. <$2
  2. st-link v2 programmer. Also from aliexpress/ebay. <$2

Boilerplate with STMCubeMX

Getting a microcontroller up and moving is actually fairly involved. There’s a ton of stuff that needs to happen after plugging in the power before any real work begins to happen. The ST company has produced a software package than can deal with a lot of this for you.…

Automatically aligning multiple video/audio clips in kdenlive

I’ve recently begun trying to produce some youtube videos on programming topics that I find interesting. In that interest, I’ve come to use the kdenlive linux video editor . Kdenlive is pretty nice and will serve my needs just fine.
One thing I’ve aspired to do is some multi-camera videos. My wife practices a couple kinds of martial arts and I’d love to record some of her test katas from several angles.
Aligning a handful of clips really isn’t that hard to do manually, but since I’m a nerd, I decided to program a utility to do this. It’s a problem that I wanted to implement for years and I’ve finally gotten to it.
Similar to the product PluralEyes, my utility looks at the audio portions of your clips and aligns them based on that. In a nutshell, I compute the cross correlation of all pairs of clips using FFTs and then write a timeline based on the strongest matches.
The end of this post will have more implementation details.
Here is a quick demo

The steps to use it are pretty simple

Step 1 – create an unaligned kdenlive project

First, create a kdenlive project that contains all of the desired clips in the desired tracks as below (click for larger image).…

Using a phony C struct as a function selector

Generic programming, as used by the std and boost packages, depends heavily on template tricks to extract data from specific data structures in a generic way. When I first tried using some of the boost libraries, I felt pretty clueless in getting them to do what I wanted. Hence this post.
Say you have a C struct like this one:

Generic programming accesses the a and b members using a global get function and a property map:

What’s in the property map? In this case nothing. The magic happens in the templated specialization of get:

Which you call like this:

How’s it work and what’s the compiled result?

The get_a struct is empty; it contains no data members. When you call get, the compiler selects the get_a version since it’s the most specific specialization of get. From there, things get interesting. Constructing get_a() is a noop. Pushing it as a function argument is a noop. After inlining, get simply becomes f1.a.

How to quickly compute the Euclidean MST of a large number of points (and why you might want to)

When I was in college, like most CS type majors, I took the algorithms class. Sorting, binary trees, O(n) notation… all of that.
One of the things I didn’t understand is why such a big deal was made about some algorithms like the graph algorithms. Why would I want a minimum spanning tree of a million nodes?
A bunch of years ago, I did need to compute the MST of a couple hundred thousand nodes for my job. Later on, I needed to do it three dimensionally. Something made me think of it recently, and I have a hankering to write about it.
I’ve also recorded a series of videos to explain the programming aspects:

What problem was I trying to solve?

At the time, I was working on code to generate a clock buffer tree for large seas of logic gates. Say you have a million gates in your logic design and that 10% of those are clocked elements.. So we have 100k logic gates that need a clock signal.
So, clock buffers can’t drive the capacitance of a 100k gates, at least not if you want the design to run at more than 1 cycle per second. The solution is a clock tree.…

Most Android Apps can easily be decompiled to remove the ads

Trying to reach even non-computer people

This is a long post. Most of it is instructions for modifying Android apps for your own purposes. In the first portion, in which I talk about motivations, I will attempt to make it interesting even for non-computer people:

  • I was surprised how easily and well java sources can be recovered from any Android app
  • It’s easy to customize apps. You can easily change the pictures and the sound clips.
  • Banner ads in kids apps are surprisingly easy to remove
  • Some commentary on kids apps in general

The second part is a how to:

Android apps for little kids

As a parent, I’ve looked around for some good games for my two kids, aged 3 and 6. There are some good ones out there. For example, all of the apps produced by Lego are excellent. We look for educational ones. Endless Alphabet is a good one. Wonster Words. Beck and Bo is excellent….…