Monday, April 5, 2021

Travel Entertainment Revisited

 A few years ago I built a travel entertainment box.  It included a HooToo Elite Tripmate (wireless router with built in battery and streaming), 500gb SSD drive and 12000 mha portable usb battery.

Awhile ago I decided to add a RaspberryPi Zero running PiHole.  I then routed all the DNS queries for it to the PiHole and presto no more ads.

It all fits very nicely into a plastic pencil box and works great.

Sunday, May 17, 2020

It Lives!

If you look back, you will notice that I found instructions on how to build an LED cube 9 full years ago (May 4th, 2011!).  I ordered the parts in early September of that year and started building soon after.  I finished the boards sometime around April of 2012 but wasn't confident enough in my work to try and turn it on.  For the last 8 years it has been sitting on & under my desk.

This past week I decided it was time to actually try to make it work.  I reviewed the boards and found a couple of broken wires to fix, found 2 solder traces that were wrong but over all everything looked good.

I hooked it up to the USBTiny programmer which was hooked to a Raspberry Pi (wanted Linux), sent the 'test' program to it and PRESTO it worked.  I was floored.  I did find a couple of columns didn't light appropriately which turned up a couple broken solder joints that I didn't notice.  Got those fixed and it works perfect.

Next up is to get the main program working correctly... I suspect I have a solder trace wrong somewhere but not sure yet, haven't dug into it that much yet.

Here is a short video of the test program running.

https://vimeo.com/419409567

Wednesday, April 29, 2020

A new update

Another year and a half has gone by since I last posted.  Lets do a quick catch up...

Work is good, boss is good, doing a lot of coding (both web & winform based) and generally just being awesome at what I do :)

Most recently, I built a replacement for my 300 CD changer using a Raspberry PI 3, a 23" touch screen monitor and software called SilverJuke.  Makes playing ripped CDs really easy.  I did have to make an enhanced interface so the buttons were bigger for the monitor.

Got a bunch of landscaping done (paid for it) that we have wanted done for 2+ years.

Replaced the dishwasher.

Freezer died, lost a bunch of food, bought a new one, moved on.

Really hate the COVID restrictions but working from home has turned out to be better than expected.

Miss my friends

Got a LOTR

Playing pinball randomly.

Thursday, December 20, 2018

Work

So, I had this big long rambling post about my work history and the bosses that I have had. I decided not to post that but to condense it down to this:

A leader can make your job enjoyable enough that you stay despite everything, or they can make you want to leave as quick as possible.

I've had both kinds... I'm fortunate enough that my current leader is awesome.

Sunday, June 3, 2018

Coding

I love to code. Its as simple as that. If I had a job where I couldn't code, I probably wouldn't stay in that job very long.

I don't especially care what the language is because I can figure it out (with my pal Google). I've coded in a lot of different languages. I'm sure there are more than this but these are the ones I can think of off the top of my head: Basic, Assembly, Pascal / Delphi, Today, Progress, Cobol, dBase, Hibol, C, C++, C#, VB, VBScript, VB.Net, Java, JavaScript, Perl, PowerShell, PHP, Various other "shell" batch languages

I loved doing Assembly when I was deep into it (many, many moons ago). The system was there for all to see and I was tweaking the heck out of it. I doubt that I would know where to begin on a 'modern' system.

I'm not sure that I have a favorite language. If I'm going to do something web based then I would probably choose PHP (with lots of JavaScript). If I'm going to do something Windows based then its probably going to be C#. If I just need a script then most likely it will be PowerShell or Bash (depending on the OS :)).

My advice to you, learn all you can and follow your passion. The more you know, the more valuable you are and the more hire-able you will be.

Thursday, January 11, 2018

Chrome in C#

Recently I got a new NAS and wanted to monitor the heath on a regular basis. So I wrote an app to log into the web admin portal and display the system status dashboard. I used the CefSharp toolkit found here: https://github.com/cefsharp/CefSharp

It was super easy to use. I just created a form then added the following code:

       
public ChromiumWebBrowser chromeBrowser;

CefSettings cefSettings = new CefSettings();
Cef.Initialize(cefSettings);

chromeBrowser = new ChromiumWebBrowser("INSERT_WEB_URL_HERE");

this.Controls.Add(chromeBrowser);

// fill the window minus the menu
chromeBrowser.Dock = DockStyle.None;
chromeBrowser.Top = menuStrip1.Height;
chromeBrowser.Height = this.ClientSize.Height - menuStrip1.Height;
chromeBrowser.Width = this.ClientSize.Width;
chromeBrowser.Anchor = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
      
 

Then you can do things like this:

       
chromeBrowser.ExecuteScriptAsync("document.getElementById(\"ext-comp-1091\").click();"); // stats web menu item
      
 

Fun times.

Sunday, June 18, 2017

SharePoint jQuery generic call to get rest data

Lately I've been working with SharePoint a lot and creating functions to read data from lists and manipulate / display it to the user.  Below are two generic JS / jQuery functions that I created to do this.

I've explained the parameters so hopefully you will find it useful.

// inListSiteURL is the base URL of the SharePoint site... such as https://somespsite.somedomain.com or https://somespsite.somedoamin.com/someSubSite
// inListTitle is the title of the SharePoint list
// inHaveResultsFunction is the function to call when data is found
// inNoResultsFunciton is the function to call when no data is found
// inFilter is the filter to use... maybe something like "?$select=Title,URL&$top=100&$filter=Editor/Id%20eq%20123&$orderby=Title asc"... you can leave this blank if you want
// inFinalFunction is the function to call after all results
function spGetListData(inListSiteURL, inListTitle, inHaveResultsFunction, inNoResultsFunction, inFilter, inFinalFunction)
{
    try {
        var callURL = inListSiteURL + "/_api/web/lists/GetByTitle('" + inListTitle + "')/items" + inFilter;
        spGetRestDataCall(callURL, inHaveResultsFunction, inNoResultsFunction, null, inFinalFunction);
    } catch(err) {
        
    }
} // function spGetListData


// this function is a 'generic' ajax call used by the other functions to simplify the code
// inURL is the URL to the SharePoint list to retrieve data from
// inSuccessFunction is the function to call when data is returned
// inNoResultFunction is the function to call when no data is returned
// inErrorFunction is the function to call when an error is encountered
// inFinalFunction is the function to call when after all the data is processed
function spGetRestDataCall(inURL, inSuccessFunction, inNoResultFunction, inErrorFunction, inFinalFunction)
{
    var spRestContentType = "application/json;odata=verbose"; // you should not have to change this
    $.ajax({
        url: inURL,
        method: "GET",
        processData: false,  
        contentType: spRestContentType,
        headers: { "Accept": spRestContentType },
        success: function (data) {
            try {
                if (data.d.results.length == 0) {
                    if (inNoResultFunction !== null) {
                        inNoResultFunction();
                    }
                } else {
                    $.each(data.d.results, function(index, item){
                        inSuccessFunction(index,item);
                    });
                    if (inFinalFunction !== null) {
                        inFinalFunction();
                    }
                }
            } catch(err) {
                inSuccessFunction(data.d);
            }
        },
        error: function (data) {
            //console.log(JSON.stringify(data));
            if (inErrorFunction !== null) {
                inErrorFunction(data);
            }
        }
    });
} // function spGetRestDataCall
Copyright Realm Laboratories, LLC