ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Topics
    2. stacksofplates
    3. Posts
    • Profile
    • Following 0
    • Followers 13
    • Topics 145
    • Posts 7,946
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty

      @wirestyle22 said in Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty:

      I am breaking this down very slowly for myself. Not a bash master by any measure, but I do want to continue learning it. Arrays seems somewhat annoying in Bash. I will likely learn python to deal with more complex stuff I may need to do with them.

      I was going to suggest that. This would likely be easier in Python and more straightforward. If you have to stick to bash, don't declare your arrays in a looplike that, just declare them in the variables at the top

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: At Least 30,000 U.S. Organizations Newly Hacked Via Holes in Microsoft’s Exchange

      @DustinB3403 said in At Least 30,000 U.S. Organizations Newly Hacked Via Holes in Microsoft’s Exchange:

      @Dashrender Yeah so what's the math on 8 * # of Users * ∞= ????

      It gets expensive damn quick.

      He has like 90 users. So $720 a month. To hit the cost of his old phone system will take 7 years. But they never updated the old one. So if you include updates to the system then it's even further out. If you include features that are introduced to the SaaS system that you would have to pay for in the old system it's even more. It makes sense financially to pay per user for most things.

      posted in News
      stacksofplatesS
      stacksofplates
    • RE: Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty

      Is this currently working?

      You're doing a loop over the items in "$encryptedFolderPath"*.pgp and calling failArray=() and successArray() but it seems like you're doing that before you actually run the loop to decrypt them? Maybe I'm looking at this incorrectly.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: Pi-hole dumps on Fedora

      @JaredBusch said in Pi-hole dumps on Fedora:

      @stacksofplates said in Pi-hole dumps on Fedora:

      @JaredBusch said in Pi-hole dumps on Fedora:

      @stacksofplates said in Pi-hole dumps on Fedora:

      Just run it in a container and none of this matters.

      Pi-Hole's docker version was not a well done container 3 years ago when I implemented this solution. It was by no means a good idea at the time.

      Well I just meant going forward.

      That gets into different issues since Fedora went with podman. I haven't done much tinkering with it yet to see how compatible things are.

      It's a drop in replacement. It doesn't use the Docker socket so you can't use things like docker-compose, but I don't necessarily see that as a bad thing. Any normal tasks should be the same. There's people who have said they aliased podman to docker and never noticed a difference.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: Need help with Autohotkey Windows

      @Pete-S said in Need help with Autohotkey Windows:

      @stacksofplates said in Need help with Autohotkey Windows:

      So you're just switching between desktops? Win+ctrl is the shortcut for that.

      Good catch! Yes, I'm just switching between desktops. Win+ctrl is similar to Alt+Tab in the way that it presents all the Virtual Desktops you have and then you have to click around or move around with the keyboard and select the one you want. That just takes too long.

      I want to jump to any Virtual Desktop with just one key. So now I have Win+F1 for the first desktop, Win+F2 for the second, Win+F3 for the third and so on up to Win+F12.

      This is a standard thing on linux as you can just set up a keyboard shortcut for every virtual desktop you have.

      I thought I'll give it a shot with Windows built-in virtual desktop feature, but I'm not impressed. I haven't even found a way to see what virtual desktop I'm currently on.

      Ah I just got in the habit of win+ctrl and an arrow. Like ctrl+arrow on mac.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: Pi-hole dumps on Fedora

      @JaredBusch said in Pi-hole dumps on Fedora:

      @stacksofplates said in Pi-hole dumps on Fedora:

      Just run it in a container and none of this matters.

      Pi-Hole's docker version was not a well done container 3 years ago when I implemented this solution. It was by no means a good idea at the time.

      Well I just meant going forward. It sounded harsh, I didn't mean it to sound that way. You could just tell the container to use the existing directories and not have to worry about anything.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: Need help with Autohotkey Windows

      So you're just switching between desktops? Win+ctrl is the shortcut for that.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: Pi-hole dumps on Fedora

      Just run it in a container and none of this matters.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: Tactical RMM

      @scottalanmiller said in Tactical RMM:

      @scottalanmiller said in Tactical RMM:

      Sounds like someone copying SodiumSuite now that the project is on ice. It's the logical approach.

      I swear when we first looked at this, that they were using Salt under the hood. At some point they moved to a Go agent that they built themselves. Which I think makes sense, we felt that the same approach would be necessary give limitations in using the Salt agent. Seems like a lot of work is getting done on this.

      Looking through the commit history, they've always used/still use the SaltStack APIs but the agent used to be Python. It switched to Go in October.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: I need this script to email the log it generates

      @Pete-S said in I need this script to email the log it generates:

      OK, I understand. Thanks.

      Also, I wasn't trying to be abrasive. I kind of worded that strongly. I just don't like Bash much. I find it annoying, so I'd rather use something else unless it's a really simple thing.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: I need this script to email the log it generates

      @Pete-S said in I need this script to email the log it generates:

      @stacksofplates said in I need this script to email the log it generates:

      @Pete-S said in I need this script to email the log it generates:

      @stacksofplates said in I need this script to email the log it generates:

      @JaredBusch said in I need this script to email the log it generates:

      @stacksofplates said in I need this script to email the log it generates:

      Another plus for an API is that snmp is commonly blocked from providers and only enabled with some kind of request.

      Also if you want to integrate any other notification (text, telegram notification, slack, etc) it would be trivial to add with this approach.

      Not saying API is the best way, but it definitely has advantages.

      I have not had time to look at what you posted yet but I plan on it thank you

      Yeah no problem. It's really simple so it could be optimized quite a bit with maybe like 30 mins of work.

      Wouldn't just using curl do the job equally well of sending the message to mailgun?

      Yep. If you really like handling errors and responses in shell scripting it's fine. Unless you use it on Windows where cURL is not really cURL.

      I'm not doing raw API calls with the example above. That's using their Go package which simplifies a lot of the API information.

      OK, I understand. Thanks.

      How is it with the maintenance with APIs like this? I mean when you compile something and have to support it over time, it's just like being a package maintainer. If they change the API or their Go package or perhaps OS or Go version, you'd have to recompile and redistribute it to every machine. Or is this something that would only happen very seldom like every two years or something like that?

      I haven't seen it happen much where they would break the API often. If they were to do a big API change like that you'd likely have a good bit of notice. The packages for Go are versioned in the modules, so you can pin them to limit changes.

      Looks like Mailgun is currently on /v3 of their API but some endpoints still use /v1 or /v2. The package would handle that for you since it's maintained by them.

      One more advantage specifically with Go, is that you can containerize this easily. This could be done in a scratch container which has 0 dependencies. Then you could just run this with Docker/podman/whatever and easily keep the container up to date across all of your systems. I'm sure Jared wouldn't be doing that here, just a side note.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: I need this script to email the log it generates

      @Pete-S said in I need this script to email the log it generates:

      @stacksofplates said in I need this script to email the log it generates:

      @JaredBusch said in I need this script to email the log it generates:

      @stacksofplates said in I need this script to email the log it generates:

      Another plus for an API is that snmp is commonly blocked from providers and only enabled with some kind of request.

      Also if you want to integrate any other notification (text, telegram notification, slack, etc) it would be trivial to add with this approach.

      Not saying API is the best way, but it definitely has advantages.

      I have not had time to look at what you posted yet but I plan on it thank you

      Yeah no problem. It's really simple so it could be optimized quite a bit with maybe like 30 mins of work.

      Wouldn't just using curl do the job equally well of sending the message to mailgun?

      Yep. If you really like handling errors and responses in shell scripting it's fine. Unless you use it on Windows where cURL is not really cURL.

      I'm not doing raw API calls with the example above. That's using their Go package which simplifies a lot of the API information.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: I need this script to email the log it generates

      @JaredBusch said in I need this script to email the log it generates:

      @stacksofplates said in I need this script to email the log it generates:

      Another plus for an API is that snmp is commonly blocked from providers and only enabled with some kind of request.

      Also if you want to integrate any other notification (text, telegram notification, slack, etc) it would be trivial to add with this approach.

      Not saying API is the best way, but it definitely has advantages.

      I have not had time to look at what you posted yet but I plan on it thank you

      Yeah no problem. It's really simple so it could be optimized quite a bit with maybe like 30 mins of work.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: I need this script to email the log it generates

      Another plus for an API is that snmp is commonly blocked from providers and only enabled with some kind of request.

      Also if you want to integrate any other notification (text, telegram notification, slack, etc) it would be trivial to add with this approach.

      Not saying API is the best way, but it definitely has advantages.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: I need this script to email the log it generates

      @Pete-S said in I need this script to email the log it generates:

      @stacksofplates said in I need this script to email the log it generates:

      you could use mailgun. I just wrote this tiny app that will send the contents of a file.

      I lazily take the first argument as the file with the contents you want to send. Just have env vars for the recipient address, your api key and domain (or hard code them). You could take flags and whatever, but this was free and I'm lazy.

      There is one problem with the api approach I think.
      I believe tht if you use postfix to deliver the message over SMTP it will put the message in postfix' queue. So if for some reason the mail can't be delivered at that particular time, for instance because the firewall is being rebooted or there is a problem with the mailservice, it will try again later. Using the API you will just a timeout error and that was it.

      I'm not a mailgun user but I assume they have a SMTP relay as well?

      In any case since we like zoho, I intend to try the new Zoho TransMail service. They only send transactional mail, not marketing, and I think it was $2.5 or something like that per 10K emails. They have both api and SMTP.

      That's no different than postfix. It would be pretty trivial to add a retry block for a timeout condition. Postfix has it built in, you'd need the 5 lines of code here or whatever would be needed. And this will work on literally any system that the binary can be compiled for:

      • aix
      • android
      • darwin
      • dragonfly
      • freebsd
      • hurd
      • illumos
      • js
      • linux
      • nacl
      • netbsd
      • openbsd
      • plan9
      • solaris
      • windows
      • zos
      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: I need this script to email the log it generates

      you could use mailgun. I just wrote this tiny app that will send the contents of a file.

      package main
      
      import (
      	"context"
      	"fmt"
      	"github.com/mailgun/mailgun-go/v3"
      	"io/ioutil"
      	"os"
      	"time"
      )
      
      func main() {
      	mg := mailgun.NewMailgun(os.Getenv("DOMAIN"), os.Getenv("API_KEY"))
      	data, err := ioutil.ReadFile(os.Args[1])
      	if err != nil {
      		fmt.Println(err)
      	}
      	m := mg.NewMessage(
      		"[email protected]",
      		"Test Log",
      		string(data),
      		os.Getenv("SEND_ADDRESS"),
                      )
      
      	ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
      	defer cancel()
      
      	_, id, err := mg.Send(ctx, m)
      	if err != nil {
      		fmt.Println(err)
      	}
      	fmt.Println(id)
      }
      

      I lazily take the first argument as the file with the contents you want to send. Just have env vars for the recipient address, your api key and domain (or hard code them). You could take flags and whatever, but this was free and I'm lazy.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: YAML terminology and Ansible

      @marcinozga said in YAML terminology and Ansible:

      And why would you care about terminology? Do you intend on teaching Ansible? It's the end result that matters, whether your playbook or role does what you want it to do, not whether you know the terminology or not. I've been using Ansible for some years, and honestly this is the first time I run into someone mentioning "dictionary".

      I've been using it since around 1.8 and I'm not sure how you haven't heard the term dictionary.

      They reference it in the YAML basics of their docs: https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html

      posted in Training
      stacksofplatesS
      stacksofplates
    • RE: Suggest a simple free / open source Network Monitoring software.

      Prometheus works well. It has a lot of exporters for different types of data. Grafana has a lot of prebuilt dashboards for common metrics also.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: Obtaining hardware from terminated remote employee

      @Pete-S said in Obtaining hardware from terminated remote employee:

      @stacksofplates said in Obtaining hardware from terminated remote employee:

      @Pete-S said in Obtaining hardware from terminated remote employee:

      @StorageNinja said in Obtaining hardware from terminated remote employee:

      @JaredBusch said in Obtaining hardware from terminated remote employee:

      Hardware is not worth the fucking time to get back.

      If the company thinks wasting man hours on that is a good idea the company is insane

      While I largely agree, our R&D laptops are ~2-3K a pop. (fully max spec' MPB or XPS with onsite repair agreements).

      I did hear we have started on the Mac's using DEP, so the device will auto-enroll in MDM even if the device is wiped.
      https://support.apple.com/en-us/HT204142

      Makes no sense developing on a laptop IMHO - unless you're talking about another kind of R&D in another field.

      On our team we remote into development servers and all development and testing is run there. Which means the computer you're actually sitting in front of just needs to be able to run a browser, rdp, ssh etc. So any machine suitable for general office work would get the job done. So no 2-3K laptops needed for development, even if that is not the primary reason. I kind of assumed everyone worked that way but haven't actually given it much thought until now.

      I haven't really seen anyone do this other than CAD work. Everywhere I've been it's local development, possibly using Eclipse Che or Coder or something for a remote IDE but still local.

      VSCode and JetBrains tools allow you to include your development environment in a container. So when you open the project it will open inside of a container with all of the dependencies included. That's the best workflow ive seen so far.

      I believe you and find it very interesting. Wov. If that's how most people work, I'm just blown away. I assumed everyone was remote and had full on development and test environments at their disposal.

      They usually do have full dev/test environments but it's all containerized. So it's trivial to run that locally. Then when you are satisfied with local results push to your branch and have it auto build/deploy against the actual dev/test environments with something like Flux/Argo. This is still remote, GitOps is all about remote workflows.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • RE: Obtaining hardware from terminated remote employee

      @scottalanmiller said in Obtaining hardware from terminated remote employee:

      @stacksofplates said in Obtaining hardware from terminated remote employee:

      @Pete-S said in Obtaining hardware from terminated remote employee:

      @StorageNinja said in Obtaining hardware from terminated remote employee:

      @JaredBusch said in Obtaining hardware from terminated remote employee:

      Hardware is not worth the fucking time to get back.

      If the company thinks wasting man hours on that is a good idea the company is insane

      While I largely agree, our R&D laptops are ~2-3K a pop. (fully max spec' MPB or XPS with onsite repair agreements).

      I did hear we have started on the Mac's using DEP, so the device will auto-enroll in MDM even if the device is wiped.
      https://support.apple.com/en-us/HT204142

      Makes no sense developing on a laptop IMHO - unless you're talking about another kind of R&D in another field.

      On our team we remote into development servers and all development and testing is run there. Which means the computer you're actually sitting in front of just needs to be able to run a browser, rdp, ssh etc. So any machine suitable for general office work would get the job done. So no 2-3K laptops needed for development, even if that is not the primary reason. I kind of assumed everyone worked that way but haven't actually given it much thought until now.

      I haven't really seen anyone do this other than CAD work. Everywhere I've been it's local development, possibly using Eclipse Che or Coder or something for a remote IDE but still local.

      VSCode and JetBrains tools allow you to include your development environment in a container. So when you open the project it will open inside of a container with all of the dependencies included. That's the best workflow ive seen so far.

      I've seen, but never tried myself, a remote option in VSCode. I just saw it in an article the other day. Interested to try it out.

      It works really well, at least for the Go projects I work on. Everyone having the same extensions and environments is really nice.

      posted in IT Discussion
      stacksofplatesS
      stacksofplates
    • 1 / 1