Skip to main content

Posts

Showing posts from 2013

I made a GIF!

Subject alternative names and signing certificates with OpenSSL

There are very good how-tos on creating an openssl configuration file with the necessary subject alternative name extensions.  Copy the entire "openssl.cfg" and save it as  as "subaltname.cfg" and add the following lines in the "rec" and "v3_req" sections : [ req ] req_extensions   = v3_req [ v3_req ] subjectAltName   = DNS:srv.example.com; IP:172.16.0.10  extendedKeyUsage = serverAuth, clientAuth NOTE: Extended Key Usage is not required, but is included as many applications using Subject Alternative Names use the generated SSL certificates for both purposes. Generating the certificate signing request (CSR) requires using the command line option "-config [filename]".   # openssl req -new -newkey rsa:2048 -sha256 \   -nodes -out rui.csr -keyout rui.key \    -config subaltname.cfg Verify the CSR contains the  X509v3 Subject Alternative Name. # openssl req -in rui.csr -noout -text [...] X509v3 Subject Alternative Name:  DNS:

Shorter Linux Prompt

When dealing with deeply nested directories having the full path in the prompt is less than optimal.  This provides only the present working directory... PS1="${debian_chroot:+($debian_chroot)}\u@\h:/[...]/\W/\n[`date +%Y-%m-%d_%H:%M:%S:%N`] \$ " Another version that does not have the options specific to my chrooted environment is... PS1="\u@\h:/[...]/\W/\n[`date +%Y-%m-%d_%H:%M:%S:%N`] \$ "

SSH options for scripting

Suggested SSH/SFTP/SCP options when creating a script: Do not store the remote host's SSH public keyfile for later "-o UserKnownHostsFile=/dev/null" Do not check for the remote host's SSH public keyfile in known_hosts "-o StrictHostKeychecking=no" Do not check localhost's SSH public keyfile in known_hosts "-o NoHostAuthenticationForLocalhost=yes" Do not attempt authenticate using a password or prompt for password "-o PasswordAuthentication=no" Attempt authenticate using the specified SSH private key file (default file shown) "-i $HOME/.ssh/id_rsa" All options above included in a test command: touch $HOME/test.txt; \ scp \ -o UserKnownHostsFile=/dev/null \ -o StrictHostKeychecking=no \ -o NoHostAuthenticationForLocalhost=yes \ -o PasswordAuthentication=no \ -i $HOME/.ssh/id_rsa \ $HOME/test.txt \ $USERNAME@localhost:test-`date +%Y%m%d-%H%M%S%N`.txt The command above presumes

LinkedIn URL shortener

While you can customize your LinkedIn page's URI to make it easier to remember, it does not make it significantly shorter. LinkedIn has arranged a custom bit.ly domain 'linkd.in' to handle shortening linkedin.com   URIs.  Naturally, the shortened URI version is great for business cards and other applications where space is restricted.  For example, my professional profile on LinkedIn is: http://www.linkedin.com/in/jantonacci/ and when shortened becomes: http://linkd.in/X5PiqU  .

Eugoogly for Google Reader

