Blog

You may or may not find something useful here.

Browse the archive too see all entries.

make your own finger tab

I used very cheap leather tabs for shooting recurve bow. I think the biggest disadvantage of them is the hole where your middle finger should fit through. It bends around the finger and the tab likes to entangle itself, thus will constantly try to avoid laying onto your fingers. Someone of our club suggested other finger tabs, which have a small strap attached to them, which is worn like a ring. I think the majority of finger tabs uses this technique, but they are sometimes quite expensive - especially if you want them with special abilities like a chin rest or adjustable plates.

In our club I saw one guy with a felt tab - I'm not sure where he got this from because I can not find a single shop selling those... He said that he finds the felt type the most comfortable to use. So I thought, I would give felt a try!

From a recent project, I had some 3mm felt with 0.36 density. I cut off a rectangular piece about 70 by 60 mm and reused the finger separator from my old tab.

Then I cut a small strap of leather and sewed it on one end to the felt. I figured out, that a small hole is already sufficient, but it will probably loosen itself over time.

The other end I just put through the same hole as the separator.

I also cut a larger slot between index and middle finger and just a single cut between middle and ring finger. I think this gives you a little bit more flexibility, but you might decide to leave it as it is.

Today I tried the tab and I in my oppinion it works great. You can feel the bowstring much better - which might be painful to you (I think it is just right).

When you make your own, here is a good advice: You probably want to cut the tab to size directly at the shooting range. Never cut off large pieces, as your fingers are very sensitive already for small pieces! So what you feel might might be a huge chunk of material but in reality it is just a milimetre. I made this mistake when cutting to length my old tab. I thought that I would need to remove much material which wasnt the case.

For the future, I might create a new one with a aluminium plate attached. You should also think about a better mechanism to hold the strap, because it will loosen over time. I think the easiest way would be to create small metal plate, which secures the leather strap.

Posted Mon Mar 12 18:44:28 2018
get every nth day of month in the year

Here is a short script to get the nth day in the month for the whole year, e.g. every fourth thursday:

for month in $(seq -w 01 12); do ncal -M $month 2018 | grep Do | awk -v var="$month" '{ print "2018-" var "-" $5 }'

you need to adopt to your locale...

Posted Thu Feb 8 20:57:14 2018
track disk writes

On a system which has de-facto nothing to do (a router basically), I observed constant disk writes with collectd:

As you can see, in 12h alone there was a total write of 3.2GB to the disk.

Using lsof, I could identify all opened files in write mode:

diff <(lsof | awk 'NR==1 || $4~/[0-9]+[uw]/ && $5~/REG/ && $6~/8,1/') <(sleep 30; lsof | awk 'NR==1 || $4~/[0-9]+[uw]/ && $5~/REG/ && $6~/8,1/')

I know that my only physical disk in the system is 8.1, regular files are denoted by REG and write condition is either a w or a u. The SIZE/OFF column gives you some feeling of how many bytes are written in the last 30 seconds.

The output looks like this

< rsyslogd    509             root    6w      REG                8,1  3936622     785024 /var/log/syslog
---
> rsyslogd    509             root    6w      REG                8,1  3937650     785024 /var/log/syslog
8c8
< rsyslogd    509             root   12w      REG                8,1  1636869     786638 /var/log/daemon.log
---
> rsyslogd    509             root   12w      REG                8,1  1637897     786638 /var/log/daemon.log

clearly something was logging to the logs constantly. After watching the logs for a moment I could identify the problem and resolve it.

But I still could not identify the real cause. The log messages had some influence but where not the root cause.

Here comes iotop to the rescue. Start with

iotop -a -o

to see only active processes and accumulate. Let this run some minutes.

I could find a process which would write files every so often, but would not keep them open. Thus they would fall through the search with lsof!

Posted Tue Jan 23 06:54:17 2018
kodi mount discs

There is this "weird" problem: you can not play BluRays that are not mounted and you can not play DVDs that are mounted... So, I created this UDEV script to check if a BluRay or DVD is inserted and mount the disk if necessary.

First of all, you need to configure systemd-udevd to allow mounting into the correct device tree:

mmkdir -p /etc/systemd/system/systemd-udevd.service.d/
vim /etc/systemd/system/systemd-udevd.service.d/myoverride.conf

with this content:

[Service]
MountFlags=shared

Now you can create the udev rule vim /etc/udev/rules.d/82-cdrom.rules:

