Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat
here's that script, and again I apologize because I hate it. My manager kept making me bolt on functionality, and then I had a junior guy take a crack at it to help him get better bash scripting. Please don't make fun:

code:

#!/bin/bash

# Script will ssh to two servers and do an md5sum of a file and validate
# the file is the same on both nodes.
# Also takes a list of files and will validate all of them
# Written 03/28/2016 by [email]jmjf@sa.com[/email]


. /methode/$LOGNAME/.bash_profile

HELP=false
SOURCE=""
LISTFILE=""
FILENAME=""
LOCAL_MISSING=0
TARGET_MISSING=0
MDSUM_MATCH=0
MDSUM_NOT_MATCH=0
TOTAL_FILES=0
SILENT=NO
ERROR_OUTPUT=${HOME}/tmp/verify_output.txt

while getopts l:t:f:ho:s opt
do
        case $opt in
          l)LISTFILE=$OPTARG
	   sed -i 's/\r//g' $LISTFILE;;
          t)TARGET=$OPTARG;;
          f)FILENAME=$OPTARG;;
	  s)SILENT="YES";;
          h)HELP="true";;
	  o)ERROR_OUTPUT=$OPTARG
	    echo "========================
		  Beginning Comparision 
		  $(date +%d%b%Y%H%M)
		  ========================" >> $ERROR_OUTPUT
		;;
          *)echo "Invalid arg";;
        esac
done

if [ "$HELP" == "true" ]
then
        #Invoking help
        echo "Usage: verify_migration.bash -t target_server -f /full/path/to/file_to_validate [-l /full/path/to/list_file.txt [-h] [-s]
        -t target server, must be able to ssh using key exchange
        -f /path/to/file_to_validate check one file between current node and target
        -l /path/to/list_file.txt  takes a list of files or folders to validate between current node and target, optional
                one full path and file name per line please
	-s supress line by line feedback, and just print final summary
	-o output file for errors
        -h this help
        Text ouputs in $(tput setaf 1) Red for bad results  $(tput setaf 7) and  $(tput setaf 2) green for good results $(tput setaf 7)"
fi


function check_file_type {
TYPE=""
if [ -d "$line" ]
then
	TYPE="DIRECTORY"
elif [ -f "$line" ]
then
	TYPE="REGULAR_FILE"
fi
}


function validate_file {
#Check one file

FILE_TO_CHECK=$1
#SOURCE_MD5=$(md5sum ${FILE_TO_CHECK} 2> /dev/null )
SOURCE_MD5=$(md5sum ${FILE_TO_CHECK} 2> /dev/null)
TARGET_MD5=$(ssh -o LogLevel=error $LOGNAME@$TARGET "md5sum $FILE_TO_CHECK 2> /dev/null") 
OUTPUT_COLOR=2
TOTAL_FILES=$((TOTAL_FILES+1))

if [ "$SOURCE_MD5" == "" ]
then
        SOURCE_STATUS="NOT_PRESENT"
	LOCAL_MISSING=$((LOCAL_MISSING+1))
        OUTPUT_COLOR=1
	ERROR_STATUS="ERROR"
else
        SOURCE_STATUS="PRESENT"
	ERROR_STATUS="NO_ERROR"
fi

if [ "$TARGET_MD5" == "" ]
then
        TARGET_STATUS="NOT_PRESENT"
	TARGET_MISSING=$((TARGET_MISSING+1))
        OUTPUT_COLOR=1
	ERROR_STATUS="ERROR"
else
        TARGET_STATUS="PRESENT"
	ERROR_STATUS="NO_ERROR"
fi

if [ "$SOURCE_MD5" == "$TARGET_MD5" ]
then
        MD5_STATUS="MATCH"
	ERROR_STATUS="NO_ERROR"
	MDSUM_MATCH=$((MDSUM_MATCH+1))
else
        MD5_STATUS="NO_MATCH"
	MDSUM_NO_MATCH=$((MDSUM_NO_MATCH+1))
	ERROR_STATUS="ERROR"
        OUTPUT_COLOR=1
fi
if [ "$SILENT" == "NO" ]
then
	echo "$(tput setaf $OUTPUT_COLOR)$FILE_TO_CHECK is $SOURCE_STATUS locally, is $TARGET_STATUS on $TARGET, MD5 is $MD5_STATUS$(tput setaf 7)"
fi

if [ -n "$ERROR_OUTPUT" ]
then
	if [ "$ERROR_STATUS" == "ERROR" ]
	then
		echo "$FILE_TO_CHECK is $SOURCE_STATUS locally, is $TARGET_STATUS on $TARGET, MD5 is $MD5_STATUS" >> $ERROR_OUTPUT
	fi
fi

}

