Jump to content

TheRealShadoh

Member
  • Posts

    29
  • Joined

  • Last visited

Awards

Profile Information

  • Occupation
    Consultant

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @fpo Ahh gotcha, didn't know it was the correct term- thanks! @tikker You're absolutely right, I layed the ground work for pytest, but... also have that on my perpetual list of "learn this" lol. I'll need to do it here soon though.
  2. The program is written, and no doubt has room for improvement. This question doesn't pertain to an error, mostly asking for any best practice on how to debug said package while using the "import package_inv" line that is set when made into a wheel, instead of changing to "import functions" when I want to debug the package not using the wheel. I'll read up on UML, I tend to use mermaid for flow charts. It'll be neat to see what differences exist. Ah something like that could work, if I have it match on the the repo path or something. Will give it a shot thanks!
  3. Do you just need the files off of the disk? If so boot up an ubuntu live disk, attach a USB drive, and pull your files.
  4. I'm working on a python pip package that we use as an inventory solution for our ansible automation. At the moment when I want to debug it I have to comment out the import statements and uncomment import statements looking for the local files. This was my first venture into python so I'm a bit lacking on best practices. Is there any method to debug a package, make modifications, debug, repeat without needing to shuffle the import statements before I commit and push to git? Any help is appreciated! Tree of the package directory package_inventory ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-36.pyc │ ├── classes.cpython-36.pyc │ ├── filters.cpython-36.pyc │ └── functions.cpython-36.pyc ├── classes.py ├── filters.py ├── functions.py └── script.py _init_.py #! /usr/bin/env python3 import logging log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) import package_inventory.classes import package_inventory.functions import package_inventory.filters functions.py I swap comments around in here for debugging and when I make the wheel #! /usr/bin/env python3 from ast import Str from distutils.log import error #### WHEEL IMPORT UNCOMMENT #### from package_inventory import log as logging from package_inventory import filters as custom_filters from package_inventory import classes as dg_classes #### WHEEL IMPORT UNCOMMENT #### #### DEBUG SCRIPT.PY IMPORT UNCOMMENT #### #import logging #import classes as dg_classes #import filters as custom_filters #### DEBUG SCRIPT.PY IMPORT UNCOMMENT #### import argparse, re, sys, time, os, json, csv from jinja2 import Environment, BaseLoader, DebugUndefined from textwrap import dedent from ruamel.yaml import YAML, ruamel, parser from pathlib import Path from getpass import getpass import ansible.plugins.filter.core import ansible.plugins.filter.mathstuff import ansible.plugins.filter.urls import ansible.plugins.filter.urlsplit import ansible.plugins.filter.ipaddr import ansible.plugins.filter.gcp_kms_filters import ansible.plugins.filter.json_query import ansible.plugins.filter.k8s import ansible.plugins.filter.network classes.py I swap comments around in here for debugging and when I make a wheel #! /usr/bin/env python3 ''' Check the individual classes for their __doc__ ''' from pydantic import BaseModel from typing import Optional #### WHEEL IMPORT UNCOMMENT #### from package_inventory import functions as dg_functions from package_inventory import log as logging #### WHEEL IMPORT UNCOMMENT #### #### DEBUG SCRIPT.PY IMPORT UNCOMMENT #### #import logging #import functions as dg_functions #### DEBUG SCRIPT.PY IMPORT UNCOMMENT #### script.py This is the script I call to debug, its a carbon copy of the inventory script that uses the module in production. With the exception of the imports being local. #!/usr/bin/python3 from argparse import ArgumentError import os, ruamel.yaml, classes, functions,sys #from package_inventory import log as logging import logging from os.path import exists
  5. Hmm motivation to pickup new hardware for more numbers...I like. Good stuff man, very nice! If you end up putting the code on git I'd love to look at it to see what you're doing (learning mode).
  6. Having used FreeNAS (3yrs) and Unraid(less than a year) on my home NAS, I'd generally say go with FreeNAS for a production environment. Since you're on a vmware platform, have you considered going with vSphere Data Protection (VDP) or VEEAM as a backup solution? I've only ever used VDP in my production environments (backups local), seems it's not supported moving past 6.5. But if it's included in your vSphere license (or cheaper to get a license for 6.5 that supports it), may be an option. Can't be of more help outside of that though. Let me know what you end up going with!
  7. @Windows7ge thanks for the info, and negative I don't know where to snag the weak key.
  8. You gave me the idea to try using docker for it! Seems to be working so far, now how to secure it and whatnot is a problem for another day. Successfully started working on tasks. Azure setup a container instance and pointing it to "linuxserver/boinc". then opening 8080 TCP in it's networking settings. Stuck on "Ready to Start" when done as a web app container... haven't gotten container instance to be persistent, but the instances will begin processing. If it fails miserably I'll update this post.
  9. We have any guides floating around for configuring cloud resources for this? I can toss some toward Azure. Found this... anyone know of a better method?
  10. Thanks yall! I'll verify the settings and let it roll!
  11. Set up my NAS to run this as a fire and forget 8c/16t allocating 75% of the cores.. is Rosetta the right one to have it working on? I just looked at the bunkering guide to set it up, havent used boinc before.
  12. Thanks for organizing and supporting the event @GOTSpectrum @Metallus97 @leadeater @j1philli.
  13. If this is on a domain system, use a GPO, but an easy solution is just change the registry of the box Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -name "dontdisplaylastusername" -value 1 If its more than just your box you're hitting... try { $existingValue = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -name "dontdisplaylastusername" Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -name "dontdisplaylastusername" -value 0 $newValue = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -name "dontdisplaylastusername" } catch { throw } Write-Output "Was: $($existingValue)" Write-Output "Is: $($newValue)" Do some logging and output stuff to something you can review. Use a loop if you have a bunch of things to change in registry. foreach($object in $list) { }
  14. Seems this has a solution (also don't know C) but I'm curious, would it be possible to get the index of each letter in the sequence, and print everything from indexD to indexN? Don't know why you'd do this instead of looping, but curious if it's even a method that would be considered.
  15. Sweet thanks, I won't look at it and just nod my head in agreement at the numbers now!
×