ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Topics
    2. wirestyle22
    3. Posts
    • Profile
    • Following 0
    • Followers 2
    • Topics 179
    • Posts 8,185
    • 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

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

      Rather than mess with multiple arrays, you can just have a single dictionary that holds the file and status. A single function can decrypt the file. Then just save the file name and status of the decryption in that dictionary. Then loop through the dictionary and here I just print the data, but you could email it or send to Slack or whatever.

      This was a quick pass so probably can be cleaned up a bit.

      My reasoning behind two arrays was to keep it organized. If I do all successes in one and then all failures in the other. So I have this now:

      #!/usr/bin/env bash
      source "/home/user1/subdirectory1/master.sh"
      decryptedFolderPath="/home/user2/subdirectory2/"
      archiveFolderPath="/home/user1/subdirectory1/archive/in/"
      extension=${fileName##*\.}
      newFileName=${fileName%.*}
      fileWithoutTimestamp="$newFileName.$extension"
      encryptedItems=$(ls encryptedFolderPath*.pgp)
      statusArray=()                                   
      
      for i in $encryptedItems
      do
      gpg --batch --homedir /home/user1/.gnupg/ --passphrase "$PASS" --list-only --list-packets --yes --decrypt "$i" | grep -q "encrypted" > "$decryptedFolderPath"/"$fileWithoutTimestamp"
      outPut=$(gpg --batch --homedir /home/user1/.gnupg/ --passphrase "$PASS" --list-only --list-packets --yes "$i" | grep -q "encrypted")
      
      if [ $? != 0 ]; then
      echo "$i is not a pgp file"
      statusArray+=("failed to decrypt $i, with status code $? output from pgp: $outPut")
      fi
      
      if [ $? == 0 ]; then
      statusArray+=("Succesfully Decrypted $i")
      echo ${#statusArray[@]} | mail -s 'report' [email protected]
      v=${i%.*}
      encryptedFile="$v"
      fileName=${encryptedFile##*/}
      @@ -27,4 +34,4 @@ continue
      fi
      done
      
      mv "$i" "$archiveFolderPath"
      

      I think this is what you meant, right?

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty

      @stacksofplates Thanks for your help

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty

      @stacksofplates Thanks. That will help as a reference for later but I did want to figure out how to do this in bash as well. It's just kind of a challenge I don't want to give up on yet.

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty

      @stacksofplates said in 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

      Alright I did that. Is there something better than ShellCheck for bash syntax checking that you know of? Do you just use bash -n script

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: 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 seem somewhat annoying in Bash. I will likely learn python to deal with more complex stuff I may need to do with them.

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty

      @stacksofplates said in 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.

      failArray=() and successArray=() are just creating empty arrays I can put data into

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty

      @stacksofplates No it's not. I'm just figuring out the syntax of it.

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty

      I wrote a script that decrypts files in a specific directory with a .pgp file extension and then takes the decrypted file and puts it into a specific directory. It also takes the original file in its encrypted form and moves it into an archive directory. I need to e-mail a group of people when my script runs successfully, unsuccessfully or if there are no files in the directory when the script tries to run. It's a work in progress with some arbitrary numbers, but this is what I have so far:

      #!/usr/bin/env bash
      source "/home/user1/subdirectory1/master.sh"
      fileCheck=$(ls $decryptedFolderPath | wc -l)
      decryptedFolderPath="/home/user2/subdirectory2/"
      archiveFolderPath="/home/user1/subdirectory1/archive/in/"
      arrVar=(${#failArray[@]} ${#successArray[@]})
      extension=${fileName##*\.}
      newFileName=${fileName%.*}
      fileWithoutTimestamp="$newFileName.$extension"
      encryptedItems=$(ls encryptedFolderPath*.pgp)
      failArray=()                                   
      successArray=()
      
      fileCheck=$(ls $decryptedFolderPath | wc -l)
      if [ $fileCheck -eq  0 ]; then
      mail -s 'File Check' [email protected] <<< 'No files detected in x directory'
      exit 0
      fi
      
      for i in $encryptedItems
      do
      gpg --batch --homedir /home/user1/.gnupg/ --passphrase "$PASS" --list-only --list-packets --yes --decrypt "$i" | grep -q "encrypted" > "$decryptedFolderPath"/"$fileWithoutTimestamp"
      outPut=$(gpg --batch --homedir /home/user1/.gnupg/ --passphrase "$PASS" --list-only --list-packets --yes "$i" | grep -q "encrypted")
      
      if [ $? != 0 ]; then
      echo "$i is not a pgp file"
      failArray+=("Failed to decrypt $i, with status code $? output from pgp: $outPut")
      else 
      echo ls -A decryptedFolderPath | mail -s 'File Check' [email protected] <<< 'No new files have been detected'
      fi
      
      if [ $? == 0 ]; then
      successArray+=("Succesfully Decrypted $i")
      echo ${#arrVar[@]} | mail -s 'message subject' [email protected]
      v=${i%.*}
      encryptedFile="$v"
      fileName=${encryptedFile##*/}
      @@ -27,4 +34,4 @@ continue
      fi
      done
      
      mv "$i" "$archiveFolderPath"
      

      One of the things I'm going to include is when there are no files to decrypt. I'd appreciate some advice from some of you that are more experienced with bash. Is there a better way to do this in bash or am I on the right track? @stacksofplates

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: What are you listening to? What would you recommend?

      Maylene & The Sons Of Disaster

      Youtube Video

      posted in Water Closet
      wirestyle22W
      wirestyle22
    • RE: Ipad guru for Site connectivity issue

      @WrCombs said in Ipad guru/ Site connectivity issue:

      @wirestyle22 said in Ipad guru/ Site connectivity issue:

      @WrCombs said in Ipad guru/ Site connectivity issue:

      @scottalanmiller said in Ipad guru/ Site connectivity issue:

      @Dashrender said in Ipad guru/ Site connectivity issue:

      @scottalanmiller said in Ipad guru/ Site connectivity issue:

      @WrCombs said in Ipad guru/ Site connectivity issue:

      then told me that it wasn't the network cause he has a Cellular backup in place and it has never once turned on so me saying it's a network issue is "utter bullshit and just an excuse"

      This is the spot where he is sabotaging. He knows that he made this up and has no idea what he's saying. Knowing that, he decided to say it anyway. That's what makes it sabotage, he's deciding to throw a monkey wrench in the troubleshooting process for whatever reason.

      I have no clue what you are talking about here? he "knows" that the cellular option hasn't been used - now why he 'thinks' this has anything to do with anything at all - that's the real question...

      He knows he doesn't know what a network is. The rest is him just making shit up to derail Will or try to sabotage something.

      Derail me into thinking that I have to take Ownership of the problem, yes I will agree. Not that I think he would actually try to sabotage the troubleshooting process on purpose, could he be doing so without the knowledge by showing willful ignorance, absolutely. So I can kind of see it, but at the same time it doesn't make sense the he would purposely continue to lose money.

      I highly doubt that is his motivation, but Scott is ignoring his intent and focusing on his actions. People get emotional. They do and say things they don't mean out of stress. It's just a part of working for someone who isn't in control of their emotions. The best way to handle people like this is to ignore everything they say, diagnose the problem, fix it and if they don't believe how you fixed it you treat them like a flatearther

      Just agree and both be wrong so they feel better about themselves?

      You don't need to agree. You tell them x, they say they believe y. You can say I've been completely honest with you, but if you want to believe y that is your perogative. end conversation. its not your job to convince him of anything, its only your job to fix issues. who cares what he believes

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: Ipad guru for Site connectivity issue

      @WrCombs said in Ipad guru/ Site connectivity issue:

      @scottalanmiller said in Ipad guru/ Site connectivity issue:

      @Dashrender said in Ipad guru/ Site connectivity issue:

      @scottalanmiller said in Ipad guru/ Site connectivity issue:

      @WrCombs said in Ipad guru/ Site connectivity issue:

      then told me that it wasn't the network cause he has a Cellular backup in place and it has never once turned on so me saying it's a network issue is "utter bullshit and just an excuse"

      This is the spot where he is sabotaging. He knows that he made this up and has no idea what he's saying. Knowing that, he decided to say it anyway. That's what makes it sabotage, he's deciding to throw a monkey wrench in the troubleshooting process for whatever reason.

      I have no clue what you are talking about here? he "knows" that the cellular option hasn't been used - now why he 'thinks' this has anything to do with anything at all - that's the real question...

      He knows he doesn't know what a network is. The rest is him just making shit up to derail Will or try to sabotage something.

      Derail me into thinking that I have to take Ownership of the problem, yes I will agree. Not that I think he would actually try to sabotage the troubleshooting process on purpose, could he be doing so without the knowledge by showing willful ignorance, absolutely. So I can kind of see it, but at the same time it doesn't make sense the he would purposely continue to lose money.

      I highly doubt that is his motivation, but Scott is ignoring his intent and focusing on his actions. People get emotional. They do and say things they don't mean out of stress. It's just a part of working for someone who isn't in control of their emotions. The best way to handle people like this is to ignore everything they say, diagnose the problem, fix it and if they don't believe how you fixed it you treat them like a flatearther

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: Ipad guru for Site connectivity issue

      @scottalanmiller said in Ipad guru/ Site connectivity issue:

      @WrCombs said in Ipad guru/ Site connectivity issue:

      some random bit of information unrelated because I can't log in.
      But the owner was calling and texting me and my team because our "System is complete shit" and some other unpleasant things , then told me that it wasn't the network cause he has a Cellular backup in place and it has never once turned on so me saying it's a network issue is "utter bullshit and just an excuse"
      Good to know that other people think the same thing.

      So he just made crap up and doesn't know what a network is.

      Sure, but he's also @WrCombs customer. I think it's a valuable experience to work for someone who is unreasonable actually. It's not up to him to know what it is or how to fix it or to even be reasonable. Trying to get him to understand is a mistake. Just accept the situation for what it is and try to resolve the problem to the best of your ability. That is the only thing you can do. Take it from personal experience that trying to understand a customer and trying to get the customer to understand you is completely futile. Connection is a two-way street.

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: What Are You Doing Right Now

      @scottalanmiller said in What Are You Doing Right Now:

      @wirestyle22 said in What Are You Doing Right Now:

      to be honest I'm an old grump curmudgeon like @Dashrender

      We know, lol.

      😄

      posted in Water Closet
      wirestyle22W
      wirestyle22
    • RE: Ipad guru for Site connectivity issue

      @WrCombs what is the sq footage of the building and how many employees are in the building at the same time?

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: What Are You Doing Right Now

      @WrCombs said in What Are You Doing Right Now:

      @Dashrender said in What Are You Doing Right Now:

      @WrCombs said in What Are You Doing Right Now:

      is it just me or does the use of emoji's in professional emails annoy anyone else ?

      Dude - I detest emoji's almost ANYWHERE!

      😉

      Well, I mean, in a text message that's fine. but in a professional email where everyone is talking about issues, you're using emojis, I will never take you seriously as a professional.

      to be honest I'm an old grump curmudgeon like @Dashrender on this. I don't like emoji's at all

      posted in Water Closet
      wirestyle22W
      wirestyle22
    • RE: What Are You Doing Right Now

      @WrCombs It definitely makes me think I'm talking to a teenager sometimes

      posted in Water Closet
      wirestyle22W
      wirestyle22
    • RE: Ipad guru for Site connectivity issue

      @DustinB3403 said in Ipad guru/ Site connectivity issue:

      @wirestyle22 said in Ipad guru/ Site connectivity issue:

      @scottalanmiller Can't you rate limit the guest network and use QoS to mitigate at least a portion of this?

      I don't see any options to limit the wireless performance, you can limit the bit rate (for high density environments) but that could cause other issues with other devices.

      As for QoS, that doesn't fix the issue of devices being dropped from the network.

      wouldn't packet loss be the cause of devices being dropped? I'd think QoS would at least stop the businesses devices from being dropped, no?

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: Ipad guru for Site connectivity issue

      @scottalanmiller Can't you rate limit the guest network and use QoS to mitigate at least a portion of this?

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • RE: Ipad guru for Site connectivity issue

      @notverypunny said in Ipad guru/ Site connectivity issue:

      @wirestyle22 said in Ipad guru/ Site connectivity issue:

      @travisdh1 said in Ipad guru/ Site connectivity issue:

      @Dashrender said in Ipad guru/ Site connectivity issue:

      @scottalanmiller said in Ipad guru/ Site connectivity issue:

      If the issue is from a volume of devices, it's not the devices that are the issue. This isn't related to them using iPads, other than they are using lots of devices on wifi all at once. It's not an iPad issue, but a wifi/network issue.

      Too much power, overlapping APs, too many APs, all kinds of things can cause issues. Or too few, bad signal, etc.

      I thought I read he had 18 iPads, but I don't see that here anymore... that doesn't seem like to many, even for a single AP...

      Keep in mind that there are probably gobs of patrons using a guest network on those same APs. It really could be an issue of to many devices using a single AP if they are busy.

      I was just about to write this

      Ditto.... It's all well and good having separate SSID's and networks behind the AP to isolate traffic, but the radios in the HW might just be getting thrashed if it's busy and patrons are monopolizing the infrastructure. Keep in mind that for a restauant setting each patron is likely to have at least 1 device connecting to wifi, perhaps more if someone is working on a laptop and having a bite at the same time.

      No I mean separate networks not just SSID's

      posted in IT Discussion
      wirestyle22W
      wirestyle22
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 409
    • 410
    • 4 / 410