#START COMPARING

#Check for one file or list

if [ "$FILENAME" == "" ] && [ "$LISTFILE" == "" ]
then
	echo "You need to set a filename or a list to check"
	exit 1
fi

if [ "$FILENAME" != "" ] && [ "$LISTFILE" != "" ]
then
	echo "You can't set both a filename and a list to check, please just set one"
	exit 1
fi


#Start comparing
#first check filenames
if [ "$FILENAME" != "" ]
then
	echo "Checking single file, $FILENAME"
        validate_file $FILENAME
        exit 0
fi

if [ "$LISTFILE" != "" ]
then
	for line in $(cat $LISTFILE)
	do
		check_file_type $line
		if [ "$TYPE" == "DIRECTORY" ]
		then
			#echo "$line is a directory, lets traverse it and check it's contents"
			for item in $(ssh -o LogLevel=error $LOGNAME@$TARGET "find $line -type f -print")
			do
				validate_file $item
			done
		else
			validate_file $line 
		fi
	done < "$LISTFILE"
fi 

echo "$TOTAL_FILES total files checked"
echo "$LOCAL_MISSING files are missing locally"
echo "$TARGET_MISSING files are missing on the target node"
echo "$MDSUM_MATCH files have matching md5sums between local and target"
echo "$MDSUM_NO_MATCH files have mismatching md5sums between local and target"

exit 0

:smith:

Adbot
ADBOT LOVES YOU

vanity slug
Jul 20, 2010

Nws that poo poo

Lord Dudeguy
Sep 17, 2006
[Insert good English here]

Jeoh posted:

Nws that poo poo

Spoiler tag each word individually.

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat

Lord Dudeguy posted:

Spoiler tag each word individually.

Guess I can script that. Give me a few hours.

BOOTY-ADE
Aug 30, 2006

BIG KOOL TELLIN' Y'ALL TO KEEP IT TIGHT

assdrills.dboehner@company.com

Dick Trauma
Nov 30, 2007

God damn it, you've got to be kind.

Jerk McJerkface posted:

Google is pushing that as their business option.

What you need is Google Hangouts for Business! :v:

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

Dick Trauma posted:

What you need is GSuite by Google Cloud Hangouts! :v:

Dick Trauma
Nov 30, 2007

God damn it, you've got to be kind.

anthonypants posted:

What you need is GSuite by Google Cloud Hangouts! :v:

What you need is GSuite Pro '16 by Google Cloud Hangouts for Business!

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat
Who is worst at naming business products, Microsoft or Google?
































lol i kid it's clearly microsoft

Gunjin
Apr 27, 2004

Om nom nom

Jerk McJerkface posted:

Who is worst at naming business products, Microsoft or Google?
















lol i kid it's clearly microsoft

Our Lync hasn't been "upgraded" to Skype for Business yet so I get to frequently have drat Abbott and Costello style conversations where I go back and forth with a client about whether or not they sent the "Lync link".

DigitalMocking
Jun 8, 2010

Wine is constant proof that God loves us and loves to see us happy.
Benjamin Franklin

pixaal posted:

Skype for business :v:

gently caress you.

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat

Gunjin posted:

Our Lync hasn't been "upgraded" to Skype for Business yet so I get to frequently have drat Abbott and Costello style conversations where I go back and forth with a client about whether or not they sent the "Lync link".

Right now, the best version of lync Skype for Business to have is Slack, but soon MS is probably going to buy them and then we'll get Microsoft Cloud Chat for Business, and you'll have to put on the an Oculus Rift to navigate the subscription plan options.

