Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Eastwood MadLittleMods

View GitHub Profile
@MadLittleMods
MadLittleMods / oc-cross-project-logs.md
Created Sep 1, 2022
View logs across projects in Red Hat OpenShift
View oc-cross-project-logs.md

With Red Hat OpenShift, here's how to view logs of a pod in a different project than the one currently active:

oc logs -n <project> <pod>

Option as documented but obscure and hard to follow because the option is namespace but oc always references them as projects everywhere else:

@MadLittleMods
MadLittleMods / sort-google-photos-dump.md
Last active Jul 29, 2022
Fix photos sorted in maddening wrong order by date
View sort-google-photos-dump.md

Problem

We were dealing with an out of order dump of photos from a Google photos album and wanting to upload to Facebook. It consisted of jpg and heic photos from a iPhone 8 and Pixel 4a so the metadata was different.

Sorting by Date Created in the macOS finder was out of order and Facebook seemed to sort in the same way. It didn't make any sense because we were seeing 4:55am photos sorted below 4:56pm photos (same day). Regardless of Italian timezone, they shouldn't be sorting like that (it's only GMT+2 vs my local GMT-6) which is an 8 hour difference compared the 12 hour difference shown in the photo date/times. Even looking at the exif metadata, it didn't make any sense what it was pulling from to make it sort that way.

Solution

This uses exiftool to read and do the file manipulation.

@MadLittleMods
MadLittleMods / golang-escape-forward-slash-in-test-name.md
Last active Nov 5, 2021
Golang: Escape forward slash in test name when using `-run` regex
View golang-escape-forward-slash-in-test-name.md

How to escape a forward slash in a test name when using -run to run a single Go test?

I don't think it's possible. The following are some other articles/blog posts reiterating this point.

The key seems to just not use any forward slashes in test names so you can target them individually no matter what.

Go Subtest Tips by Frew Schmidt

@MadLittleMods
MadLittleMods / eufy-robovac-25c.md
Last active Sep 14, 2021
Fixing a main rolling brush that is "stuck" on a Eufy RoboVac 25c (Robot Vacuum)
View eufy-robovac-25c.md

Eufy RoboVac 25c (Robot Vacuum)

The Eufy 11S (slim) seems to be pretty much the same vaccuum

Main rolling brush stuck

Eufy would often get stuck and beep 10 times. Since, I didn't have the app on my phone, I thought it was getting stuck on dark edges in the rug/carpet with the drop/cliff sensors but the app was actually saying "Rolling brush is stuck". There wasn't any obstructions in the brush.

View matrix-notes.md

UISI: Unknown Inbound Session ID (when you're unable to decrypt someones message in end-to-end encrypted (E2EE) room)

View fusion-360-notes.md

Autodesk Fusion 360

Autodesk Fusion 360 is free for personal use. It is a CAD program like Autodesk Inventor(which can be free if you have a .edu student school email address). I was familiar with Inventor and found Fusion 360 pretty similar with nice parametric modeling.

  • You can have multiple components in one design (and apply some assembly contraints)
  • For the blueprint type view that you can annotate and add dimensions, it is called a "drawing"

Random guides

View cmder-restart-ssh-agent.md

Sometimes the Cmder SSH agent seems to be borked and anything you try to connect to just rejects. I often run into this when running an Ansible command on a remote host

ssh root@xx.xxx.xxx.xxx
root@xx.xxx.xxx.xxx: Permission denied (publickey).
ssh_exchange_identification: Connection closed by remote host

Fix

@MadLittleMods
MadLittleMods / manually-add-saved-password-to-chrome.md
Last active Mar 23, 2019
Manually add saved password to Chrome
View manually-add-saved-password-to-chrome.md

Manually add saved password to Chrome

Some apps don't have browser logins (mobile or desktop only apps) but you still want to manage your passwords in one place (Google Chrome).

Solution

Inspect the page and insert the following HTML <form> anywhere on the page. Then fill it out and submit 🤠

@MadLittleMods
MadLittleMods / webpack-ContextReplacementPlugin--contextModuleFactory-npe.md
Created Feb 1, 2019
webpack ContextReplacementPlugin -> Cannot read property 'contextModuleFactory' of undefined
View webpack-ContextReplacementPlugin--contextModuleFactory-npe.md

Thanks to https://tgarchive.ru/group/webpack_ru/2018-03-21/

I solved this by making sure only webpack v4 was in my dependencies (check package-lock.json). Before I had mixed webpack v1 and v4 and had this error when I was upgrading webpack, https://gitlab.com/gitlab-org/gitter/webapp/issues/2078

TypeError: Cannot read property 'contextModuleFactory' of undefined
    at ContextReplacementPlugin.apply (webapp\node_modules\webpack\lib\ContextReplacementPlugin.js:59:18)
    at Compiler.apply (webapp\node_modules\webpack-stream\node_modules\tapable\lib\Tapable.js:164:16)
    at WebpackOptionsApply.process (webapp\node_modules\webpack-stream\node_modules\webpack\lib\WebpackOptionsApply.js:62:18)
    at webpack (webapp\node_modules\webpack-stream\node_modules\webpack\lib\webpack.js:22:48)