Well this sucks. I had not intended to start my day mourning the (impending) loss of a dear friend.  What is next?  Euthanize Blogger? I need an on-line feed reader with all my news and blogs integrated in one secure site. Twitter is NOT a substitute. Official Google Reader Blog: Powering Down Google Reader : Posted by Alan Green, Software Engineer We have just announced on the Official Google Blog that we will soon retire Google Reader (the...

4 8 1516 23 42... LOST

Display the (in)famous LOST television series numbers on the command line.  Perl one-liner to exec with ActiveState PERL on Windows.   perl -e "$|=1;@lostNumbers=('4','8', '15', '16', '23', '42'); while (1) { print ' ' x (rand(35) + 1), ($lostNumbers[int rand @lostNumbers]) }" As a script, lostNumbers.pl, you can get a bit fancier with different subroutines... #!/usr/bin/perl -w use warnings; use strict;  #&lostNumRandFast; #&lostNumRand; #&lostNumRandGapsFast; &lostNumRandGaps; #&lostNumRandStart;  sub lostNumRandFast { $| = 1; my @lostNumbers=('4', '8', '15', '16', '23', '42'); my $iterations=65535; while ($iterations--) { print ' ' x (rand(35) + 1); print ($lostNumbers[int rand @lostNumbers] ); } } sub lostNumRand { $| = 1; my @lostNumbers=('4', '8', '15', '16', '23

Changing RHEL/CentOS 5.x hostname without reboot

Changing your Red Hat Enterprise or CentOS Linux server's hostname does not require rebooting the system; only restarting services.  And does not interrupt system operations. For this example, we are promoting a RHEL development system named RD13 to production and therefore need to rename it RP13.  The scope is limited to the operating system only; DNS and application specific changes are not discussed.  It is strongly suggested ALL relevant DNS and application configuration changes be made first - before proceeding. 1) After making a backup /etc/hosts copy, replace the existing primary IP address canonical name and aliases with the new values.  Note that the canonical name (FQDN) is first, the alias (short) is second. Note the updated line has 'rp', not 'rd'. #diff hosts.orig hosts   < 192.168.1.10     rd13.example.com rd13   ---   > 192.168.1.10     rp13.example.com rp13 Alternatively, comment out the line completely and use DNS.  Larger en

SSH keys and DfSS wisdom

Spent an hour working on SSH private key authentication this week without success.  The entire process is simple, you have to follow ALL the steps though.  Generating the public/private keys, add the public key to $HOME/.sssh/authorized_keys, and test SSH authentication.  I skipped step two: update/create authorized_keys. Question your assumptions - reviewing the howto is better than researching a debug level 3 error.  One "Design for Six Sigma" tool that caught my attention is "Pair Programming".  The concept is simple: two people on one workstation.  Both people are engaged, checking each others design and providing feedback real-time; as a result the quality and volume of work increases.  The camaraderie is a great perk too. If I had engaged a co-worker, even one unfamiliar with SSH, instead of hammering away I could have resolved the issue much faster.

IEEE "Design for Six Sigma" Completed

Completed the IEEE "Design for Six Sigma" (DFSS) today and have my certificate!  Many are skeptical about service delivery and the Six Sigma model, however the course was focused on design. As a result, more time was spent on " Identify, Design, Optimize and Verify" (IDOV) methodology tools: GMA, PPA, DOE and FMEA.  Would recommend the course. Ref: IEE eLearning "Design for Six Sigma" by S. Keene http://ieeexplore.ieee.org/servlet/opac?mdnumber=EW1063

Cisco v. VMware for data center switching title

Generic switching hardware for multiple protocols versus virtual software devices.  LAN and SAN admins prefer hardware; VMware admins want control, flexibility.  Can't we all just get along (with a bit of both)? Cisco 'Soft Network' Approach Preferred to  VMware's , Says Deutsche  -  Barron's  Large enterprise IT, we spoke with, see value in Cisco's “hybrid physical/virtual” SDN approach versus  VMware /Nicira's “vswitch centric” SDN solutions […] Our conversations with senior enterprise IT architects (from large asset management firms, etc  ... Ref:  http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNEGOpKhJOeKIytiQPq9kobhOwfGNw&url=http://blogs.barrons.com/techtraderdaily/2013/02/19/cisco-soft-network-approach-preferred-to-vmwares-says-deutsche/

Ask yourself, then your supervisor three questions

+John Pozadzides  posted " The Wage Earner’s Dilema " this week.  In summation there are three questions to ask: If you had to gauge my performance and experience at my current job, how would you stack rank me against the team? How do you feel about the company’s financial position and prospects for the future? How much longer do you think it will take before I see a substantial pay increase or the opportunity to move up in the ranks? I encourage you to read his entire article.  Asking for additional compensation is not ungrateful and does not have to be awkward.   Be prepared, respectful and confident. References: http://onemansblog.com/2013/02/18/the-wage-earners-dilema-or-how-to-negotiate-for-more-money/

Best Interview Question Ever

"I want you to explain something to me. Pick any topic you want: a hobby you have, a book you’ve read, a project you worked on--anything. You’ll have just five minutes to explain it. At the beginning of the five minutes you shouldn't assume anything about what I know, and at the end I should understand whatever is most important about this topic. During the five minutes, I might ask you some questions, and you can ask me questions. Take as much time as you want to think it through, and let me know when you want to start. It is amazing how many candidates will not premeditate before diving into this interview question. What's most incredible about this is how accurately it predicts disorganized and non-goal directed behavior on the job. I’ve been overruled a few times by my manager on a hiring decision, and this question was a harbinger of things to come. Conversely, the people who think it through and have a few crystal clear points are amongst the best people I’ve worke

FastStone Capture

FastStone Capture  is a lightweight screen capture tool that saves images and/or video (yes!). I used it to generate still images for a Red Hat Linux graphical install tutorial and a video for adding services to Barracuda Web Application Firewall.  It was easy to use and produced good results for both projects.   FastStone Capture is available with free demo period or a license is less than $20.  An outstanding value. URI: http://www.faststone.org/FSCaptureDetail.htm

Never trust assumptions

Understanding your objective - both as a concept and as implemented within the system is critical. Knowing a command exists or how it can be applied is next in importance. Remembering the exact parameters or syntax is normally then trivial. Command documentation is normally close at hand. Also, (re)verifying your assumptions (or recollections) is always a wise decision.

Is PERL "quaint" ?

A developer asked me how I was scripting an integration task.  I replied PERL, then he smiled and said, "How quaint.".  There were platform limitations that made PERL or Java the only choices in that situation. So I ask you, is PERL "quaint" ? What language do you use for scripting and why? What language would you use if you would/could/had-to change? I prefer to recycle code rather than start fresh.  PERL and Java both being cross platform increases my chances to do that.  However I have always had Java version incompatibility issues as a user (not a developer) and the litany of security issues does not inspire confidence.  The latest TIOBE survey shows PERL and Java both holding steady, yet Java has a commanding lead at 17% to Perl's 2%.  Using the native CLI is frequently the fastest means to an end.  BASH is fantastic for UNIX/Linux and even on Cygwin at times.  I use BASH extensively for UNIX/Linux administration tasks.  There are some PERL one-lin