Skip to content

Instantly share code, notes, and snippets.

@BenjamenMeyer
BenjamenMeyer / README.rst
Created October 25, 2023 03:44
Vega Strike Docker Image Debugging
  1. Check out the Vega Strike Docker Images repo:
  1. Copy the local-test-ci.sh script attached here into a local version in that repo:
@BenjamenMeyer
BenjamenMeyer / err_array.go
Last active June 28, 2022 16:29
golang error wrapping
package main
import (
"errors"
"fmt"
)
var (
Err1 error = errors.New("Err1")
Err2 error = errors.New("Err2")
https://google.github.io/styleguide/cppguide.html#C++_Version
- We're using C++11, nothing newer
https://google.github.io/styleguide/cppguide.html#Header_Files
https://google.github.io/styleguide/cppguide.html#Self_contained_Headers
https://google.github.io/styleguide/cppguide.html#The__define_Guard
https://google.github.io/styleguide/cppguide.html#Inline_Functions
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
https://google.github.io/styleguide/cppguide.html#Nonmember,_Static_Member,_and_Global_Functions
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#abstract
"By “modern C++” we mean effective use of the ISO C++ standard (currently C++17, but almost all of our recommendations also apply to C++14 and C++11)"
IOW, it's primarily written against a version of C++ that we already know we can't use because not all platforms support C++17.
At best, our common denominator is C++14 but most likely only C++11. I wouldn't go beyond C++11 at this time.
============================================================================================================================================================================================================
@BenjamenMeyer
BenjamenMeyer / README
Created March 27, 2021 03:35
Ansible DNS Root MD5 Dict Lookups
I am attempting to download the Root DNS Zones from ISC and I want to validate the data using the MD5 sums they provide.
I had this working in the past (summer 2020) but something changed and I had to rewrite it to the content in the root_zone.yml.
The essential is this:
1. dns_root_zones holds the dict of data (set via the role defaults)
2. the data is downloaded onto the node
3. the MD5 contents are slurped back to the host so it can be used in the verification step of the actual root file download
4. If I hard code the `selectattr` parameter, then it works fine; but that's not extensible
5. If I link the `selectattr` parameter to the loop variable so I can process the dns_root_zones properly ( like I do in other roles) then it breaks and doesn't find the data
@BenjamenMeyer
BenjamenMeyer / discussion
Last active December 20, 2017 22:39
QtCreator + Android Debugging
(05:19:53 PM) TemporalBeing: @sergio https://photos.app.goo.gl/WfwOUpsrfK09tX5g1
(05:22:25 PM) sergio: TemporalBeing: what's in /home/bmeyer/Android/Sdk/platforms/ ?
(05:24:18 PM) TemporalBeing: folders for `android-2[3-7]`
(05:28:47 PM) TemporalBeing: details at https://gist.github.com/BenjamenMeyer/cef0b8f3f9e296e0bb46ca5f21181ee0
(05:35:22 PM) sergio: my setup looks different, I have the ndk outside of the sdk, and it tells me to use the native sdk manager
(05:35:42 PM) sergio: TemporalBeing: if you click on the "Native SDK Manager" button, does it tell you have the platform sdk correcty installed ?
(05:36:51 PM) TemporalBeing: it just tells me: " SDK manager UI tool is not available in the installed SDK tools (version 26.1.1). Use the command line tool "sdkmanager" for advanced SDK management"
(05:37:41 PM) sergio: ask bog_dan_ro in #necessitas tomorrow
#!/bin/bash
echo "Cleaning up after docker..."
STOPPED_CONTAINERS=$(sudo docker ps -aq)
if [ -n "${STOPPED_CONTAINERS}" ]; then
echo "Removing stopped containers..."
sudo docker rm ${STOPPED_CONTAINERS}
fi
@BenjamenMeyer
BenjamenMeyer / ssh_paramiko.py
Last active April 5, 2017 19:34
paramiko directly vs sshaolin wrapper
from paramiko.client import (
SSHClient,
WarningPolicy,
)
from paramiko.ssh_exception import *
host = "<host>"
user = "root"
password = "<password>"
@BenjamenMeyer
BenjamenMeyer / README.rst
Created January 14, 2017 21:18
FreeCAD - modeling a 2"x4"x8' board with pockets for interlock

I am working on a building a physical workbench with storage. The bench will be 8 ft long, 4 ft high, 4 ft deep - these are relatively easy dimensions in the US since stock lumber comes in a few sizes - the most popular is 2"x4"x8', so I just have to cut some boards in half.

Now, I've already drawn by hand - on paper - my ideas. But I'd like to try my hand at making them in a CAD tool and see if I can get a more accurate design creation. My prime choice is FreeCAD - AutoCAD is too expensive for my hobbyist needs and I love open source, and FreeCAD seems to be among the best there is from the FOSS world....that's not to say it is the best but it's what my (albeit limited) research shows is a good choice.

I figured out how to model the basic lumber I need - for example, the common 2"x4"x8'. However, my design also calls for

@BenjamenMeyer
BenjamenMeyer / mimic-validate-token.py
Created June 6, 2016 22:14
Example Mimic Token Validation
#!/bin/bash
import json
import requests
def get_creds(ad):
resp = requests.post(
'http://localhost:8900/identity/v2.0/tokens',