Tuesday, June 4, 2013

Team Unity

There was an issue at work one day were people were ratting on each other and snapping at one another.  I pulled out some things I learned over the years to share with that team.  I hope they felt empowered and accountable for building the team.

  • Solve issues within the team.  Involve management as little as possible.
  • Talk to someone if something is bothering you.  Don't internalize it and start snapping at your coworkers.  Once the damage is done it is hard to repair.  This takes courage but you will feel better for having done it.
  • If you have made mistakes apologize for them.  It helps to heal the damage you have done.
  • Rats are vermin that spread disease.  Don't be a rat or you will most likely find yourself avoided by your team.
  • Reputations proceed people.  Make sure yours is a good one.
  • Present as a unified team.  Come up with recommendations as a team and present them.  If everyone goes and give there opinions on how something should be done it makes it harder for the decision maker to make a good decision.  There are always many ways to do the same thing in the IT world and the fewer the choices the easier it is to decide and get working.
  • United we stand divided we fall in the corporate world means everyone must act professional.  Teams that get along are more productive and makes the grind more enjoyable.  When there is a negative atmosphere people tend to leave the company and then the few are left with much responsibility. 

Friday, May 31, 2013

DNSCMD Examples

Any of these commands can be combined and put in batch file or run separately.  Take note that they need to be run in a certain order if setting up from scratch.  The order would be zones and then records in the zone.  Note the parameter flags are case sensitive (ZoneAdd not zoneadd).

Records can be deleted instead of added by replacing Add with Delete, example /ZoneDelete

Add a zone:

dnscmd /ZoneAdd rasky.com /DSPrimary /DP /forest

Add an A record:

dnscmd /RecordAdd rasky.com test A 10.200.122.139
dnscmd /RecordAdd rasky.com @ A 10.200.122.140 (parent record)

Add a CNAME (alias):

dnscmd /RecordAdd rasky.com aliasname CNAME realname.rasky.com

Sunday, April 21, 2013

If You Want to be a Good Manager

In my life as a corporate worker I have noticed some bad habits from different managers.  For those who want to be good managers and lead their teams to success you should avoid doing things on this list.

Encourage not Discourage

We had a guy who rarely stepped out of his comfort zone.  If there were any decisions to be made he would ask someone else to make them for him.  One day he surprised us all and made a decision and moved forward with the work.  If decisions cannot be made work stops and you have idle unproductive people staring at their screens.  I told him good job for doing so and keep it up.  Sometime later the same day our manager dinged him for making that decision.  He was upset by this and told me so.  I told him not to worry about it but the damage was done.  What little confidence he had gained earlier in the day was gone (and so was any future productivity gains).  Was the decision right or wrong?  It doesn't matter. 

Trust Me

I was in a meeting with my manager and relayed some feedback to him the team had come to me with.  My manager asked me who said it.  I said I wasn't going to tell him because it wasn't relevant.  He again asked me.  I stood my ground.  Boy was that uncomfortable.  If you want trust and respect you just don't do those things to your employees.  I always scold my kids for snitching on each other.  It breeds distrust and a hostile work environment.

Lying

Ever sit in a meeting and listen to management out right lie to their management.  Whether it is dates on a project or the quality of their software I have heard it all.  I don't know what compels them to do so.  Wouldn't it be best for the company to be forthright and honest.  Even if your boss gets upset at least you can then work together to set things right.  If your going to be late on a project isn't it best to find that out early and work to mitigate things and make sure it still succeeds.  Why wait until the end and ask for more time.  It makes you look bad, brings the morale down of the team and just doesn't make any sense.

Yelling

I once heard a quote that cowards yell the loudest.  I have heard many a manager yell at other managers.  Even had a boss once tell me why she was crying that he was throwing chairs around a room why he yelled at the managers.  Another time another manager was yelling and my coworker said he heard it in the meeting room next door.  Regardless in a workplace we should all be acting like adults and speaking civilly.  Sure you might be upset and need to let some steam out.  Just do it in the gym or outside.  When your coworkers hear you it again lowers morale and you lose respect.  Who wants to work for a guy that might yell at you if you make a mistake.

Take responsibility for your actions and treat others with respect.  That is how you will build a strong team and be a successful manager.

Work Life Balance

When your resource has been up working until 5 AM on an deploy or issue tell him to take the next day off before he logs off.  Don't wait until he gets up the next morning to get to work on time.

Saturday, April 6, 2013

Rasky's Quotes

Some quotes I have come up with over the years.


  • I don't want to be a fireman anymore.  I want to be Smokey the Bear (regarding working in the IT industry.)
  • By accepting the faults in others you learn to accept your own faults.
  • Don't just people on yesterday.  Instead inspire them on what they could be tomorrow.
  • Happiness isn't dictated by circumstance but by attitude.
  • My calling in life is to help the Earth and its people.  Next?
  • A technology company doesn't outsource it's technology.  It embraces every facet of it.  This opportunity is then given to it's employees.
  • Every task every day matters.  You just have to keep the right mindset.  Everything you do everyday should tie back to your career goals
  • Every mother is an artist. Her children the canvas.
  • A leader does not turn around a failing company by going to meetings.  A leader is on the floor driving the change he or she wants to see.
  • Less Meetings, more doing.  That is my home depot (repo).
  • It is easy to offer criticism but more rewarding to understand (not sure if this has been said before by another person)

Friday, March 29, 2013

Configuring Network Connections in Windows 2008R2

