58
content/content/blog/email-childprot.md
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
---
|
||||||
|
title: "Children Protection for Postfix-based EMail-Server"
|
||||||
|
date: "2013-06-27"
|
||||||
|
---
|
||||||
|
|
||||||
|
This small tool implements a whitelist on a Postfix mail-server. It prevents certain recipient addresses (your kids ones) from
|
||||||
|
receiving mail from any not whitelisted address. Any mail from not whitelisted senders is redirected to a delegate (a parent).
|
||||||
|
|
||||||
|
The code for this tool can is here: [https://gitea.hottis.de/wn/childprot](https://gitea.hottis.de/wn/childprot).
|
||||||
|
|
||||||
|
Configure the tool by adding this line into the `master.cf` of the Postfix installation:
|
||||||
|
|
||||||
|
```
|
||||||
|
childprot unix - n n - 25 spawn user=mail argv=/opt/sbin/ChildProt
|
||||||
|
```
|
||||||
|
|
||||||
|
and this one to the `main.cf`:
|
||||||
|
|
||||||
|
```
|
||||||
|
check_policy_service unix:private/childprot
|
||||||
|
```
|
||||||
|
|
||||||
|
The restricted recipients and the whitelists are stored in an SQLite3 database:
|
||||||
|
|
||||||
|
```
|
||||||
|
CREATE TABLE child_address_t (
|
||||||
|
child INTEGER REFERENCES child_t(id),
|
||||||
|
address TEXT
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE child_t (
|
||||||
|
id INTEGER PRIMARY KEY,
|
||||||
|
name TEXT,
|
||||||
|
delegate TEXT
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE whitelist_t (
|
||||||
|
child INTEGER REFERENCES child_t(id),
|
||||||
|
address TEXT
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE VIEW child_v AS
|
||||||
|
SELECT c.id as id,
|
||||||
|
c.delegate as delegate,
|
||||||
|
ca.address as address
|
||||||
|
FROM child_t c,
|
||||||
|
child_address_t ca
|
||||||
|
WHERE c.id = ca.child;
|
||||||
|
```
|
||||||
|
|
||||||
|
Restricted persons together with their delegates are added to the table `child_t`, multiple addresses can be assigned to those persons in
|
||||||
|
`child_address_t`. Whitelists per person are maintained in `whitelist_t`.
|
||||||
|
|
||||||
|
The tool is querying the view `child_v`.
|
||||||
|
|
||||||
|
**Note: The code is unmaintained and here only for documentary reasons. It is not meant to be used any longer.**
|
||||||
|
|
||||||
|
|
67
content/content/blog/theremin.md
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
---
|
||||||
|
title: "Theremin"
|
||||||
|
date: "2013-07-01"
|
||||||
|
---
|
||||||
|
A [Theremin](https://en.wikipedia.org/wiki/Theremin) is a rather old electronic music instrument, invented in 1928. It is played by approaching hands to two antennas, without touching them. One antenna is used to manipulate the frequeny of the tone, the other one to manipulate the volume.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This is just another Theremin. Only basic structure of the circuit was taken from many other published Theremin circuits.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Completely new (or at least not found during my Theremin googling) is the digital zero-calibration.
|
||||||
|
|
||||||
|
The both left-hand-side oscillators together with the mixer+filter block provide the signal to control the volume, the right-hand-side oscillators and mixer+filter block provide the signal to control the frequency.
|
||||||
|
|
||||||
|
Each of these both couples consists of two oscillators and a mixer+filter block. Both oscillators have to swing on exactly the same frequency, in this case of about 1.3MHz. While the exact frequency does not matter, it is significant that both oscillators have the same frequency. The signals of both oscillators will be mixed, which means, multiplied.
|
||||||
|
|
||||||
|
$$\sin(\omega_0 t) sin(\omega t)$$
|
||||||
|
|
||||||
|
Here $\omega$ is the frequncy of one of the oscillators while $\omega_0$ is the frequency of the other one.
|
||||||
|
|
||||||
|
This term can be modified using the addition rule for trigonometric functions into
|
||||||
|
|
||||||
|
$$\frac{\cos((\omega_0-\omega)t)-\cos((\omega_0+\omega)t)}{2}$$
|
||||||
|
|
||||||
|
Due to this transformation, two signals, one with the sum and one with the difference of both input signal frequencies, are accumulated.
|
||||||
|
When both frequencies are exactly the same, one part of the sum appears as a DC offset, while the other part is the doubled frequency.
|
||||||
|
If one oscillator is de-tuned by only a few Hz'`s, one part are this few Hz'`s (a very low, hearable frequency) and the other part is still (roughly) the doubled frequency (a high frequency). The high frequency part can now be suppressed using a lowpass-filter.
|
||||||
|
Multiplication of two signals can be done using an analog four quadrant multiplier, like the AD633. So, this is the schematic of the mixer+filter block:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The output signal of this block is the difference of the detuning of the one oscillator.
|
||||||
|
|
||||||
|
Detuning of the oscillator will be achieved by approaching the hand to the antenna of the oscillator.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The antenna acts as a kind of a capacitive sensor and by approaching the hand a very small amount of capacity is added into the LC resonator.
|
||||||
|
|
||||||
|
The other oscillator is a fix-frequency oscillator which can be tuned to swing on the same frequency as the first oscillator in a not detuned state.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This tuning is achieved by biasing the two varactor diodes.
|
||||||
|
|
||||||
|
Here is automated tuning circuit steps in:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The low-frequency output signal of the mixer+filter block is provided through a 2-to-1 multiplexer (the four NAND-gates) into a microcontroller. The microcontroller measures the frequency and as long as it is above a frequency $\epsilon$ of say 10Hz, the bias voltage $U_{tune}$ is increased.
|
||||||
|
|
||||||
|
These both oscillators with mixer+filter and one channel of the zero-calibration appear twice in the whole circuit, one for frequency manipulation and one for volume manipulation.
|
||||||
|
|
||||||
|
The low-frequency, hearable, signal and the volume-control signal are brought together in the volume-control circuit
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Here, the low-frequency signal $U_{Lf1}$ is passed through a high-pass filter. The high-pass filter is calculated that way that the whole detunable frequency range comes onto the ramp of the filter. So, the not detuned output signal of the mixer+filter is a DC signal, which is suppressed completely by the high-pass filter (beginning of the ramp) and the maximum detuned output signal of about 2kHz matched roughly to the end of the ramp. This filtered signal is rectified and only the negative half-wave of the signal passes the diode. This half-wave signal is sieved by the larger capacitor to get a DC signal between 0 and the maximum amplitude which passed the fiter. This negative DC signal is fed into the FET, which is configured as a voltage controlled resistor. This voltage controlled resistor and the fix resistor (5k6) are building a voltage controlled voltage divider. The hearable frequency signal $U_{Lf2}$ is fed into this voltage divider and passed to an amplifier.
|
||||||
|
|
||||||
|
The output signal of this block in turn is the volume-controlled and frequency-controlled signal which is the output signal of this Theremin. It is passed into a power-amplifier and into a speaker - done.
|
||||||
|
|
||||||
|
[Calibrating the Theremin](https://www.youtube.com/watch?v=5US8LY_FbQ4&w=420&h=315)
|
||||||
|
|
||||||
|
[Playing the Theremin](https://www.youtube.com/watch?v=lDld71HI66o&w=420&h=315)
|
||||||
|
|
@ -19,4 +19,8 @@ menu:
|
|||||||
pageRef: /about
|
pageRef: /about
|
||||||
weight: 4
|
weight: 4
|
||||||
|
|
||||||
|
markup:
|
||||||
|
defaultMarkdownHandler: goldmark
|
||||||
|
goldmark:
|
||||||
|
renderer:
|
||||||
|
unsafe: true
|
||||||
|
BIN
content/static/foto-am-30-06-13-um-20-021.jpg
Normal file
After Width: | Height: | Size: 200 KiB |
BIN
content/static/scan_005006-1024x654.jpg
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
content/static/scan_005006_2-1024x553.jpg
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
content/static/scan_005006_3.jpg
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
content/static/scan_005006_4.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
content/static/scan_005006_5-1024x717.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
content/static/scan_005006_6.jpg
Normal file
After Width: | Height: | Size: 69 KiB |
@ -1 +1 @@
|
|||||||
Subproject commit d7c59e62965bdd2c9b0faa00db640c775d447e99
|
Subproject commit 092ff6889054f2d7da3ec163ec3d3c45d9812ee4
|