Skip to main content

Posts

Showing posts with the label programming

Code to check SSL Client Certificate ...

Code to check SSL Client Certificate Expiration remotely Language: C# (C Sharp) using MS Visual Studio Express 2010 Reference:  System.Net.ServicePointManager , another sample code from stackOverflow Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Diagnostics; namespace CertCheck {     class Program     {         static void Main(string[] args)         {             //Get URL from command line to check             if (args.Length==0)             {                 Console.WriteLine("Usage: CertCheck <https://url> [-v]");                 Console.WriteLine("Enter an url with https prefix");          ...

sed regular expression to extract mes...

sed regular expression to extract message part of the syslog (AIX): #>sed 's/\(...\) \(..\) \(..\:..\:..\) \(.*\)/\4/' /var/adm/syslog myhost auth|security:err|error tsm: : 3004-025 - tcgetattr  failed errno "25".  myhost auth|security:notice su: from dude to root at /dev/pts/109 myhost daemon:err|error root: Msg from Err Log: A924A5FC 0524165910 P S SYSPROC SOFTWARE PROGRAM ABNORMALLY TERMINATED  myhost daemon:err|error last message repeated 2 times myhost user:info syslog: libtt[1224956]: _Tt_rpc_client::init(): fcntl(F_SETFD) failed for socket =  20 myhost user:info last message repeated 10 times myhost user:info syslog: libtt[3125324]: _Tt_rpc_client::init(): fcntl(F_SETFD) failed for socket =  20 myhost user:info last message repeated 10 times myhost auth|security:info sshd[946242]: Received disconnect from 127.0.0.1: 0:  myhost auth|security:info sshd[946178]: Accepted password for dude from 127.0.0.1 port 4341 ssh2 will print everything aft...

Perl one liners

Check if a module is installed: perl -M<module name>-e 1 Check the version of the installed modules: perl -M<module name> -e 'print "$<module name>::VERSION \n"' Install a perl module using CPAN: perl -MCPAN -e 'install <module name>' ________________________________________________ References: http://www.perlhowto.com/perl_modules http://www.cpan.org/misc/cpan-faq.html#How_install_Perl_modules