Tag Archives: programming

Working Amiga 500

Got a working amiga again. \o/ woot
Needed to replace Paula chip, cleaning and some TLC.

Modulator
Chip donor

Scart cable i’ve got is one without the resistors, so my monitor isn’t detecting the signal.
Using a A520 modulator works. At least RF, don’t know why RCA/composite video isn’t working.

Even a memory expansion and second drive (5.24 inch) are working.

One of the first disks i tested

To do:

  • Fix something to get disk images from and to my pc.
  • (My old catweasel card only fits in a ISA slot which i don’t have any more)
  • I was wrong .. i’ve got a IV Catweasel .. PCI it is
  • Fix scart
  • Fix my Action Replay, which i soldered into a non working state apparently .. 🙂
  • Get a better mouse!
Catweasel IV

Disks to convert:

  • Personal text files from ages ago
  • My first seka demo
  • My oscillator drawing program
  • Other assembly source files

Got another one running today also:

Little book with jokes and programs.

A long time ago i took a book about doing funny stuff in dos, and wrote own additions in the sidelines of the book. Or used the empty pages.

It contains jokes using autoexec.bat and config.sys. Additions by me are most of the time things you could do with debug.com, a little program which existed on any pc at that time.

A little program which created static on a CGA or Hercules monitor. Yes, that long ago. CGA provided 16 colors in 80×25 or 40×25 text modes, but only four colors at 320×200 resolution and two colors at 640×200. Hercules was only monochrome and a max resolution of 720×348. It was on a hercules card i made my first copperbar. ( Before the effect was named copperbar ). Due to difference in timing on every machine, you had to get the copperbar timing right by using two keys i’d assigned the timing to.

MOV AL,00                      # Fill AL register with 0
MOV DX,0x03D8 (cga) 03B8 (herc)# DX with address
OUT DX,AL                      # Set address with AL
MOV AL,[0101]                  # Reg AL with contents 
INC AL                         # Increment AL
MOV [0101],AL                  # Address fill with AL
JMP 100                        # Jump to start

The opcodes for the program :

b0 00
66 ba d8 03
ee
a0 41 00 00 00  
fe c0
a2 41 00 00 00 
e9 60 00 00 00

Sometimes i put these little programs in autoexec.bat, so at next restart of the pc, it would do something weird. My little BOFH jokes. Friends and computerstores where not safe.

Another example:

Two drives in a PC ? (Wie A: zegt moet ook B: zeggen)
Use with care, below will f*ck up your drives. (And makes a lot of noise while doing so.)

MOV DX,0x03F2
MOV AL,71
OUT DX,AL
MOV AL,74
OUT DX,AL
JMP 100

