Category Archives: Sandbox

Wednesday, September 9, 2020

Interesting times. Hitting a bunch of topics that are more than a little divergent but interesting.

Networking Security

Work keeps me deeply involved on this front. Down in the TLS RFCs, certificate stuff, algorithm and cipher suite options and some lower level work. This may sync well with some home project work as well at some point..later once I’ve gotten some other things back rolling.

WPF

I’m digging deeper into WPF coding for some of the simpler home-front tools. I’ve done a decent amount of JavaFX coding and MFC work but java doesn’t give me access to the low level APIs these tools need and MFC is old, crusty and much harder to work with.

WPF is a bit of an odd critter but seems to fit my needs decently. I’m still working through many of its oddities and figuring out what works well with its design but I’m optimistic that it will remain a good tool for prototyping on windows and for small home tools development.

Unity

Last year I did a good bit of Unity VR programming with a couple of friends.

The year since has been busy as I changed jobs and took on a very challenging set of problems at my new work (cybersecurity, networking security design and fitting it all into an existing architecture that goes back quite a way). I’m hoping that with the fall I will be able to put some more effort into home projects in off hours. Till now I’ve been working during work hours and digging into technology and background issues in off hours.

I’ve got the VR system downstairs back together and calibrated to the room. I’m still eyeing headset upgrades but don’t feel that I’m at the point where I want to throw the money at the systems that are out there.

I need to get back into the basic details needed to build out a VR Unity app. I know I have notes on this blog that will get me there. Once I have that together I’ll move forward with some ‘stretching exercises’ in VR.

I’m also realizing that both the VR environment and the flat screen environment Unity could be a nice environment for some amount of tooling so I’ll probably try to see if PInvoke and similar are supported. Being able to pull information out of a system and then render it and manipulate it in a Unity managed space seems potentially very interesting. With a bit of TLS and networking support and this might get even more interesting. Things to think about.

Rest of it…

I will almost certainly bite off more than I can chew on the home front. Hoping that some interesting bits will make it to a level where they’re useful. I’ll keep blogging here (and on my personal blog and pandamallet for more detailed game stuff). Hoping to reconnect with the friends I was working with a year ago and that a covid vaccine lets us all get back closer to normal life in 2021.

And a Look Back at WPF

Hmm…WPF VIewport3D or Unity 3D rendering. Being able to build a simple-ish windows program rather than something that requires a VR headset does have a sort of charm. Hit testing mouse clicks into the 3D view could be interesting. Choices, choices.

I expect to bump around here a bit.

I really like having the GPU handle display list rendering for me and then being able to change the world while the hardware handles keeping the user’s view consistent.

Seems like it may be worth playing with Unity VR, Unity on a monitor, WPF 3D viewports and perhaps even MFC hosting OpenGL or DIrect3D (Vulkan?). If I can make this stuff work it should prove helpful in many places. Making it work in a more general purpose environment (mostly meaning not Unity) seems alluring as it permits tools to be built with full access to native APIs and facilities.

I think this gives me a direction to head off in that is interesting. I’ll probably still start with a Unity VR implementation as that gives the most ‘bang for the buck’ and should be fun to play with.

THinking that VR Solves Everything :)

After a bit of thought and some time looking at WPF canvas and related items I realized that the same VR environment I planned to use for the random dungeon generator (toy program to play with Unity some more) would make a good environment for putting together an interactive room layout editor.

I was going to try to put together a room drawing tool in WPF. I would prefer to build something like that with interactive drawing as the user moves the mouse. Looking at WPF drawing primitives it seems as if that would get ugly quickly as I really want something closer to a rendering environment. Each frame should be redrawn with updates from any user input reflected.