Thanks Ants
May 21, 2004

#essereFerrari


I take it you haven't seen Skype Teams yet, then?

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat

Thanks Ants posted:

I take it you haven't seen Skype Teams yet, then?

:suicide:

Dick Trauma
Nov 30, 2007

God damn it, you've got to be kind.

Thanks Ants posted:

I take it you haven't seen Skype Teams yet, then?

You will need Skype Teams for Business. :cripes:

pixaal
Jan 8, 2004

All ice cream is now for all beings, no matter how many legs.


Dick Trauma posted:

You will need Skype Teams for Business. :cripes:

Why can I get Skype OS?

Gunjin
Apr 27, 2004

Om nom nom

Jerk McJerkface posted:

Right now, the best version of lync Skype for Business to have is Slack, but soon MS is probably going to buy them and then we'll get Microsoft Cloud Chat for Business, and you'll have to put on the an Oculus Rift to navigate the subscription plan options.

Oh, I'm not using Lync as an IM client (well not usually), no mostly we are using it in place of a more robust webcasting solution for smaller meetings when people balk at the price On24 charges.

Thanks Ants
May 21, 2004

#essereFerrari


Skype for Business in a video chat pointed at a whiteboard is a more reliable way to IM than the actual IM part of the product.

Mr. Fix It
Oct 26, 2000

💀ayyy💀


Jerk McJerkface posted:

here's that script, and again I apologize because I hate it. My manager kept making me bolt on functionality, and then I had a junior guy take a crack at it to help him get better bash scripting. Please don't make fun:

code:

--snip--

:smith:

:smithicide:

I totally get having to deal with crazy requests from above and sympathize :sympathy:

gallop w/a boner
Aug 16, 2002

Hell Gem
Does anyone have an environment where :

1) users work within a full-screen RDSH/XenApp/VDI desktop
2) users log into that RDSH/VDI desktop from a Windows 7/8 client
3) password expiry is enforced after X number of days.

We constantly have issues where the user resets their password on the Windows 7/8 client causing kerberos problems within the RDSH/VDI session, or alternatively resets it within their RDSH/VDI session causing problems on the Windows 7/8 session.