( https://en.wikipedia.org/wiki/Floppy-disk_controller )


Secretly i hate wordpress

Don’t get me wrong, its a wonderful tool.

In the past i created a lot of websites. From scratch. I wanted to learn html and using databases. Sites got bigger and bigger, most of them personal interest. But there where several work and music band related websites.
Besides that my pipetunesearch pet project, which lasted 20 years. This one started as ‘how to create a php website with a database backend’

So why hating wordpress? It’s all being done for you, but i want do it yourself and learn from it.
I’ve made several sites with their own CMS. No way secure, but secure by obsurity, whereas wordpress sites a being hacked with zeroday exploits using bots. No-one WANTED, even to hack mine.

I started with SSI (server site includes), php3, cgi scripts in bash/perl/c etcetera. I loved (and still do) interactive websites, connection to a backend, reacting on user input. Sometimes while doing so, creating a thing before it was a thing.

For my webcam, which wasn’t anything more dan a video capturing card, with a simple composite little B/W camera. This camera was mounted on some big steppermotors, and held in place by a chunk of metal, machined by a friend of mine.

I learned to make streaming webcams by generating a progressive jpg being created by a cgi script. Controlling the movement was done by .. by anything which i needed to get things working. I think i where several binaries written in C and glued together with perl or bash. Pushing the little control buttons always send the user to the next page. Reloading and restarting the webcam stream.
Then i found the 402 no content header, sending this to the browser kept it from progressing to the next page.
Loads of problems to overcome, but learned a lot!

Sometimes you have to choose.
DIY or NOT. Flacky or proven to work for many, made by many.

Android Applications

Today i talked about creating apps for mobiles with a colleague.

I made me wonder what programming IDE i’ve used in the past.

Things i’ve made:

  • clog killer – a game application i made while working at a job.
    It was the name of a process on our servers we all hated.
    It was slow and messed up your terminal.
  • Webled – have to install this one again, to see what its purpose was 🙂
  • Whistle hole calculator – When making your own tinwhistle/lowwhistle you had to calculate diameters and positions.
    I will make another post about this.
  • Made a Multiple-Choice Quiz tool, for learning Iai-do positions/terminology. (Japanese Martial Arts – See other posts)
  • A iscp Onkyo controller (see post about my web controller)

Tools used:

  • Android IDE
  • App inventor
  • ??
  • And mobile applications using html5, php, css3 and jquery mobile

App ideas, not started or not completed:

  • Game for blind people (Or people who are bored out of their skull going to meetings)
    It involves a evolving maze game on a black screen, you have to remember the way. Hitting a wall, buzzz .. dead, start all over again.
    So you can hold your phone under the table or behind your back.
    (Black screen and no sound, just the little vibrating thinghy.)
  • New way to select app’s using a widget.
  • Pull down search game. (Have to look at the source again, i forgot what i did)

Downloads and screenshots:

I’ll post more/better examples

Other:

Reversed engineered a tool found on a ‘hackers’ phone.
Apparently it was a security test setup nobody was aware of.
I was able to find urls and domains where some call-home functionality was involved.

Biltong again

In 2020 i made a Biltong drying thingy, using a Nextion and a Arduino.
Today i’m preparing for some Chilli Biltong, which i’m going to put in the drying box tomorrow.

2020 Version 1, now version 3 (no more display bugs)

Arduino functionality

  • Heating light
  • Temperature / Humidity
  • Air flow
  • MQTT to home automation
  • Nextion Display

Recipe

Meat
1 kg Beef Cut into 1.5cm - 2cm steak slices

Spice
2 tbsp black pepper coarsely ground.
2 tbsp course Sea Salt
1/2 tbsp smoked paprika
4 tbsp coriander seeds roasted and coarsely ground.
1 tbsp chili flakes

Marinade
50 ml worcestershire sauce
100 ml apple vinegar
1 tbsp tabasco sauce

Script – get images from Reolink cam

while true; do
wget "http://ip.number.or.hostname/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=123asd&user=admin&password=MYSECRETPASS" -O $(date +%Y%m%d%H%M).jpg
sleep 60
done

Script to generate MP4 (60fps)

cat *.jpg | ffmpeg -f image2pipe -r 60 -vcodec mjpeg -i - -vcodec libx264 out.mp4
Part of Grafana log

20 years www.pipetunesearch.org

I’ve took it offline, maybe someone wants the source code and database.

It was much fun, time to move on.

UPDATE: 20230228 – It is online again.
(I’ve got some mails and mentions in music forums)

https://pipetunesearch.henriaanstoot.nl/

Apparently still a lot of visitors last year
Above example is not showing book covers

At least i’ve got some nice reactions

I’ve create my own bww/bwm to parsons code convertor.
Rest of the website is php, mysql … first one started in 2001 using php3, until php7.

Wow i found a screenshot from one if the first mobile versions!

PARSONS CODE: OMG, you don’t know how long I have been waiting for a search engine to find tunes in my head. I thought about creating some kind of dictionary based on theme notes, or searching through bww files for sequences. What a thrill to find your site. I just hum a tune, use the up, down, repeat letters and… like magic the title is found. You are a genius. I will never be stumped for a title again. Thanks so much, John

Other successes i’ve heard of are: 2 Youtube movies being identified, a nameless bww file and mp3’s

Mail from Dave:

Hiya

My name is Dave Mason. I put a few tunes together a few years ago called "Tummle Yer Wilkies" which, I see, gets mention on your website. However, I see that you're not sure where people can access the tunes.

Well, the book is free to download from https://sites.google.com/site/tummleyerwilkies/home and I hope to have volume 2, "Tummle Yer Wilkies Too!" uploaded in the near future.

Cheers
Dave Mason

Geneva, Switzerland.

NEW - Palm version by Andreas Joebges (updated)
Added stuff changed software
Added parts in booklist and search.
Additions to www.drumscoresearch.org
Many additions by: Chris MacKnight
Palm version by Andreas Joebges
Added index send by : Henning
sat 14 feb: Installed DB on macbumm's site
sun 15 feb: Made some changes, limit search and layout
            Removed own collections from DB 
            Expanded statspage with jig/hornp/march/etc.
mon 16 feb: Imported College of Piping index i got from Ralf .. (thanks!)  
            Imported Irish Tunes for Warpipe
            Added Log, Fixed Members Login for edit purposes
tue 17 feb: Layout, testing new functions
wed 18 feb: Imported Bagpipe Music - John MacFadyen
thu 19 feb: Uploaded some Book Covers, 
            programmed a export-to-xls function, so you can use the
            DB data yourself (bottom of booklist pages) 
            Imported Gordon Highlanders Vol 1
sat 21 feb: Fixed m?c and l*ken search
            Imported Gordon Highlanders Vol 2
            Added AKA search
            Old search request stays in search field
            Added some covers
            code cleanup
mon 23 feb: Fixed bookcover popup
            Imported Mark Saul Vol I 
            Uploaded Mark Saul Cover II and changed faulty cover other Vol
            Bookinfo added ISBN, Price, etc.  Suggestion i got by Email
            Uploaded Queens Own Highlanders The Pipers Day  
            Imported Seaforth Highlanders - Standard Settings
thu 26 feb: DB cleanup
            Added Code
            Imported Donald MacLeod vol 1 2 and 4
fri 27 feb: 1st editor assigned - Henny Barnhoorn 
sat 28 feb: Imported Vol 5 and 6 Donald MacLeod 
sun 29 feb: CD Information added
            2nd editor - Coline Gerritsen
mon 01 feb: Added CDs .. Thanks Coline
            Gordon Highlanders Book 1 checked/added/etc. by Henny .. thanks
            CD displaying code changed
            Imported Robert Mathieson Book 4  (now over 4000 tunes in DB!)
fri 05 mar: Added CDs
            Altered ShowCD Code
sun 07 mar: Imported some books (NOW 50!)
            Henny Completed reediting Gordon Highlanders Vol2
            Add MP3 clip code in cdinfo
mon 08 mar: Imported book
            Fixed image caching for faulty browsers
            Search finds composers also
            Fixed Menu structure
            Added Templates
tue 09 mar: Added link under advanced search - find ALL harmonies. :)
wed 10 mar: Added book with cover + MP3 sample
thu 11 mar: Imported Piob. CD
            Added edit icon help 