ATTRS{type}=="5", KERNEL=="sr0", SUBSYSTEM=="block", ENV{ID_PATH}=="pci-0000:00:1f.2-ata-3", ACTION=="change", RUN+="/home/kodi/kodi-play-disc.sh

I also used this useful script to detect if the tray of the drive is open. So download and compile it.

Here is the kodi-play-disc.sh:

/home/kodi/trayopen /dev/sr0
if [ $? -eq 0 ]; then
    # try umount
    grep -q cdrom /proc/mounts
    if [ $? -eq 0 ]; then
        umount /media/cdrom0
        logger "unmounted device..."
    fi
    logger "tray is open"
    exit
fi

logger "BD/DVD detection script started"

# wait a little bit until disk is loaded
sleep 5

blkid /dev/sr0 | grep -q UUID
if [ $? -eq 1 ]; then
    logger "No disk inserted... exit right away"
    exit
fi

# Need to mount first:
mount /media/cdrom0

if [ -f /media/cdrom0/BDMV/index.bdmv ]; then
    logger "this looks like a bluray, keep mounted"
else
    logger "this looks like a dvd, unmounting"
    sleep 2
    umount /media/cdrom0
    logger "umount returned $?"
fi

#logger send play to kodi
#kodi-send --host=127.0.0.1 --port=9777 --action="PlayDVD"
logger "DISC DETECTION exited"

you can also comment in the kodi-send line to play the disc directly.

The sleeps are required so the drive has time to spin up and so on. Otherwise the script will exit too early.

Posted Sat Dec 23 19:24:37 2017
schnitten destroyer

I build a small device to test the orthotropy of Manner Schnitten (a famous Austrian biscuit, consisting of layered waffles with hazlenut creme in between).

The idea was to test, if and how the biscuit would break when the waffles are parallel or perpendicular. In theory, the force required should be larger for the perpendicular case.

I thought about a simple hydraulic mechanism to test it. Syringes would be ideal, I thought, as they are quite cheap and easily available. I would just need to measure the pressure. Good I had a pressure transducer from my Gaggia Pressure Project (no, not the analog one. I bought a digital transducer a while ago but had problems to fixate it in the machine...).

Everthing started with a sketch in FreeCAD:

Using the Sheet Metal workbench, I was able to easily create a drawing for the bended Aluminium frame.

Next, I used the mill in Metalab to create the aluminium frame for the syringes. Here are at least two fotos from the creation process:

Using an old Arduino Uno and a even older Protoshield (which had some other components on it already), I hacked together the software. It reads the sensor value and converts it to mbar. Knowing the area of the syringe, I can convert to the force which acts on the piston.

But now for some images!

The piston

The display unit

Hydraulic mechansim. I used distilled water as medium.

Pressure transducer unit

The piston seen from the back

Arduino unit (the IC's on the protoshield are not used)

Pressure transducer

Starting up!

Parallel configuration

During the measurement

Maximum force is when it breaks (if you are careful...). Reading 24.74N in parallel configuration

Broke to pieces...

Now the same for the perpendicular configuration: 32.69N! Theory confirmed ;)

The break is much cleaner too

The Piston top

Posted Tue Dec 5 11:35:27 2017
epoxy a pcb

I had a small adapter board, where I wanted to isolate the bottom of the board. A good time to see if epoxy would work.

First, I used electrical tape to build a form. I had no idea if it would work, but seemed like a good idea. I also had two mounting holes. I used two small plastic pipes, I cut from a Q-tip to fill the holes.

The top of the PCB, I also covered with electrical tape.

Now I used 5 minute epoxy (which was by the way >8 years old...) and some carbon black pigment to make the epoxy black.

Then I filled the form with epoxy

After some minutes, I removed the electrical tape from the PCB. It was removable very easily without any residue!

Some epoxy found it's way through the form though...

But with a sharp knife, it was easily removable. I also drilled the holes again to clear the hole (not seen in the image).

I had to remove also some epoxy on the back. It looks like the epoxy filled one side too much...

For a first try, it turned out pretty good!

Posted Sat Nov 4 10:13:27 2017
navtex reception

I plotted the range of all NAVTEX stations worldwide using data from Wikipedia. Converted into a CSV Document. Then converted using a python script to a KML file.

Note: If no range was given, I assumed 300nm, which is the average of all other stations.

I even found an error in the data! The station located on the Cape Verde Islands had the wrong coordinates: they used east instead of west.

I'm not sure what the range actually means, as the stations are probably going much further... I think the range is just the ground wave. I'm also not sure if they use nautic miles or km. I assumed that the range is in nautic miles.

Posted Wed Nov 1 15:57:23 2017
repair a razor copperhead

I used to have a Razor Copperhead since several years now. Already some years ago, the mouse buttons got not so responsive anymore and I found that a little drop of superglue on the plastic lever that actuates the switch helped a lot.

But since a few months I had problems with the back button. It would trigger not once but several times, like an unbounced switch. Probably the switch failed internaly, as a visual inspection showed no dirt on the switch...

As fate had it, I found a (very dirty) Razor Copperhead in the dumpster and took it home. All the plastic casing was immediatly thrown away, as it was super nasty... But the electronics was still fine, and a short test showed it had just a broken USB Cable (just as my mouse, until I repaired it) and was probably thrown in the dumpster for that reason.

The Copperhead has a separate PCB, on which the four side switches are mounted. I thought I could just replace this board and keep the rest of the mouse... The PCB's are identical, they even have the same revision!

The one on the left is my board, the one on the right the dumpster one. The fiber light channel was broken on that one, so I removed it.

So I thought they are the same, until I tried to plug them in... Take a look at my main PCB (it has Revision 3.3):

(yes, the solderwork on the cable is not the best... but it works)

Now take a look at the dumpster board:

They changed the pins from male to female! oO Why???

So, I also replaced the main PCB to use the old switch PCB... Everything works fine, but I have now a blue scrollwheel and a green Razor logo, but who cares... Also the light around the mouse is broken, but the rubber there is already very nasty and breaks down anyways (Unfortunately there are no replacements for that).

Next time a switch fails, I need to use the soldering iron...

By the way, what is really interesting is, that the sound of the switches is different in the revision 3.1. The switches sound not so sharp as the one in the 3.3 version. But maybe they are just older and more used?

Posted Mon Oct 23 19:18:22 2017
sort by DD.MM.YYYY date

I had some files with a date in it:

some file 23.05.2017.abc
some file 23.05.2007.abc
some file 15.07.2017.abc
some file 02.12.2008.abc

To sort them, use the KEYDEF feature of sort:

find . | sort -k3.8d -k 3.6d -k 3.5d

It it also good to use the --debug option of sort, as it will show you where sort found the key.

Posted Tue Jun 13 21:31:40 2017
equation for parallel line through point

Because I had some hard hours to figure this one out (basically I mixed a lot of degree and radians and messed up several times with tan and sin), here is my solution. It may be a help for someone (or for me later...).

The quest was to find the angle of a line through a point lying on a circle, when this line is parallel to some line passing through another point on the circle.

So let's get this started: Lets say, we got a point P with the coordinates x = cos(\gamma)R and y = sin(\gamma)R, thus they are on the circle with radius R, centered at the origin.

Now, we construct a line through the circles' circumference at y = 0, thus we know it must pass through x = R. The line equation is then given by tan(\alpha)\left(x - R\right) = y.

Now, we construct a parallel line to it (in direction of negative x) with distance h, which is given by the line equation tan(\alpha)\left(x - R + \frac{h}{sin(\alpha)}\right) = y.

To find now the angle, we insert the point into the equation, as we require that the line passes through this point: tan(\alpha)\left(cos(\gamma)\ R - R + \frac{h}{sin(\alpha)}\right) = sin(\gamma)\ R.

I tried to solve this by hand but the formular we get is quite complex (and I found it using wolframalpha, not by hand).

\alpha_{1,2} = 2\left(tan^{-1}\left(\frac{\pm\sqrt{-h^2 + \left(R - cos(\gamma)R\right)^2 + \left(sin(\gamma)R\right)^2} + R - cos(\gamma)R}{h + sin(\gamma)R}\right) + \pi n \right)

with n \in \mathbb{Z}. But as we know, that the angle must be between 0 and 0.5\pi, we can just set n = 0 and remove that part.

You might ask: why do you need something? Here is an example: lampe.scad I tried to arrange the rectangles in such a way, that they are rotated and touch each other. We can calculate now, that the angle (in this specific configuration) is about 57 degree.

Thank's to OpenSCAD, where you learn math the hard way ;)

Posted Fri Jun 2 22:32:55 2017