I have posted a Stack Overflow thread here (http://serverfault.com/questions/740584/force-user-to-change-ad-password-at-logon-before-explorer-loads) but didn't really get any suggestions beyond scripting a mass password expiry at a set time.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

We're getting another intern. 3-4 hours a day, 3 days a week.

She needs to be set up at 3 different desks because why the gently caress not.

Ugh.

pixaal
Jan 8, 2004

All ice cream is now for all beings, no matter how many legs.


Forwarding office 365 email to a gmail is pissing me off. Gmail is rejecting the emails from facebook that are being forwarded from someone's outlook. I setup a POP3 yesterday on their gmail but that marks everything as read.

They are a C-level, and everything has to be exactly how they had it. Gmail just started blocking it for whatever reason, and only the facebook emails are producing this cryptic error. Gmail is saying you as a sender are configured wrong for sending bulk email, office 365 also has an error in the email that points me to a page that claims there is currently no information about this error.

Is there a way to setup a forwarder that has exceptions? Currently this is because they do not want to add their work email to their phone. They want 1 inbox on their phone. Yes this means they need to check every email twice for it to be marked read in both places. Gmail doesn't support POP3 header only or importing from IMAP, only exporting. This is really an X Y problem but sometimes you just need to deal with the insanity and get it done. They are willing to accept bounced emails about facebook with the solution of make a shared mailbox to setup for accounts of this nature and that just feels so messy and is going to be what happens if there isn't a cleaner way to do this.

It's really pissing me off because I just want her to check her office365 email on the phone with IMAP if she's worried about the remote wipe and what if someone hacks our office 365 and remote wipes her pictures. Though it's also a "1 inbox only" solution. My suggestion of just use gmail to check work email even at work was not met with position opinion. This is a I want to keep doing things the way I have been gently caress you.

e: the actual error just incase anyone else has seen it.
Unauthenticated email from facebookmail.com is not accepted due to;domain's DMARC policy

I am almost positive the issue is on facebook's end but it's become my problem to get it to work right.

pixaal fucked around with this message at 17:01 on Oct 18, 2016

FlapYoJacks
Feb 12, 2009

Bob Morales posted:

We're getting another intern. 3-4 hours a day, 3 days a week.

She needs to be set up at 3 different desks because why the gently caress not.

Ugh.

Is she being paid?

Thanks Ants
May 21, 2004

#essereFerrari


Forwarding emails that are sent from a domain with strict DMARC policies is a bit of a nightmare.

Are you adding a disclaimer to the messages as you forward them that would cause the original DKIM signature to become invalid?

xzzy
Mar 5, 2009

People that use zip ties in racks are bad enough, but there's a special level of hell for people that zip tie loops of wires to a rack post.

"No I never considered anyone would ever want to trace a cable, why do you ask?" :downs:

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

ratbert90 posted:

Is she being paid?

Yea, all of our interns are paid.

pixaal
Jan 8, 2004

All ice cream is now for all beings, no matter how many legs.


Thanks Ants posted:

Forwarding emails that are sent from a domain with strict DMARC policies is a bit of a nightmare.

Are you adding a disclaimer to the messages as you forward them that would cause the original DKIM signature to become invalid?

Nothing is being added, but looks like facebook has their encoding wrong and office365 is "correcting" it killing the signature.

I think I have a work around, I setup a mailflow that all incoming email TO: C-LEVEL add BCC of GMAIL. That should hopefully fix it I think? Also apparently a newegg promo also did this.

I might be looking at it the wrong way, maybe she did add some disclaimer recently I'll check after she's back from lunch. It's just the stupidest work flow and it's been this way for a few years without any issues.

e: Another stupid idea if body contains https://support.google.com/mail/answer/2451690 don't deliver! This is just a problem that shouldn't exist. Any other user I could force to do it right.

pixaal fucked around with this message at 17:16 on Oct 18, 2016

The Fool
Oct 16, 2003


xzzy posted:

People that use zip ties in racks are bad enough, but there's a special level of hell for people that zip tie loops of wires to a rack post.

"No I never considered anyone would ever want to trace a cable, why do you ask?" :downs:

If this is a consistent problem, get a tone generator + wand. It'll pay for itself in a day.

Gunjin
Apr 27, 2004

Om nom nom

xzzy posted:

People that use zip ties in racks are bad enough, but there's a special level of hell for people that zip tie loops of wires to a rack post.

"No I never considered anyone would ever want to trace a cable, why do you ask?" :downs:

And it's always the same assholes who use cutters to trim the zip ties into the sharpest possible flesh rending points.

xzzy
Mar 5, 2009

When I was younger and more energetic I actually submitted a safety concern about sharp points on trimmed zip ties, hoping it would motivate a sitewide ban on using them in racks.

Nope, they just sent out an advisory that it could be a hazard and the recommendation was to wear protective gloves when working in racks. Talk about a major backfire.

Now I just grouse on the internet.

Inspector_666
Oct 7, 2003

benny with the good hair

The Fool posted:

If this is a consistent problem, get a tone generator + wand. It'll pay for itself in a day.

I remember asking some wiring guy if he had a toner wand once and he looked at me like I was crazy and had no idea what I was talking about. It was very confusing.

SyNack Sassimov
May 4, 2006

Let the robot win.
            --Captain James T. Vader


Gunjin posted:

And it's always the same assholes who use cutters to trim the zip ties into the sharpest possible flesh rending points.

Do you mean actual cutters, like the things you're supposed to use with zip ties? (I call them Xcelites but that's mostly because that's the brand I tend to have, I think the name is shear-cutters or something). Because those are amazing and if you do it right and not like a moron you actually leave no sharp points sticking up from the zip tie head at all. Of course if you're sloppy and don't take the extra half second to make sure the cutter blades are flush to the zip tie head then yeah, you leave points, and should also be killed by slow neck cutting with those points. And anyone who uses scissors on zip ties can loving die in a fire.

22 Eargesplitten
Oct 10, 2010



I used those angled snips for the first time yesterday, they are loving amazing and I want a pair for whenever I have to use zip ties in the future.

pixaal
Jan 8, 2004

All ice cream is now for all beings, no matter how many legs.


Just got a call from another site about a user being let go and locking themselves in their office to kill everything. Maybe now I will get early notice to terminate accounts. I also need to audit all the stuff they have access to now. Please give me a heads up holy poo poo. Quickly send remote shutdown, disable account, kill access in software kill email. I shouldn't have needed a remote shutdown if I had time to you know expire the account at the exact time they wanted.

Who am I kidding nothing is going to change. Police escort out of the building will be funny to hear about at least.

xzzy
Mar 5, 2009

Sounds like a pretty toxic environment if people getting terminated and attempting to sabotage the company is a common occurrence. :stare:

pixaal
Jan 8, 2004

All ice cream is now for all beings, no matter how many legs.


xzzy posted:

Sounds like a pretty toxic environment if people getting terminated and attempting to sabotage the company is a common occurrence. :stare:

It's not, it's the first time it's ever happened. But this is kind of why you let IT know before you let someone go. I have brought up that I want to know ahead of time and not 2 weeks later for exactly this reason.

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat

pixaal posted:

Just got a call from another site about a user being let go and locking themselves in their office to kill everything.

Is this a theoretical or did it happen?

When I worked for a hedgefund, they'd have me onsite, and they'd call people into a meeting and during the meeting I'd disable their account, and once I confirmed they'd fire them and have them escorted out. You wouldn't even be allowed to go to back to your desk.

Imagine being fired on the spot, and you can't even go to your desk to gather personal effects. They'd allow the person back in later, once the office was empty besides me and their compliance officer, and they could stand by the desk while pointing at things they wanted to take, and we'd have to look through it to make sure it was theirs and not hiding anything.

It was the least favorite thing I had to do. It was awful.

Bigass Moth
Mar 6, 2004

I joined the #RXT REVOLUTION.
:boom:
he knows...
That happens in a lot of places when mass layoffs roll out. You get fired and they have your stuff waiting at the security desk.

Thanks Ants
May 21, 2004

#essereFerrari


Did people start to associate you being in the office with an impending poo poo-canning?

Adbot
ADBOT LOVES YOU

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat

Thanks Ants posted:

Did people start to associate you being in the office with an impending poo poo-canning?

Nah, I was on the floor all day, so it wasn't anything special. I'd know I was going to fire someone that day, but just not who.

Another anecdote. At my last job I realized pretty quick I was there to replace a guy that was pretty useless and on his way out.

One day, I get to the office at 8am, and at 8:10, two clients call in with emergency issues, so I'm jumping back and forth, since I'm the only one in the office. This guy arrives, and I'm like "Great, Chris can you grab line 2, X client is having a critical issue and I'm on with Y client."

He said "No, I'm not. I just walked in, let me get settled and have my coffee. Listen, JMJF, I know you are new and want to impress everyone, but you don't need to scramble everytime a client calls with a critical problem. Just chill out. Mark (the manager) talks a lot, but you don't have to kill yourself answering calls.

I responded "Uh...yeah, it's 100% our job to answer these calls, what is your problem?"

He eye rolls and walks away and I handle both clients.

Later that day I got called into a meeting with manager and director.

"Hey JMJF, do you have the password to systems X Y and Z?"

"No, I don't, I think Chris set them up, he kept the passwords, and hasn't shared them. Want me to ask him to share them?"

"No, JMJF please don't ask Chris for anything right now, it's fine."

"Uh...lol sounds like you guys about to fire."

"Go back to your desk and don't talk to Chris."


I go back to my desk, and Chris, who sits next to me, is on the phone with his wife and a car dealer. "Hey JMJF, I'm about to buy a new car, what do you think about the Infiniti QX whatever?"

"Uh...I suggest you sleep on it."

"Nah, it's fine, I deserve a new car"

"Uh....hmmm....well"

He was fired five seconds later.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply