sunnuntai 2. marraskuuta 2014

WARNING: OsX Yosemite patch might brick your macbook! / Updated with a fix

Ouch!
Okay. A quick warning to all you mac people! As the title states the new Yosemite patch might break your mac! I have already had several customers call and let me know that their mac is stuck updating OsX to he latest release of Yosemite.


In this article the issue is being discussed a bit more in detail.
Here is a small list of things to try out. These did not work with my clients but maybe they might help you!

  1. WAIT. Yes wait. In some cases it has been reported in internet that albeit slow, the update is actually happening. So being patient might be the best first choice.
  2. Press command + L to bring up the Install log. If the log  is moving. WAIT. Although desperately slow, it's still updating and not stuck as the progress bar might let you think.

  3. Safe boot. If the update has not finished after several hours (one of my customers let his Macbook sit at their office for 48h and the update was still stuck at halfway.)
    Reboot the machine and press down Shift-key. This should boot your computer in safe-mode. It might take time, so sit tight.. On one of the machines I was given to fix, it just kept booting straight back to the update screen. I was getting ready to re-install the machine when it suddenly popped in the login screen. So make sure to wait at least 30 minutes to give the machine time to reboot in safe-mode!
  4. Network repair. Press Command + R when rebooting. This will launch mac's online repair tool. Try it out.
  5. Re-install. Unfortunately this might be the only thing you can do. If the machine doesn't respond to any of the give commands your only way is to re-install from the dvd given with the machine. Insert it to the DVD-drive and boot while pressind letted C down.
I hope one of these helped someone.

UPDATE:

Okay!  I just finished one Macbook that was stuck in the loading screen with the Apple logo after Yosemite update. I used the command + r method. It took a couple of minutes of pressing and holding command + r but finally the diagnostics menu popped up. In there I simply turned WiFi off (yours might not be on so don't worry if its not on) and chose restart from upper left corner of the screen. After this the computer booted normally and loaded up to the system! Hope this helps!


maanantai 20. lokakuuta 2014

A short update on the state of "things"

I have been busy. Like really busy... So... I thought I might make a short update of content that I plan on posting in the future.

So lately I have been working on the script that I mentioned in my previous posts. I managed to find a sipping script from internet that doesn't require me to install third party PS-modules.

I also managed to figure out how to send email with attachments through Google's gmail so that is going to be another post.

I got a few other topics that I am working on but I will tell about them later.

Until next time; keep calm and code on....

maanantai 6. lokakuuta 2014

The most powerfull Powershell command you will ever know..... And how to use it...

Now I know most of you probably know about this and those of you who know this stuff, can just skip this post but the rest of you, please hold on for a second and keep reading.
Okay, are you ready for the shocking revelation?

help *


Yup, that is it. Just plain good old get-help module shortened to just help *.

I think that no matter how skilled you are with any kind of code you should always know how to get more info in case you get stuck or just don't know how a command might react.

How to use?


The first thing I always do, before I start any major project, is update to my Powershell get-help module.
To do this type update-help. Be prepared to wait a couple of minutes though, as PS needs to contact Microsoft servers for the latest information. Don't worry if you get errors, it just means that the get-help module is up to date.

When you are done updating your help module we can finally begin exploiting it's contents.
Usually when I start doing something I try to find out all the information possible of the modules I am going to use. After all, you need to know what you can do with your tools, right?

So basically it all comes down to choosing the right search function/word.
I will for the sake of simplicity split this post in two sections; Powershell and Google.

Powershell


Get-help object works the same as other PS-modules. First comes the module and then you give it the search parameter(s). ie. get-help out-file.
Get-help however only searches for the module name. Using help * will search not only the module names, but it also includes the descriptions and instructions of the module info texts in to the search and by that way makes the search function even more useful.

Okay, so now that we have established how to do a search, we need to learn how to use the function to gain more information.

First, do a search:
help* out-file
Good. We will get the following print out.


Now that we have the information out we can take a look at the Remarks section. As you can see you have more options. You can choose which kind of extra information you can request from PS.
I personally love to use -examples addition.
ie. get-help out-file -examples
Another good one is:
get-help out-file -full

The -examples addition gives you a short list of example strings of how to use out-file module.
Get-help out-file -full, prints out all the extensions in one session for easier access.
I will post a small portion below of the result of get-help out-file -examples


Google

Powershell doesn't have all the answers. No matter how great the get-help function is. Therefore it is of utmost importance that you know how to use Google's search functions.
Now I know you might be thinking "What is wrong with just typing the wanted command down?".
Well, if you just decide to do a search for "how to use (module) in powershell" you might end up with some un-relevant search results´and we all know going through all that stuff is just wasting your time.
Try instead ie. "Powershell: Out-file how to out html?" and I guarantee you will get more accurate hits.

To wrap this up here is a small tl;dr for you lazies:


  • get-help module can be used with help *(search word)
  • Adding a remark-extension at the end of get-help command will give you extra information.
    For example: get-help out-file -examples will give you some examples of how to use the out-file module.
  • Always use powershell: (search word) or cmdlet: (search word) for you'r Google searches to get better hits with the search engine.


That is all for now folks.


Next time: We will tamper with time travel!

keskiviikko 1. lokakuuta 2014

How to Generate a simple html report for your Event Viewer logs

In my last Powershell blog I showed how I created a small simple script to get the event viewer logs on one go for easy viewing. After short study I convinced my self that I should make my life much easier and automate the whole event viewer log monitoring process.

I needed this script to do the following:
  • show me the last 600 error and audit failure messages from Application, Security and System -event-logs.
  • Input all the data in one simple html table and put out a file that I can open in any browser.
  • Rename the created .htm file for each log to read ass (log name)(date).htm.
  • Backup the event-logs to a designated Logs -folder.
  • Rename said logs so that they have the date of the backup in their names for easier access if needed.
  • Clear the logs out.
Now this was not an easy task as I am not by far a proficient PS user but just a novice creating his new script, but in the end I got it working and I have to say I am pretty darn proud of my little creation. Just save it as a .ps file and use task scheduler to run it. It's simple as that.

Now the only problem I had left was that I still had to remote connect to every. single. server our customers had in our monitoring system. What a bother...

So I came up with a script to email reports or files using a custom gmail account.

The only problem that remains is that to make this script work on every server is that it needs to be also run on every freaking server...

So here is the to do for the script before I can relax even more and let the computer do all my stuff.

  • Modify the evt-script so that it now add's the server name in the report with the date.
  • Save the report to a network drive located on a dc.
  • Figure out how to create a .zip file with Powershell. Research possibilities of running winzip with task scheduler or other methods.
  • Set up the email script to grab the .zip file, attach it and send to our helpdesk.
That is all for now folks.

Next time: We go to the MOON!


The psychology of working with angry customers... pt. 2 / Dealing with IT

Last night after finishing up my latest blog entry while preparing for bed I began thinking about what I had written and realised that I had forgotten to write about the most important thing about working in IT; Dealing with all the hate and abuse coming your way.

How does one deal with the screaming, swearing and threatening? For the last three years I have been working as a Systems Administrator.  During this time I have managed to experience almost all kinds of abuse, back stabbing and cursing. I would be lying if I told you that my vocabulary hasn't grown with several new curse words.

Here is a small list of things how I control and handle the frustration and anger that working in IT imposes on me. For clarity I will divide the list in two separate sections; at work and back home.

At work:

  1. Relax: Its just a job after all. I often take a small breaks and drink coffee after a tough call. Some people like to go out for early lunch. Just relax, stretching is another good thing to do. Just get your self re-oriented.
  2. Talk about it. Opening up to your colleagues about the idiot you just had to deal with is often therapeutic. I use company IRC channel to host my discussions with my colleagues and friends. Just remember that if you are talking to some one not from your company, that you wont give away any company or worker names or any details about the customer, other than the issue and how he has made you feel. The customer after all has a right to remain anonymous, no matter how much of an ass he or she has made of herself.
  3. Humour. Joke about it. Humour is a life line that yo shouldn't bypass lightly. You can and you should make a joke now and then about a customer call. You can also try acting weird by your self and by that way amuse your self and get your spirits up. Just be wary whit whom you joke around at the office. Throwing a dirty joke at the cute new intern might be frowned upon.
    Just so you know...
  4. Toys. Yes toys. As silly as it might sound, get your self something sweet and cool that you can a) look at and b) play with. I have a deck of cards at my desk that I shuffle all day along while working. I also have a small stack of poker chips that I shuffle while talking to a difficult customer. Having something to do with your hands while listening to abuse is surprisingly therapeutic.  Having a stress-ball is also a good idea. Just make sure that you don't get nothing too childish. Having my little pony figurines at your desk might make you look unprofessional.