fri 12 mar: Find tunes on CD in beta test .. :)
            (click search -> advanced .. enter a keyword, mark the media
            checkbox and click search .. CDs found at bottom of page .. :) 
sat 13 mar: Imported another filled-in cd-template :)
            Added some covers
wed 17 mar: Added 15 Piobaireachd Society Volumes
sat 20 mar: Added 3 CD's
tue 23 mar: Added several books (5166 tunes now!) Thanks John 
thu 25 mar: Changed code, checked book, imported book
tue 30 mar: Uploaded covers, edited book (Murray Blairs) and added books 
till
tue 06 apr: Uploaded Covers, Added books, Changed code
till
sat 17 apr: Imported some books, added parts to export-excell
            (will be in search later)
            Henny checked/edited some books
tue 20 apr: Imported books, testing query caching for speed improvement.
            (yes getting kindda large .. this thingy)
thu 22 apr: 100! BOOKs!
--missing log--
Added book, covers e.t.c.
sun 11 jul: Added Battlefield Book (thanx Markus)
mon 11 jan: Added 2 books (thanx again Markus)
  • 159 Books
  • 9868 Tunes
  • 1047 Air’s
  • 1315 Jigs
  • 638 Hornpipes
  • 3352 Marches
  • 489 Piob’s
  • 1586 Reels
  • 844 Strathspeys

Audio switcher

Doing my work from home via Jitsi (Jabra headset) and Listening to music on my speakers. Sometimes i want to switch output. For example spotify on my headset.

Using below code, i can easily switch between output sinks.

#!/bin/bash

if [ -z "$1" ]; then
    echo "DEVICE"
    pactl list sinks | egrep "^Sink|Description" | sed 'N;s/\n/,/' |sed -e 's/\t/ /g'  | cut -f2,5- -d" "
        echo "APPLICATIONS"
    pactl list sink-inputs | egrep -ie "^Sink|application.name" | grep -v "\-application-name" | sed 'N;s/\n/,/' | sed -e 's/\t/ /g' | sed -e 's/  / /g' | cut -f3,6- -d" "
    echo "Usage: $0 APPID DEVICEID" >&2
    exit 1
fi

pactl move-sink-input $1 $2

It shows output devices, and applications which are using audio sinks.
Just match them up.

MQTT Keyboard

A fancy keyboard….. At last a clickety keyboard. A Razer Blackwidow V3 mechanical keyboard. I’m not a gamer, but i like the clickety sounds. RGB leds are always nice to play with.

One of the nice things about razer is the Linux support!

Some nice links:

https://github.com/openrazer/openrazer

https://openrazer.github.io/

Even several python scripts can be found, but no MQTT.
So made a fast ‘n simple hack to control my keyboard with mqtt/nodered.

When someone is at the frontdoor, my keyboard changes from white to red.

Below a node-red example

My python code:

import paho.mqtt.client as mqttClient
import time
import os
import subprocess
import json

def on_connect(client, userdata, flags, rc):
    if rc == 0:
        print("Connected to broker")
        global Connected
        Connected =True
    else:
        print("Connection failed")

def on_message(client, userdata, message):
    subprocess.Popen(["razer-cli", "-c", message.payload])

Connected = False

broker_address = "your.mqtt.brokerip.here"
port = 1883
#user = "user"
#password = "password"
client = mqttClient.Client("mqttrazer")
#client.username_pw_set(user, password=password)
client.on_connect = on_connect
client.on_message = on_message

client.connect(broker_address, port=port)
client.loop_start()

while Connected != True:
    time.sleep(0.1)

client.subscribe('razer/in')

try:
    while True:
        time.sleep(1)

except KeyboardInterrupt:
    print ("exiting")
    client.disconnect()
    client.loop_stop()

Ipcam sphere panorama

I made a little script to make a 360 spherical panorama photo, using a remote controlled IP cam,

Looking at the API CGI, i only needed to control the movement of the camera and getting a snapshot.

  • Point camera down
  • Point camera maximal left
  • Take picture
  • Point a little to the right
  • Take picture, loop until max right
  • Point a little more up and go max left
  • Doing same loop as above, until pointing maximal up
Made a little animation in blender

After getting all those pictures, i only needed to stitch them using Hugin.
When viewing the image with VR Glasses, i could look around my room, without image distortion, like below flattend example.

The ipcam generates a token, which you have to use in your curl commands.

TOKEN PART

token=$( curl -s -d  '[{"cmd":"Login","action":0,"param":{"rs": "abcd", "User":{"userName":"admin","password":"SECRETPASSWORD"}}}]'  "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=Login&token=null"  -H 'Content-Type: application/json' | grep name | cut -f4 -d\" )

GETTING A IMAGE FROM IPCAM

wget "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=123asd&user=admin&password=SECRETPASSWORD" -O output.jpg

CONTROLLING MOVEMENT

curl -X POST  -d '[{"cmd":"PtzCtrl","action":0,"param":{"rs": "abcd", "channel":0,"op":"Left","speed":1,"id":1}}]' "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=PtzCtrl&token=$token"

COMPLETE SCRIPT

#!/bin/bash
token=$( curl -s -d  '[{"cmd":"Login","action":0,"param":{"rs": "abcd", "User":{"userName":"admin","password":"SECRETPASSWORD"}}}]'  "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=Login&token=null"  -H 'Content-Type: application/json' | grep name | cut -f4 -d\" )
echo $token

if [ $2 == "max" ]; then
curl -X POST  -d '[{"cmd":"PtzCtrl","action":0,"param":{"rs": "abcd", "channel":0,"op":"'$1'","speed":1,"id":1}}]' "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=PtzCtrl&token=$token"
exit 0
fi


for x in $(seq -w 1 25) ; do
	for y in $(seq -w 1 12) ; do
                wget "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=123asd&user=admin&password=SECRETPASSWORD" -O ${x}${y}.jpg
		curl -X POST  -d '[{"cmd":"PtzCtrl","action":0,"param":{"rs": "abcd", "channel":0,"op":"Right","speed":1,"id":1}}]' "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=PtzCtrl&token=$token"
		sleep 0.5
		curl -X POST  -d '[{"cmd":"PtzCtrl","action":0,"param":{"rs": "abcd", "channel":0,"op":"Stop","speed":1,"id":1}}]' "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=PtzCtrl&token=$token"
		sleep 5
	done

	curl -X POST  -d '[{"cmd":"PtzCtrl","action":0,"param":{"rs": "abcd", "channel":0,"op":"Left","speed":1,"id":1}}]' "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=PtzCtrl&token=$token"
	sleep 30
	curl -X POST  -d '[{"cmd":"PtzCtrl","action":0,"param":{"rs": "abcd", "channel":0,"op":"Stop","speed":1,"id":1}}]' "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=PtzCtrl&token=$token"
	sleep 1
        curl -X POST  -d '[{"cmd":"PtzCtrl","action":0,"param":{"rs": "abcd", "channel":0,"op":"Up","speed":1,"id":1}}]' "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=PtzCtrl&token=$token"
	sleep 0.5
	curl -X POST  -d '[{"cmd":"PtzCtrl","action":0,"param":{"rs": "abcd", "channel":0,"op":"Stop","speed":1,"id":1}}]' "http://camera.ip.number.here/cgi-bin/api.cgi?cmd=PtzCtrl&token=$token"
sleep 5
done
1st panorama (Black and White due to night mode camera)