GIT Repo Updates

I just updated my GIT Repos.

1. I uploaded my current version of my SmartHome Display
https://github.com/webfraggle/SmartHomeWebRemote
2. Added a LG WebOS Websocket Proxy
https://github.com/webfraggle/lg_websocket_proxy

Rotate Pimoroni Hyperpixel 90°

Display Rotation

First change display rotation in /boot/config.txt

display_rotate=1

Edit Hyperpixel touch driver

Then you need to edit the touch driver. Luckily it is a python script. I have the Information from here https://forums.pimoroni.com/t/hyper-pixel-rotate/5276/4. But the script has changed.

sudo nano /usr/bin/hyperpixel-touch

So here are my changes.

In the upper part Exchange 480 by 800 and viceversa:

(e.ABS_X, AbsInfo(value=0, min=0, max=480, fuzz=0, flat=0, resolution=1)),
        (e.ABS_Y, AbsInfo(value=0, min=0, max=800, fuzz=0, flat=0, resolution=1)),
        (e.ABS_MT_SLOT, AbsInfo(value=0, min=0, max=1, fuzz=0, flat=0, resolution=0)),
        (e.ABS_MT_TRACKING_ID, AbsInfo(value=0, min=0, max=65535, fuzz=0, flat=0, resolution=0)),
        (e.ABS_MT_POSITION_X, AbsInfo(value=0, min=0, max=480, fuzz=0, flat=0, resolution=0)),
        (e.ABS_MT_POSITION_Y, AbsInfo(value=0, min=0, max=800, fuzz=0, flat=0, resolution=0)),

and in the lower part Exchange x and y and add flipping the coordinates.

write_status(y1,800- x1, touch_one_start is not None, y2, 800-x2, touch_two_start is not None)

Restart hyperpixel touch daemon

sudo systemctl restart hyperpixel-touch

mysqldump windows command line only databases with prefix

Here’s a little snippet which mysqldumps only the databases with a specific prefix or another wildcard expression under windows command line or windows batch.

@echo off
setlocal enabledelayedexpansion
set myvar=
for /f %%i in ('c:xamppmysqlbinmysql -uroot -pmysql -e "SHOW DATABASES LIKE 'prefix_%%'"') do set myvar=!myvar! %%i
echo %myvar:~10%
@echo on
c:xamppmysqlbinmysqldump.exe -u root --password=mysql --databases %myvar:~10% | "c:Program Files (x86)gzipgzip.exe" > "C:WHEREEVERYOUWANTmysqlbackup-%date:~6,4%-%date:~3,2%-%date:~0,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%.gz"

AS3 Simple UnTAR

The challenge: How to distribute additional content-packages for an Adobe Air App for iOS and Desktop.

The Answer: Inspired by this article I started coding my own ActionsScript tar version to unpack gnu-tar files. This format has some benefits. First it is one file, easy downloadable and shareble. Because it’s uncompressed, it is faster than any compressed format like zip. This doesn’t really matter because all files in my packages are compressed files like jpeg. I unpacked a 350 MB file on an iPad 2 in 18 seconds. Additionally it is very fast to extract only one file or data out of it, maybe for some metainformation. Possibly there is some potential to optimize the speed. It’s a common used format, so packing tools are available on all plattforms (Windows, Mac OSX and Linux). Because of this there is no need to code a special packing tool.

And last, I want to share this with you:

AS3 Simple Untar on Google Code

Have fun with it.

Found some old browser games

While a research I found some very old browser games I developed many years ago:

The Blind People Simulator
A JS/DHTML Game from 1997. Does anyone knows Netscape today 😉
PLAY
For this we got a small article in a PC magazine and one or two angry mail how we can make funny games about disabled people.

Stress-O-Matic
A small Flash game like „Punch the monkey“. Try bill, santa or general as secret codes.
PLAY
No guarantee that they will work in modern browsers.