Showing posts with label ironman perl. Show all posts
Showing posts with label ironman perl. Show all posts

Thursday, November 1, 2018

Being Lazy

Just discovered Array::Utils!  Wonderful!  To think I was going to write a "find unique elements in an array" myself.  Nope!

use Array::Utils qw(:all);
my @unique = unique(@a, @b);
 
 
 

Friday, February 10, 2017

These are a few of my favorite modules

I was messing around with Xen on Slackware 14.2 and got my system goofed up.  The console worked but the mouse and keyboard would not function in X.  So, after a bit of flailing, I did a distro upgrade (from Slackware 14.2 to current), re-ran liloconfig and,  ta-dah! -Success!

I noticed Perl didn't work however.  It upgraded Perl but the modules were "mis-matched" it said.  After some googling, I ran across several suggested fixes.  The simplest seemed to me the brute force - delete all Perl references and reinstall Perl - which I did. (perl -E 'map {say $_} @INC')

Now I had a NEW problem.  NO MODULES AT ALL.  Began slowly adding modules as I needed them but today that was getting old.  So I did a quick grep of a few hundred of my Perl programs to see which modules I was using and then did a cpan install of all of them.  It's still running...

Which Perl modules you ask?  Well, to satisfy your curiosity and have this list handy the next time I install a fresh Perl - here's my list:

Gimp Gimp::Fu File::stat Time::localtime DBI Net::LDAP Net::LDAP::Bind Net::LDAP::Search MIME::Lite Net::Nslookup Nmap::Scanner Net::SSL::ExpireDate XML::RSS XML::Simple Test::Simple Net::LDAP::LDIF File::Basename CGI::Carp Net::SNMP SQL::Abstract Text::xSV Pod::HTML2Pod LWP::Simple LWP::UserAgent Net::IMAP::Simple Mojo::UserAgent Data::Dumper Date::Manip Net::Twitter DBD::SQLite Net::DNS Net::Telnet::Cisco DBD::Sybase Crypt::GPG File::Slurp utf8 Socket Net::DNS AnyEvent Net::RabbitFoot WWW::Mechanize HTTP::Cookies File::Copy Bot::BasicBot POE::Component::SSLify Config::General Log::Log4perl::Appender::RRDs LWP::Protocol::https

Wow.  That's actually shorter than I thought.  It looked more impressive as one line.  ;-)

Thursday, January 5, 2017

Ansible Playbook and Perl (or 'Salted MD5 - Yummo!')

Not much of an article here - just some notes about encrypting passwords for Ansible playbooks.  All of the examples for adding the encrypted passwords to the ansible playbook are Python (what's up with that?!) :-)

So, I have an example of a playbook to change a user password on all ansible systems and I have translated the password encryption field for Perl (you're welcome!)

Here's my chgUserPW.yml:

---
- hosts: all
  sudo: yes
  tasks:
  - name: Change user1 password
    # Created passwd with:
    # perl -e 'print crypt("your pw here","\$6\$salt\$")'
    # Notes: password, 6 = md5, salt = random string to salt entropy
    user: name=user1 update_password=always password=$6$salt$sjuT2.eSTcX/vKwW7RlB1tdLxyB34lJSsndXA5yzC7BZrdAkiAOqtf4NPtHa0tjdFa/5wcS1.vt0LAwzEassr0


All you do is run the Perl one-liner adding your own password and salt string (the word "salt" is probably not a good choice) and you get the format for the password Linux is expecting (salted MD5).  Paste that into the password field and you can now change all of your system's user1 passwords to "your pw here".

*Disclaimer - I'd try it on a single system first, preferably one you have a backdoor root account on.  It worked for me.  Good luck!


Tuesday, September 20, 2016

Alternatives to Powerpoint - My Favorite

OpenSource.com just sent me a mailing this morning entitled: 3 open source alternatives to PowerPoint.  I immediately thought to myself "Ok, LibreOffice, CalligraOffice ... I wonder what the 3rd is?".  I was really surprised it was MY personal favorite: Reveal.js.  I've been using that since Perltricks.com had an article on it.  I've seen several presentations done using it at YAPCs and Ohio Linuxfest (coming up soon, btw).

Despite the headline, OpenSource.com goes beyond 3 alternatives and also discusses using your console for slide shows with Vimdeck.  Very interesting!

The article didn't explain how to use (my favorite) Reveal.js though so if you're curious, check out the Perltricks link above.  I think you'll be glad you did.

Alternatives to Powerpoint - My Favorite

OpenSource.com just sent me a mailing this morning entitled: 3 open source alternatives to PowerPoint.  I immediately thought to myself "Ok, LibreOffice, CalligraOffice ... I wonder what the 3rd is?".  I was really surprised it was MY personal favorite: Reveal.js.  I've been using that since Perltricks.com had an article on it.  I've seen several presentations done using it at YAPCs and Ohio Linuxfest (coming up soon, btw). 

Despite the headline, OpenSource.com goes beyond 3 alternatives and also discusses using your console for slide shows with Vimdeck.  Very interesting!

The article didn't explain how to use (my favorite) Reveal.js though so if you're curious, check out the Perltricks link above.  I think you'll be glad you did.

Wednesday, December 21, 2011

Lost in Windowsland

For the first time in 15 years, (maybe ever*), I've been working on Windows servers.  I've always found Windows to be uncomfortable.  Lousy shell, few if any tools -and you can't script a GUI. But lately, I've been intrigued by Powershell and have been using it a bit for things.  With the addition of gVim, I am finding Windows to be more and more comfortable.  (gVim is a lifesaver!) 

Another thing I use is Strawberry Perl!  Actually, I use it to write Powershell scripts for large lists of users [add mailbox, delete mailbox, add/del mailContact, etc.]  But I am seeing some pretty cool Powershell tools (import-csv is cool) and someday, I'll just process files in Powershell and won't need Perl (on Windows).  Yeah right!!  And I'll switch to Notepad too.  Ha!

So, I'm pretty much weaned off of Cygwin - yeah, practically a Windows native now except for gVim and Perl.  I guess that okay, eh?

-------
* I went directly from being the Netware guy to being the UNIX guy and skipped the Windows NT, etc.