The 2D APIs seem much more oriented towards static drawings. Update on clicks rather than the 3D style display lists where the image on the screen gets updated continuously. Given the hardware available on even low powered modern computers there is no good reason not to provide this sort of constant, interactive feedback (the equivalent of WSYWG for office tools 30 years ago.

Unity VR provides all of the tools to make this sort of thing happen and should actually provide a very pleasant UI experience along the way. I think I’ll try putting together a map drawing tool as an interesting exercise soon. It may or may not be the final approach but it seems worth trying.

Playing with WPF Canvas

I need to put together some 2D-ish editing tools for some home project work I’m doing.

I’m still working my way through WPF panels and controls so that seems like a good place to go with this.

Tonight I’m probably just going to try to get some basic mouse controlled drawing going in this thing. A throw-away toy program with some limited functionality to get familiar with the functions here.

In the end I may very well look at using 3D functions (and perhaps not WPF) to make this happen. Being able to do full renders would allow for some nice effects but if the 2D WPF functions are click enough I may make do.

Building Out Cluster Web Parts

Schema fun

I’ve been through the basic pieces (many, small and fiddly) of the SQL schema for this game a couple of times now. Each time I get a certain distance down the road and run out of steam putting together the various details needed.

First web bits

I’m going to start in on the process of laying down the game logic and support structure at this point. Initially I’m not planning to lay in any significant security. I’ll likely skip password storage and focus on the first two big steps in getting a game setup.

  • Login and signup screen
    This gets me user creation and walks me through session management for players in the game.
  • Game creation screen
    I expect a logged in user to create a game and then perhaps invite other players (up to three more) into the game. Initially, I’ll probably make the invitation process very simple…you invite the others to the game at game creation time and when you login you see your active games and open invitations (where you can accept or decline).
  • Game administration screen
    Ideally useful to help with debugging of things. Getting a look at digested versions of the game tables in a helpful format should make it easier to see what is going on and when things are messing up.

Steps to follow

Once these pieces are in place (and perhaps backed by some RESTful API bits) I’ll want to set up the VR viewer to access the stored star information for a selected game.

I expect that user permission information will be pre-stored on a given computer/account separately and the VR lobby will simply provide a list of games to the user to select from.

Once a game has been selected, the full game VR will be displayed and the player may begin setting up a new turn (if the previous turn has completed).

A Weekend of Database and CertificateS

Spent some time over the weekend doing some more work on the MySQL database layout for the cluster game and working on getting self-signed certificates prepared for my various development machines.

PHP and MySQL

The database work went smoothly. Still largely on the whiteboard at the moment. I’ve also been going through a PHP re-familiarization as I’ll need to code this stuff in PHP for my hosting and I haven’t worked in that environment in some time. I did grab an evaluation license for PHPStorm a few weeks back, but I fear that was premature as I haven’t reached the point where I need such tools on this sandbox project yet.

Certificates

I finally took the time to create SSH certificates to permit direct logins to my linux machines from my windows systems. That part I’ve done many times before and it went flawlessly.

I created and installed self-signed certificates for various local systems and set up TLS on their Apache servers. The creation and installation went smoothly, but the end-result was not what I was hoping for.

After installing the certificates in several different ways on the systems/browsers involved, I still did not see the secure icon in the address bar. I’m not sure whether this is caused by the certificates being self-signed (shouldn’t be as I installed the keys directly from files into the trust stores) of something else I’m not doing properly. I’ll need to keep looking at that one.

I do want to verify that the connections are using TLS. If they’re encrypted but not ‘safe’ because they’re not signed by a major cert vendor then I’m probably ok with that. If the TLS handshake failed because they don’t have the right certs then there’s a bigger problem.

Sunday evening I started down the road to building a local CA to sign all of my certificates with. I’m wondering if setting this up and loading its public key as a trusted root may give better results. The process is a bit more involved but may be worth it if it gets closer to the results I’d get with a commercial certificate.

I still haven’t found a way to load a FreeTLS certificate on my GoDaddy hosting. One of these days I’ll spend the time to get on the phone with their support folks and see if this can be worked out.

I may try setting up a FreeTLS cert on my dynamic DNS connection that targets a port on my home firewall. That would provide more flexibility, but be less robust and scalable.

Samba SMB Shares

Toward the end of the evening I ran through samba installs on several systems. I had been pushing files around between my windows and Linux machines all weekend and wanted to make things closer to seamless.

I had no real luck on that front. I could get things to the point where windows recognized share names from the Linux machines. I could never get things to the point where my windows systems could connect to a share and see files inside. Not sure what I’m missing and the samba logs were not at all helpful.

I’ll probably re-visit this again sometime soon, but for now the convenience of having it working isn’t worth the effort involved in finding out why it isn’t.

Getting Back to PHP Work for Cluster

Since vacation I’ve been pretty busy working on photo post processing and around the yard.

At this point I’m going to be trying to get back to building a back-end for the unity based cluster game that runs in PHP on my web hosting (initial work on local sandbox PHP instances of course).

I think I’m going to try using Visual Studio Code with PHP Extensions to get this started. I’ve done a little PHP coding in the past, but this looks likely to be far more involved than any of that.

I’d like to get a TLS cert on my site before going live with this, but it appears that my hosting may not support free TLS or similar cert installs and I’m not happy adding the annual renewal cost for a cert to my site at this point so stay tuned. I’ll probably try hitting GoDaddy support some evening soon to see what they can tell me.

First steps will be getting a simple RESTful interface defined and then laying out some simple SQL schema to provide the back-end. If I can get that working, I’ll look at extensions necessary to provide the full back-end to the game as a whole. Not looking for commercial quality here, just something sufficient to allow multi-player turn based gaming.

CLuster Game Web Back Ends

Just reinstalled clean and up to date copies of XAMPP, MariaDB and MongoDB on one of my home machines. 

I need to write some RESTful PHP code that can run on my web hosting as the back-end for a VR game I’m playing with. This gives me a platform for building that code in a safe place.

I do need to stick to PHP 5.x features as my GoDaddy shared hosting does not support PHP 7.

I’ve got to get the basics stitched together, add an appropriate .htaccess to keep passwords out of inappropriate hands and then start working out a SQL schema that works for the persistent game data I need to store.

Spending a big chunk of this long weekend post processing pictures from our recent vacation (see them on the blog side of ninecrows if you’re interested). Watched the whole last season of Game of Thrones and saw Aladdin. Lots to still get done, but progress is progress 🙂

More WPF and PInvoke

My command of the PInvoke functionality that I need is largely complete. I’m looking at stepping up my WPF skills to build out some more usable UI front-ends to these tools.

Add in some MongoDB back ends for persistence and I expect to be in a much better position to manage my data archives.

I’ll be pushing updates to my github account as I build test projects and useful tools.

Built a Few More Beacons and Tested IR

I built a few more beacons to play with last night. I’ve got some CR2023 battery holders that are smaller than the AA cell battery clips and have integrate power switches that I’m using for these. The red and blue LEDs work as expected (though they look dimmer to my eye than the white one on the first version we built).

I put together an IR LED based beacon as well (though without the diffuser as I’m not sure the diffuser plastic is transparent at 970 nm). I’ve demonstrated that the cameras I’ve got can see the IR LEDs on a remote control, even with their IR filters intact. I could see that the IR LED was on, but its brightness was much less than the brightness of the visible light LEDs so no real advantage to going with IR.

I also finished updating my RPi machines to the ‘scratch’ OS image and am close to having all of them built for OpenCV libraries. Once I get the last machine loaded up, I expect to switch back to one of the Ubuntu NUC machines and write some code to read from cameras and process the result.

Attaching LED information for easy later location…