Wednesday, April 18, 2018

Exchange 2013: A Reboot is Required...

So today while installing the management tools on my localhost I ran into this issue of the repeating reboot request. The url linked in the install window specifically mentions how it's unsafe to try to work around this issue by modifying registry entries... oh really? lol.

Located here:

Computer\HKLM\System\CurrentControlSet\Control\Session Manager

I deleted the DWORD value PendingFileRenameOperations, then hit re-try on the installer and boom.  Done.

Tuesday, February 27, 2018

Grep returning if results were found or not

Today I needed a one-liner like this to help with with an Ansible playbook, storing here for posterity:

rpm -qa | grep -q "rhn" && echo 'is installed' || echo 'not installed'

Ansible: Part Three

So at work I'm tasked with hardening the new Wildfly environment which consists of 1xdev, 2xuat and 4xprod servers.

I *had* plans on using this as an opportunity to pound our some Python but after a learned recommendation from a friend in IRC I went the Ansible route and boy am I glad I did!
I can't quite recall what happened last year when I tried and failed twice.. but yesterday I had a simple ping command working and hitting all 7 servers within an hour's time.  Last night I banged out half a dozen cursory playbooks within 4 hours and today I've got a working couple of playbooks that are furthering me to my goal of World Domina.. err automating the things.

Wednesday, February 7, 2018

SCP files thru multiple proxy hosts

I realize this might be old-hat for quite a few but I just learned it and this will save me so bloody much time!

While there are multiple ways of doing this.. including editing your .ssh/config file to include a similar reference I am choosing the full CLI method.

So first off make sure netcat (nc) is installed on all hosts.  Then craft a string as such:

scp -o ProxyCommand="ssh first_host nc second_host 22" /local/path/to/file user@target_host:/dest/path

So what I have done here is to ssh proxy through host1, to host2 then scp'd from host2 to target_host.  Which in my case was exactly what I needed since this new Java environment requires me to jump through two proxies to reach my target.

Like I said I know this is old stuff to a large percentage of you Unix/Linux admins but hopefully this will help someone.

Wednesday, January 31, 2018

Dynamically naming Konsole tabs

So at work I use Fedora 27, and I administer quite a number of Linux servers.. So since I run the Plasma desktop environment (DE) I use the terminal emulator Konsole.  The Konsole window uses tabs.. much like modern internet browsers to help you multitask instead multiple full windows.

So anyway when you open Konsole the opening tab is named with, by default, username and current directory. If you SSH into a remote host the tab name changes to username and remote host.. which is very cool.  However if you further SSH into another host from the first the tab name remains the same as it was.  Which.. for me anyway leads to mass confusion if you have more than a couple tabs open.

So one of the fine folks in teh Fedora User mailing list tossed me a bone today.. I inquired about being able to change the tab name based on remote hostname past the first remote host.  Here's what he gave me:

    chpwd() {
        [[ -t 1 ]] || return
        case $TERM in
            sun-cmd) print -Pn "\e]l%~\e\\"
            *xterm*|rxvt|(dt|k|E)term) print -Pn "\e]2;[%m] %~\a"
            vt220) print -Pn "\e]2;[%m] %~\a"


So.. I'll admit that I do not quite understand the % or print syntax as of yet.. however adding this tidbit to the end of my .zshrc file then within Konsole changing the tab and remote tab fields to %w did exactly what I wanted to do and more.
The more part meaning that now my tab names also include the username@hostname but also the full path where I am at currently in that remote host.  Honestly its too much info for a small pane.  But it's a damned fine start!