Sunday, June 2, 2024

Visual Studio Installer: ERROR: The system cannot find the file specified - following system restore

Problem: 

A long story short, a bad USB adapter killed motherboard USB headers. The system was old enough that buying a new CPU/motherboard would be as much as buying a used motherboard. I decided to do a new build, and with a fresh install my OS. While installing Visual Studio Community 2022, I found that the installer would download files, but then die when trying to perform the install. I had earlier had a BSOD issue with a PCI card, and ended up running a repair on my system. This messed up a lot of my just installed applications including Visual Studio. Oddly, the installer did not list a specified file, the rest of the error popup was blank.


Solution: 

After researching their cleanup tool (which you can only get if you successfully installed VS) and reading a couple SO posts, I decided to just try something. I renamed my application directories for 

    C:\Program Files (x86)\Microsoft SDKs 

    C:\Program Files (x86)\Microsoft Visual Studio 

and tried the installer again. This time it worked. 

Keep in mind this will likely mess with any settings you have already in place. 



Monday, April 29, 2024

Addressable LED Strip Odd Colors with Arduino | Weird Behavior

I was trying to run some test code using a strip of addressable LEDs and my Arduino, but every time I ran the program, I got odd colors and the last LED color was green. Sometimes I would get a stronger color in each LED - especially when trying to set them to all white. In my case it was Red, Green, Blue (repeating 1 time) then all the other LEDs were unlit.


It dawned on me (later than I would have liked) that the order of values was wrong for the LED strip I was using (you can visibly see the large White diode in each white square). I had initialized my LED strip (using NeoPixel) to NEO_GRBW instead of NEO_GRBW as my strip has a dedicated white LED. My major mistake here was that I thought I had a strip of WS2812B LEDs but really they were SK6812RGBW LEDs. 


Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRBW + NEO_KHZ800);

void setup()
{
strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
  strip.show();  // Turn OFF all pixels ASAP
  strip.setBrightness(MAX_BRIGHTNESS);
}

void loop()
{
auto color = strip.Color(255, 0, 0, 255); //  Optional 4th param is White
  for (int i = 0; i < strip.numPixels(); i++)
  {                                
    strip.setPixelColor(i, color); //  Set pixel's color (in RAM)
    strip.show();                  //  Update strip to match
    delay(50);                     //  Pause for a moment
  }
}

Friday, March 8, 2024

SiteGround SSH Login Trouble - Permission denied (publickey).

Problem:

Working with a company that uses SiteGround for hosting, we setup SSH access on the website using keys. The SiteGround system forces a specific SSH passphrase for your key pair and it appears to be randomly generated, which is fine and considered fairly secure to my knowledge. 

After setting up SSH config on my local machine and leaving things for a while, I came back to find that I could not login anymore. I confirmed my access should still work and that nothing has changed with the keys or passphrase but I continued to get: 

Permission denied (publickey).


Solution:

New solution: try a pass phrase with limited special characters. This does require you to setup a new ssh key through the website, but has ultimately solved my issue. My original solution seemed to be that somehow logging in was associated with when the passphrase would work and when it wouldn't. This is not the case. I also talked to support but they were only able to verify that my IP address was not being blocked while debugging the issue. 

Original solution: For some reason, SiteGround requires you to log back in on the their website before you can login with SSH. If you are already logged in, then you may need to log out and back in. As a guess, I think this is probably just a way they have chosen to try and combat potential bad actors, but it certainly has a lot of friction to it. 



Wednesday, January 3, 2024

Process Explorer - DLL Inspection

 I've been working with a DLL I got that doesn't have very great documentation. After trying a couple different things (ILSPy, and custom python to load and print callable functions) and all failing, I asked the great chatGPT. It suggested Process Explorer. 

I started my application, then searched for the DLL. Once I found the DLL, I was able to right-click and examine it's properties. This loaded a window with two tabs, Image and Strings. To be honest, I'm not sure off the bat what those mean, and the data on each tab seemed to be the same as the other at quick glance, but I was able to find functions I knew existed along side functions that I was not aware of. 


Exercise caution when calling any undocumented functions in your DLL, they may produce undesirable or event irreversible results.