A project I have been working on required us to add another NIC to all of our servers.  We didn't want production traffic accidentally being routed over that subnet.  Below are the steps we took on the servers to prevent it.


  • Hit the Windows+R keys simultaneously
  • Type control netconnections and then click OK
  • Right Click on the connection you don't want traffic to go over and select Properties.
  • Uncheck all item except for Internet Protocol Version 4 (TCP/IPv4).

  • Right click on IPv4 and select Properties and set a static IP address for the new subnet.  In the picture below the IP is just an example (shouldn't use .1 as that is normally for your gateway)
  • Click on Advanced and select the DNS tab.  Uncheck Register this connection's addresses in DNS.  Click on OK and OK to save the changes
  • Right click on the connection we just changed and select Rename
  • Pick a descriptive name for this connection
  • While in the Network Connections Window hit the Alt key.  You should see a hidden menu pop up at the top.  Click on Advanced à Advanced Settings
  • Change the connection you renamed to be below the other connections.
  • Click on OK to save the changes.
  • Next we want to make sure another default gateway wasn't created when the NIC was added.  Open up a command prompt and type in route print
  • If there are more than one default gateways (0.0.0.0) and one of them is the new subnet you will need to remove it.
  • route DELETE 0.0.0.0 255.255.255.0 10.10.10.1 servername



Wednesday, March 20, 2013

Finding URLs in Text Files with PowerShell

Allot of our connection string information is stored in our web.config files.  For a project I am working on I was asked to create a list of all of these.  This will help us determine what third parties we interface with so a new firewall can be setup accurately.  Below is the PowerShell script I came up with the help of others posts on the web.  I haven't gotten the syntax highlighter working yet on my blog but hopefully soon (I will come back and edit this post).

########################################################### 
# AUTHOR  : Mark Rainey  
# DATE    : 2013-03-13  
# COMMENT : Reads in a list of servers and searches
# the E:\Live folder for config files.  When it finds
# them it searches for anything starting with 3 or more
# letters (tcp or http) followed by a colon and \\
###########################################################

#ERROR REPORTING ALL
Set-StrictMode -Version latest

$scriptpath = Split-Path -parent $MyInvocation.MyCommand.Definition
# A friend at work helped me get this to output to Excel
$outputFile = $scriptpath + "\output.xls"
# This is a file with a FQDN of each server on a new line
$serverList = $scriptpath + "\serverlist.txt"
# Load server list
$servers = Get-Content $serverList
# Hash of all results from all files
$Results=@{}

# Find the string and save it to a file
Function getStringMatch
{
 Try { 
  # Loop through all servers
  Foreach ($server In $servers) {
      # Set UNC Path to files for this server
   #The path can be anywhere on your servers you want to search
   $path     = "\\$server\c$\temp\test\"
   #Get list of files
   $files    = Get-Childitem $path *.config -Recurse | Where-Object { !($_.psiscontainer) }
   # Loop through the server and search all config files under E:\Live
      $matches = New-Object System.Collections.ArrayList
   $matches.clear()
   Foreach ($file In $files)
      {
    $fullFileName = $file.FullName 
    # regular expression for a URL format
    $regex = '([a-zA-Z]{3,})://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)*?'
                # Find all matches in current file and add the Value for each one to an array
    select-string -Path $fullFileName -Pattern $regex -AllMatches | % { $_.Matches } | % {
     $matches.add($_.Value)
    }
      } 
   # Remove duplicates
            $matches = $matches | select -Unique 
   # Add the array for this server to the Results hash
   $Results.Add($server,$matches)
  }
  
  #export to Excel workbook
  $excel = New-Object -comobject Excel.Application
  $excel.Visible = $True
  $workbook = $excel.Workbooks.Add()
  $ws = $workbook.Worksheets.Item(1)
  $column = 1

  foreach ($Result in $Results.GetEnumerator()){
   $row = 1
   $ws.Cells.Item($row,$column) = $Result.Key; 
   $row++
   if ($Result.Value -ne $null){
    if ($Result.Value.Count -gt 1){
     for ($i=0; $i -le $Result.Value.Count; $i++ ) {
      $ws.Cells.Item($row,$column) = $Result.Value[$i]
      $row++
     }
    }
    else {
     $ws.Cells.Item($row,$column) = $Result.Value
    }
   }
   $column++
  }
  $workbook.SaveAs($outputFile)
  
  Release-Ref $ws
  Release-Ref $workbook
  $excel.Quit()
  Release-Ref $excel
 }
    Catch [System.Management.Automation.ActionPreferenceStopException]{
  Write-host "$output is locked see error:`n $_"
 } 
 Catch {
  Write-host "Something failed $_"
 }
 Finally {
  "Finished"
 }
}

# Release Reference used in Office coms
Function Release-Ref ($ref) {
 [System.Runtime.InteropServices.Marshal]::ReleaseComObject($ref)
 [System.GC]::Collect() 
 [System.GC]::WaitForPendingFinalizers()
}
 
getStringMatch

Tuesday, March 12, 2013

BuildMaster, Tool or Person?


BuildMaster, Tool or Person?

BuildMaster

What is it?

Well there is such a thing at companies and there is a book by a similar name.  However what I am referring to is a tool called BuildMaster that is developed by Inedo in Berea, Ohio.

Why use it?

Tools are made for a reason.  They make life simpler.  My computer is a tool.  My car is a tool.  BuildMaster was able to take a manual task that 2 guys had to do and reduce the time by 75% and reduce errors by almost 100%.  So unlike my car which only looses value this tool paid for itself in 1 year.

My Interview

I did an interview of my experiences with the tool and the company.  They have it posted as one of their case studies.  Here it is.  I had a good time chatting with them and hope that people considering it get something useful out of it.