Back home:

  1. Relax. Yes, this again. When you come home try to change to something more comfortable. Do something you like. I for example love playing video games and cooking. So I often try to look up simple, healthy recipes from the internet while downtime and when I get home I can go for grocery shopping and cook something. I take cooking as a form of meditation and a source of pride. That or you can sit down and unleash all that frustration to a fast paced FPS. I have to admit that I might scream at the screen sometimes but hey, at least I am not taking it on you.
  2. Hobbies. If you don't have one yet. Get one.  I play video games, study new techs, search new music, play guitar and much more. My brother for example loves to photograph. We all have our own interests. Just do anything to take your mind off the hard day.
  3. Be social. I can't overstate this. Being with your family and friends is essential to your well being. Go out. Meet new people and make friends. Maybe go out for a beer? Don't have friends? Get a hobby and get connected. Or just get your ass up and go to a pub, grab a beer and read the days new papers. You might just meet some one. Also getting connected through forums dedicated your hobby is a good idea.
  4. Exercise. Staying fit is half way of keeping your mind clear and operational.. I try to exercise three times a week, but lately I haven't had the motivation to do anything after work. My last time at the gym was over three weeks ago and I have already noticed how I can't stay as alert and positive as usually. Exercising also helps me sleep better.
In the end, it all comes down to getting your mind out of the office and regenerating for the next day. Just find something you can put your mind into and you should be golden.

Next time: We try to cure Kim Jon-Il!

tiistai 30. syyskuuta 2014

The psychology of working with angry customers... pt. 1

Lets talk about working with angry people. Which I unfortunately have a lot of experience of.
I can't think when I have had a week when an upset customer hasn't called and berated me for something that doesn't work or is broken. I however always manage to end the call with the customer happy and thanking me for help. During my time in the industry I haven't received a single complaint about my conduct during support calls.

Working in customer service IT-field usually consists of 40% of working with broken machines and 60% of working with broken people. Yes, over half of the job is about psychology and some times body-language. To diffuse a volatile situation with upset client is almost as important as knowing how to fix the actual problem.

Here is a small list of things I do to keep my customers pleased during a call:


  1. Listen. During a call use active listening method to communicate to your client that you are actually listening to him and that you care.
  2. Small talk. Try to read the situation by making small talk during down time (reboot, installation). Ask the customer a non-business question like "How is weather there by the way?" This way you take clients attention from the problem while you fix it and put your self out as a human, not some mindless helpdesk drone.
  3. KEEP CALM. Staying calm and friendly especially when your customer is screaming at you.
    Keeping a calm, friendly voice will make the screamer feel bad. After all, you wont enable his rage. Just remember to keep asking questions about the issue.
  4. Explain. Explaining the situation helps always even if the client doesn't understand. Explaining things makes the customer feel like you take him seriously and that you don't think him as a burden or an idiot. 
Talking face to face with an angry person is always hard and some times intimidating.
Here are some tricks I use while talking to a client:

  1. Body-language. Try to act as un-agitated as possible. Don't let the customer think that you are scared of him. I know it sounds silly, we're not on Savannah, right? The thing is that most of the time face to face communication consists of subconscious messages that you send to your customer. These messages can of course be used to your advantage. Here are some tips.
  2. Try to explain. Explain the situation as best as yo can to the customer. What went wrong. Why did it go wrong? What course of action will you do and why.
That is it. Just keep calm and remember. The client is not screaming to you they are screaming at your company.


Next time: We will tamper with evolution!

Checking Event Viewer logs for errors. Now made easy with Powershell!

Hi there,

I recently picked up my old Powershell skills because I needed to automate a process so I could keep doing as little work as possible.

You see, the company I work for requires a lot of reports and as you might know managers love their reports, am I right or am I right folks!

My job mostly revolves around checking if everything is A O.K with our customers servers/systems.
Now what's the problem here, you might think? Well! The problem is that I have to go through every. Single. Freaking servers Event Viewer to see if they are having issues and save the logs in a repository if a situation might arise were we might need them.As you might have figured out by now, this all takes a lot of time to do.

So as a lazy person that I am. I decided to tackle this problem by at first creating a short script that shows me exactly 600 of the newest errors in event logs. This is what I came up with:


Simple huh? Just copy paste this bugger in your Powershell and you should get  to see the 600 newest event viewer errors.
This is how it should look like.
Please note that you should at all times, if possible, run powershell as administrator to make sure that the script runs smoothly.

If your shell gives you an error when pasting the lines to the command promt it simply means that you a) got an extra letter some where in the code b) you didn't run the powershell as Admin! OR c) There is nothing to find aka. no errors.
I didn't remember to run PS as admin and now it nags me about access rights.
Next time: I will teach you how to tame a lama!