Sunday, June 10, 2012

Has my SSL cert Expired?


I know Browser gives this info - but if you wanna use this info somewhere in a script etc. this command can be definitely handy!

[root@DebaTestBox ~]# echo | openssl s_client -connect mysite.com:443 2>/dev/null |openssl x509 -dates -noout

notBefore=Mar 20 00:00:00 2012 GMT

notAfter=Apr 19 23:59:59 2016 GMT

[root@DebaTestBox ~]#

Below will actually give you how many days left for expiry  -

#Cat WillExpire-in.sh
end_date=`openssl s_client -showcerts -connect mysite.com:443  
/dev/null | sed -n 's/ *Not After : *//p'`

if [ -n "$end_date" ]
then
    end_date_seconds=`date '+%s' --date "$end_date"`

    now_seconds=`date '+%s'`

    echo "($end_date_seconds-$now_seconds)/24/3600" | bc
fi

Thanks/-

D

Rethink Automation !!

Is it true that - Technologies and accelerated growth of automation has a tendency of eating jobs?

I recently attended one workshop where most of the participants were upcoming talented Software engineers and on the same topic one said "I hate seeing repeating tasks people do in operations domain - things should be automated"

First of all - I really love this energy and always have possessed huge respect for our engineers who has been contributing to this modern world - we need them and their innovation more than ever.

However - at the heart of Engineering domain  specially Software Engineering - there is a belief that - everything in this world can be automated. Engineers give us Engines - Engines replaces humans. But can everything be automated?

One of my earlier assignment was in a Healthcare domain and that time HIPAA regulations were in full enforcement. The IT help-desk was always reminding us NOT to keep any printed reports etc. in Printer tray and advised to collect immediately and either secured under the lock or shred them immediately.

But one user had a problem - "I usually do not have time to immediately collect and sometimes I am always waiting as multiple people send their print to the common printer and I am just waiting.. - is there a setting you can suggest in my PC to send them directly to the shredder if I am late or forget to collect it." IT guys was stunned!  - Yeah!! rethink Automation :-) 

Scope is important to identify - then with the purpose comes the shared sense of destiny and finally a fine balance, defined boundary and enforcement.

Bill Gates says : "The first rule of any technology used in a business is that automation applied to an efficient operation will magnify the efficiency. The second is that automation applied to an inefficient operation will magnify the inefficiency." - how true.


As we advance in technology up-gradation or replacement - it reverses every situation and characteristics yet again and sometimes even forces us to comprehend a situation or even adopt a very different approach  to the problem resolution.

Human mindset is also very important -  else you will  end up on untouched and unused tools if automation necessarily is a tool. Vagueness and interpretation of the term itself sometimes tend to raise confusion and can even mislead us in wrong direction.

Just to wrap up - Don’t put up with repetitive, manual tasks - we must strive to automate them - with a vision to pursue continuous improvement to support long term growth and sustained viability. And most importantly - let it help achieve higher degree of centralization BUT not encourage or strengthen monopolistic tendencies.


-DK











Friday, June 8, 2012

Edit file content under compressed archive


When we have a compressed archive ( .tar.gz/ .gz/.zip etc.) and you want edit the content of one of the file inside - it's NOT needed to uncompress that archive really.

Just do a #vim testArchive.tar.gz 
Then point the file you need to edit the content save and come out. That's it!  You will have the modifed archive without that extra step.

Hope it helps!

-DK

Get Your Public External IP From Command Line


Ya this is needed in many such occasion -  like Proxy white-listing / Getting access through 3rd party Firewall / troubleshooting anything on web server specific to your request etc.

On linux Command prompt I would do somethign like this :

[root@DebaTestBox ~]# wget -O - -q icanhazip.com 
14.16.135.X
[root@DebaTestBox ~]# curl ifconfig.me/ip
14.16.135.X
[root@DebaTestBox ~]#





Eventhough there are many such sites(most of them are flooded with ads!!)  - who gives your Outgoing NAT public IP info - I know some lighter once -

http://ipcheck.rehbein.net/
http://checkrealip.com/
http://dynamic.zoneedit.com/checkip.html
http://www.raffar.com/checkip/
http://www.thisip.org/
http://testip.edpsciences.org/
http://mwburden.com/cgi-bin/getipaddr
http://www.tanziars.com/
http://www.naumann-net.org/
http://www.antifart.com/stuff/checkip/
http://checkip.eurodyndns.org/

Woindows users can simply type any of these above URL in the browser -  not sure - if we can use any cmd like you can do in *NIX console.

PS: Please add to the list if you know more secured one's

Thanks/-
D K

  Expand your network at ease : Six Degrees of Separation! PC: Psych2Go Did you know that you are just six connections away from any person ...