tag:blogger.com,1999:blog-53635817923388808142024-03-13T13:16:12.523-07:00Yes, I still use PerlKeep Perl Pathologically Eclectic!RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.comBlogger41125tag:blogger.com,1999:blog-5363581792338880814.post-86684258251751167962019-06-13T09:31:00.003-07:002019-06-13T09:31:35.181-07:00LaTeX, Vim and PerlI'm finishing up grad school. I write all of my papers in vi (usually <a href="https://en.wikipedia.org/wiki/Elvis_(text_editor)" target="_blank">Elvis</a>, sometimes <a href="https://www.vim.org/" target="_blank">Vim</a>) and mark them up with <a href="https://www.latex-project.org/" target="_blank">LaTeX</a>. Yeah, I know. I'm a geek. I just love the beautiful look of a typeset document when I'm done. I like the way it forces me to think about the outline; creating <span style="font-family: "Courier New", Courier, monospace;">\sections{}</span>, then <span style="font-family: "Courier New", Courier, monospace;">\subsection{}</span> and even <span style="font-family: "Courier New", Courier, monospace;">\subsubsection{}</span>. This looks really nice as an auto-generated table of contents. <br />
<br />
Even better than the beautiful typesetting, I really enjoy keeping my bibliography in <a href="http://www.bibtex.org/" target="_blank">BibTeX</a> and having LaTeX/BibTeX automagically write my bibliography citations and print my bibliography at the end by simply writing <span style="font-family: "Courier New", Courier, monospace;">\cite[p.78]{author}</span>.<br />
<br />
And when I'm done, if I don't want a PDF, I can use <a href="http://latex2rtf.sourceforge.net/" target="_blank">latex2rtf</a> for an RTF or <a href="https://www.latex2html.org/" target="_blank">latex2html</a> to create a web site (or <a href="https://ctan.org/pkg/latex2man?lang=en" target="_blank">latex2man</a> if I'm feeling extra geeky). And, I pretty much live in vi all day so, even if I try to use a regular word processor, it gets krufted up with <span style="font-family: "Courier New", Courier, monospace;">:wq</span> and randomly interjected i's and a's and x', etc.<br />
<br />
I used to use <a href="https://www.gnu.org/software/emacs/" target="_blank">emacs</a>. I did more with emacs I think because I had a <a href="https://en.wikipedia.org/wiki/File:Terminal-wyse50.jpg" target="_blank">Wyse60 monitor</a> and really used the multiple buffers and split screens. And, loved the <a href="https://www.emacswiki.org/emacs/KeyboardMacros" target="_blank">macros</a>. I know, you can do this with vi too. I really need to learn more of that in vi. Lately, while writing these papers, I find myself wanting to copy lines from other .tex docs into the current document. Cutting and pasting outside of vi leaves unexpected broken lines that require a lot of <span style="font-family: "Courier New", Courier, monospace;">Ctrl-J, x</span>, etc. Then I saw an article by <a href="https://twitter.com/junwuwriting" target="_blank">Jun Wu</a> "<a href="http://www.softpanorama.org/Scripting/Perlorama/perl_in_command_line.shtml" target="_blank">Perl as a command line tool"</a> Lots of fun. Love Perl one-liners. She had a version of this example:<br />
<br />
<br />
<span style="font-family: "Courier New", Courier, monospace;"> $ perl -ne 'print if $. >=64 && $. <=94' June10.tex >>../FinalPaper/ENG609final.tex </span><br />
<br />
It's so great to NOT have to clean up line breaks after cut & paste. And, even better, it gives me an excuse to play around with <a href="https://nostarch.com/perloneliners" target="_blank">Perl one-liners</a>. Some people things that's odd but I see it as recreational - like <a href="https://www.websudoku.com/" target="_blank">Soduko</a> or something.<br />
<br />
Anyways, that's all I'm up to with Perl lately. See you all at the <a href="https://perlconference.us/tpc-2019-pit/" target="_blank">20th anniversary of YAPC</a>. <br />
<br />
<br />RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-58193685173267184372018-12-13T07:50:00.003-08:002018-12-13T07:50:28.591-08:00Bitten by an old "bug"?So thankful to find <a href="http://blogs.perl.org/users/brian_d_foy/2011/07/now-you-need-lwpprotocolhttps.html" target="_blank">brian d foy's post about LWP::Protocol::https</a> yesterday after some really old scripts just wouldn't work on a new system. I could tell it was having an issue with the https - but, like Brian (in 2011?!) I thought all of my usual SSL libraries would cover it (which they did). Installing all of my modules takes about an hour. So, I continued to flail during this time. By the time I saw Brian's post, the problem fixed itself (after I installed my own CPAN favorites).<br />
<br />
Not knowing <a href="http://yesistilluseperl.blogspot.com/2017/02/these-are-few-of-my-favorite-modules.html" target="_blank">my cluster of favorite CPAN modules</a> had fixed this, I quickly did a "install LWP::Protocol::https" to which cpan replied "installed and already up to date". "So why isn't it working?!", I thought. I tried again and it was.<br />
<br />
So, to recap, if you plan on using "LWP::Simple qw(getstore)" to grab something from a HTTPS web site and you get a error 501 - this is what you need to fix your problem: <a href="http://blogs.perl.org/users/brian_d_foy/2011/07/now-you-need-lwpprotocolhttps.html" target="_blank">LWP::Protocol::https</a> (which was split out in 2011 and I evidently missed the memo).RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-62226100174803983182018-11-19T07:03:00.000-08:002018-11-19T09:09:23.626-08:00Perl, Awk or other?<span style="font-family: "arial" , "helvetica" , sans-serif;">I had some quickie output from an ad hoc Ansible command. I love
Ansible! The data was quick to acquire and accurate. But the readability
was not optimal. "Hmmm...", I thought, "It'd be good enough if it just
separated the data elements with a space." Actually, this comes up a lot
with my quickie ad hoc Ansible reports so I do what I always do: Perl!</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-33ynBPsu68o/W_LO7K6hOMI/AAAAAAAA6QQ/TTzFpnW7PQkJ7r3synKqDORX9aSSMJr0ACLcBGAs/s1600/Screenshot_2018-11-16_14-43-01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="509" data-original-width="818" height="247" src="https://2.bp.blogspot.com/-33ynBPsu68o/W_LO7K6hOMI/AAAAAAAA6QQ/TTzFpnW7PQkJ7r3synKqDORX9aSSMJr0ACLcBGAs/s400/Screenshot_2018-11-16_14-43-01.png" width="400" /></a></div>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">That worked perfectly but it was so simple I thought it should be a
one-liner. BTW, I really enjoyed <a href="http://www.catonmat.net/books/" target="_blank">Peteris Krumins' Sed, Awk and Perl one-liner books.</a> I bought them all in PDF and then bought the pretty <a href="https://www.amazon.com/Perl-One-Liners-Programs-That-Things/dp/159327520X/" target="_blank">No Starch Press version of Perl One-Liners</a> (makes a great coffee table book
- I just pick it up and open it to any page and I'm intrigued - Fun!)
So, I took a stab at it. It worked perfectly the first time but it was
really just my same program in one-liner format. So here it is. If you
have a more elegant solution let me know.</span><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">
</span><br />
<pre spellcheck="false"></pre>
<pre spellcheck="false"><span style="font-size: x-small;"> <span style="font-family: "courier new" , "courier" , monospace;">perl -pe '<span class="hljs-keyword">if</span> (m/<span class="hljs-type">SUCCESS</span>/) {<span class="hljs-built_in">print</span> <span class="hljs-string">"\n$_"</span>} <span class="hljs-keyword">else</span> {<span class="hljs-built_in">print</span> $<span class="hljs-number">_</span>} ' <span class="hljs-type">JavaReport</span>.txt</span></span></pre>
<pre spellcheck="false"> <span style="font-family: "arial" , "helvetica" , sans-serif;"><span class="ember-view" id="ember2754"> </span></span></pre>
<pre spellcheck="false"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span class="ember-view" id="ember2754">P.S. The I tried Awk:</span></span></pre>
<pre spellcheck="false"><span class="ember-view" id="ember2754"> </span></pre>
<pre spellcheck="false"><span style="font-family: "courier new" , "courier" , monospace;"><span class="ember-view" id="ember2754"> awk '/SUCCESS/ { print "\n" } {print}' JavaReport.txt </span></span></pre>
<pre spellcheck="false"><span style="font-family: "courier new" , "courier" , monospace;"><span class="ember-view" id="ember2754"> </span></span><span style="font-family: "arial" , "helvetica" , sans-serif;"><span class="ember-view" id="ember2754"> </span></span></pre>
<pre spellcheck="false"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span class="ember-view" id="ember2754">(although this isn't quite right)</span>
</span>
</pre>
<div class="feed-shared-comment-item__options">
</div>
<div class="feed-shared-comment-item__post-meta feed-shared-post-meta is-comment feed-shared-post-meta--is-not-sponsored ember-view" id="ember2761">
<a class="tap-target feed-shared-post-meta__actor-link ember-view" data-control-name="comment_actor" href="https://www.linkedin.com/in/james-odom-01650245/" id="ember2762" target="_self"> </a><br />
<div class="feed-shared-avatar-image b0 member ember-view" data-entity-hovercard-id="urn:li:fs_miniProfile:ACoAAAmB2ZIBtWHBEyikmYDTbAhdzPSnE1tPbqc" id="ember2763">
<div class="presence-entity presence-entity--size-2 ember-view" id="ember2764">
<div class="avatar member EntityPhoto-circle-2 presence-entity__image EntityPhoto-circle-2 ember-view" id="ember2765" style="background-image: url("https://media.licdn.com/dms/image/C5603AQGt5HGUoLul4A/profile-displayphoto-shrink_800_800/0?e=1548288000&v=beta&t=J2juEcpNNyf2trubFbRUn6kMdKD07-4BFdAzWU0U1eI");">
</div>
</div>
</div>
<a class="tap-target feed-shared-post-meta__actor-link ember-view" data-control-name="comment_actor" href="https://www.linkedin.com/in/james-odom-01650245/" id="ember2762" target="_self">
</a></div>
RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com3tag:blogger.com,1999:blog-5363581792338880814.post-70987795408290946652018-11-01T07:46:00.001-07:002018-11-01T07:46:27.202-07:00Being LazyJust discovered Array::Utils! Wonderful! To think I was going to write a "find unique elements in an array" myself. Nope!<br />
<br />
<pre><div class="line number1 index0 alt2">
<code class="perl keyword">use</code> <code class="perl plain"><a href="https://metacpan.org/pod/Array::Utils" target="_blank">Array::Utils</a> </code><code class="perl string">qw(:all)</code><code class="perl plain">;</code></div>
</pre>
<pre><div class="line number13 index12 alt2">
<code class="perl keyword">my</code> <code class="perl variable">@unique</code> <code class="perl plain">= unique(</code><code class="perl variable">@a</code><code class="perl plain">, </code><code class="perl variable">@b</code><code class="perl plain">);</code></div>
<div class="line number13 index12 alt2">
<code class="perl plain"> </code></div>
<div class="line number13 index12 alt2">
<code class="perl plain"> </code></div>
<div class="line number13 index12 alt2">
<code class="perl plain"> </code></div>
<div class="line number13 index12 alt2">
<code class="perl plain"> </code></div>
</pre>
RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com2tag:blogger.com,1999:blog-5363581792338880814.post-11462864474923218602017-02-10T09:16:00.004-08:002018-12-12T15:16:11.036-08:00These are a few of my favorite modulesI 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!<br />
<br />
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')<br />
<br />
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...<br />
<br />
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:<br />
<br />
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 <a href="http://search.cpan.org/dist/LWP-Protocol-https">LWP::Protocol::https</a> <br />
<br />
Wow. That's actually shorter than I thought. It looked more impressive as one line. ;-)RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com3tag:blogger.com,1999:blog-5363581792338880814.post-25477819406753455362017-01-05T12:19:00.000-08:002017-01-05T12:19:01.950-08:00Ansible 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?!) :-)<br />
<br />
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!)<br />
<br />
Here's my chgUserPW.yml:<br />
<br />
<span style="font-size: xx-small;">---<br />- hosts: all<br /> sudo: yes<br /> tasks: <br /> - name: Change user1 password<br /> # Created passwd with: <br /> # perl -e 'print crypt("your pw here","\$6\$salt\$")'<br /> # Notes: password, 6 = md5, salt = random string to salt entropy<br /> user: name=user1 update_password=always password=$6$salt$sjuT2.eSTcX/vKwW7RlB1tdLxyB34lJSsndXA5yzC7BZrdAkiAOqtf4NPtHa0tjdFa/5wcS1.vt0LAwzEassr0</span><br />
<br />
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".<br />
<br />
*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!<br />
<br />
<br />RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com1tag:blogger.com,1999:blog-5363581792338880814.post-78888701866277856972016-09-20T07:49:00.005-07:002016-09-20T07:51:57.508-07:00Alternatives to Powerpoint - My FavoriteOpenSource.com just sent me a mailing this morning entitled: <a href="https://opensource.com/business/16/9/alternatives-powerpoint?sc_cid=70160000000QyBpAAK" target="_blank">3 open source alternatives to PowerPoint</a>. 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 <a href="http://perltricks.com/article/94/2014/6/6/Create-professional-slideshows-in-seconds-with-App--revealup/" target="_blank">Perltricks.com had an article</a> on it. I've seen several presentations done using it at <a href="http://www.yapcna.org/yn2016/" target="_blank">YAPCs</a> and <a href="https://ohiolinux.org/" target="_blank">Ohio Linuxfest</a> (coming up soon, btw).<br />
<br />
Despite the headline, OpenSource.com goes beyond 3 alternatives and also discusses using your console for slide shows with Vimdeck. Very interesting!<br />
<br />
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.RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-62937669952612212782016-09-20T07:49:00.004-07:002016-09-20T07:50:16.454-07:00Alternatives to Powerpoint - My FavoriteOpenSource.com just sent me a mailing this morning entitled: <a href="https://opensource.com/business/16/9/alternatives-powerpoint?sc_cid=70160000000QyBpAAK" target="_blank">3 open source alternatives to PowerPoint</a>. 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 <a href="http://perltricks.com/article/94/2014/6/6/Create-professional-slideshows-in-seconds-with-App--revealup/" target="_blank">Perltricks.com had an article</a> on it. I've seen several presentations done using it at <a href="http://www.yapcna.org/yn2016/" target="_blank">YAPCs</a> and <a href="https://ohiolinux.org/" target="_blank">Ohio Linuxfest</a> (coming up soon, btw). <br />
<br />
Despite the headline, OpenSource.com goes beyond 3 alternatives and also discusses using your console for slide shows with Vimdeck. Very interesting!<br />
<br />
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.RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-56175759195974640122015-07-15T07:33:00.000-07:002015-07-16T07:09:17.925-07:00If I HATE web lists so much - why do i click on them?!I hate web lists. I really do. Especially the ones that list things ONE-AT-TIME so you have to load a page that is 90% ads. Irritating! But, I saw one about "America's Top 100 Colleges". I work at a University - I wondered if we made the top 100. So, I took the bait.<br />
<br />
First I am sent to a page telling me what the list is about WITH LOTS OF ADS and a NEXT button. I click NEXT. Ok, number 1, lots of ads another NEXT button. This has already gotten old for me. I was just curious what the top 100 colleges were - can't they just show me a list?!<br />
<br />
So, I think to myself "I wonder if I could just harvest the list from the website with Perl. I look at the URL - I see what they're doing - simply incrementing the folder by 1 each time. Easy! Next I look at the source code: TOO EASY! They have only the STRONG tag once per page for the school name. Cool! So, two minutes of code and then: Tah-dah!<br />
<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">#!/usr/bin/perl -w</span><br />
<span style="font-family: "Courier New",Courier,monospace;"># Remember - this took two minutes, I know it's not perfect</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">use LWP::Simple;</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">my $rank=100;</span><br />
<span style="font-family: "Courier New",Courier,monospace;">my $base="http://www3.forbes.com/forbeswoman/americas-top-100-colleges/";</span><br />
<span style="font-family: "Courier New",Courier,monospace;">while ($rank >0) {</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> my $url = $base . "/$rank/";</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> my $html = get($url);</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> $html =~ m{</span><p><strong>(.*)</strong></p><span style="font-family: "Courier New",Courier,monospace;">}</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> </span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span></span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span></span></span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span></span></span></span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span></span></span></span></span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span></span></span></span></span></span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span></span></span></span></span></span></span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span></span></span></span></span></span></span></span><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span></span></span></span></span></span></span></span>} or die "Cannot find school: $rank\n";</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> $school = $1;</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> print "$rank: $school\n";</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> $rank--;</span><br />
<span style="font-family: "Courier New",Courier,monospace;">}</span><br />
<br />
I run it. It doesn't work (I think). It isn't changing the name. Hmmm. I keep killing it off before it finishes and examine the code. I cannot see a problem so let it run - this time all the way to the end. It does NOT change the name until it counts down to 50. Wild! I check the site - sure enough - there are no new schools after 50. This is a list of the (alleged) Top 50 Colleges going under the name Top 100 Colleges.<br />
<br />
Ha! I guess they never thought anyone would ever have the patience to wade through all of those ads to see all 100 (I sure didn't). This makes me wonder: Is it just a scam to get you to click through ads or did the content creator tell his boss he put all 100 pages up there knowing NO ONE would ever click through all of that. If it's the latter - sorry buddy (or lady) for exposing you.RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com3tag:blogger.com,1999:blog-5363581792338880814.post-10141956485297847862015-03-17T14:35:00.000-07:002018-02-12T11:56:24.433-08:00Switching Red Hat Linux to Oracle Linux<h3>
<span style="font-family: inherit;"><span style="font-size: small;">Normally, I'd rather fight than switch, but... </span></span></h3>
<span style="font-family: inherit;"><span style="font-size: small;">I recently decided to switch all of my Linux systems to Oracle Linux. Why, you may ask? Because I thought it was simpler. Here's why: </span></span><br />
<br />
<span style="font-family: inherit;"><span style="font-size: small;">I was using Red Hat Enterprise Linux for some systems and CentOS for others and still Oracle Linux for Oracle systems. I even had a couple Ubuntu servers. I really like Red Hat flavored package management but I really preferred CentOS. It tended to be easier to work with and have a lot more packages available in the repositories without adding any more. </span></span><br />
<br />
<span style="font-family: inherit;"><span style="font-size: small;">I used Red Hat Enterprise Linux in super critical places where the users demanded a corporate support contract. Over time, I came to find it constraining and it was quite a bit different than the CentOS I was using.</span></span><br />
<br />
<span style="font-family: inherit;"><span style="font-size: small;">As for Oracle Linux, I used it for Oracle (of course). Oracle Linux had an RPM that setup the Oracle DBMS environment (including kernel tuning). It was just a lot easier and was almost identical in feel to CentOS (which I was very used to). And then I discovered ULN (Unbreakable Linux Network) and KSplice! Now I could leave my systems up even when patching the kernel. Amazing!</span></span><br />
<span style="font-family: inherit;"><span style="font-size: small;"><br /></span></span>
<span style="font-family: inherit;"><span style="font-size: small;">So now I could use Oracle Linux where I used CentOS (and pay nothing!) or use Oracle Linux and pay for the hypervisor and get all VMs free and get KSplice live kernel patching. RHEL did not offer this and wanted to charge a separate license for each VM. (Plus, Red Hat really didn't seem focused on the small higher ed market).</span></span><br />
<br />
<h3>
CentOS to Oracle Linux </h3>
<span style="font-family: inherit;"><span style="font-size: small;">To convert CentOS to Oracle Linux was really, really easy. Oracle has shell script: <span class="command">centos2ol.sh.</span></span></span><br />
<h2>
<span style="font-size: small;"><span style="font-family: "courier new" , "courier" , monospace;"></span></span></h2>
<blockquote class="tr_bq">
<div class="programlisting">
<span style="font-size: small;"><span style="font-family: "courier new" , "courier" , monospace;"># <span class="userinput"><code>curl -O https://linux.oracle.com/switch/centos2ol.sh</code></span> </span></span></div>
<div class="programlisting">
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: small;"># <span class="userinput"><code>sh centos2ol.sh</code></span></span></span></div>
</blockquote>
<pre class="programlisting"><span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: small;"><span class="userinput"><code></code></span></span></span></pre>
<h3 class="programlisting">
<span style="font-family: inherit;"><span style="font-size: small;"><span class="userinput"><code></code></span></span></span><span style="font-family: inherit;"><span style="font-size: small;"><span style="font-size: large;">Red Hat to Oracle Linux</span> </span></span></h3>
<div class="programlisting">
<span style="font-family: inherit;"><span style="font-size: small;">To convert Red Hat, however, is quite a bit more steps but fairly easy as well. </span></span></div>
<div class="programlisting">
<br /></div>
<div class="programlisting">
<span style="font-family: inherit;"><span style="font-size: small;">The first thing is to remove all of the Red Hat licensing. I shotgunned that with all of these commands:</span></span></div>
<div class="programlisting">
<span style="font-family: inherit;"><span style="font-size: small;"> <span style="font-family: "courier new" , "courier" , monospace;"> </span></span></span></div>
<blockquote class="tr_bq">
<div class="programlisting">
<span style="font-family: inherit;"><span style="font-size: small;"><span style="font-family: "courier new" , "courier" , monospace;"># subscription-manager list --consumed<br /># subscription-manager remove --all<br /># subscription-manager config --rhsm.manage_repos=0<br /># subscription-manager list --consumed<br /># subscription-manager remove --serial=[insert serial number]</span></span></span></div>
</blockquote>
<div class="programlisting">
<span style="font-family: inherit;"><span style="font-size: small;"><span class="userinput"><code><br /> </code></span></span></span><br />
<div class="programlisting">
<span style="font-size: small;"><span style="font-family: inherit;">Next was a bit complicated since the default install did not have wget and was not in the default repository. I used Perl and the Perl module LWP:</span></span></div>
<div class="programlisting">
<br /></div>
<blockquote class="tr_bq">
<div class="programlisting">
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: small;"> </span>#!/usr/bin/perl -w<br />use LWP::Simple;<br />getstore('https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6','/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle');<br />getstore('http://public-yum.oracle.com/public-yum-ol6.repo','/etc/yum.repos.d/public-yum-ol6.repo');<br />getstore('http://linux-update.oracle.com/rpms/ULN-CA-CERT','/usr/share/rhn/ULN-CA-CERT');</span></div>
</blockquote>
<div class="programlisting">
<br /></div>
<div class="programlisting">
<span style="font-family: inherit;"><span style="font-size: small;">This worked nicely, not having wget, and I was ready to edit the configuration files. First, note the following changes in /etc/yum.repos.d/public-yum-ol6.repo.</span></span></div>
<div class="programlisting">
<br /></div>
<blockquote class="tr_bq">
<div class="programlisting">
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: small;">[ol6_u6_base]<br />name=Oracle Linux $releasever Update 6 installation media copy ($basearch)<br />baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/6/base/$basearch/<br />gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle<br />gpgcheck=1<br />enabled=1 <<==== changed from 0 to 1</span></span></div>
</blockquote>
<div class="programlisting">
<span style="font-family: inherit;"><span style="font-size: small;"><br /></span></span></div>
<div class="programlisting">
<span style="font-family: inherit;"><span style="font-size: small;">Do the same for _latest and _add_ons.</span></span></div>
<div class="programlisting">
<br /></div>
<div class="programlisting">
<b><span style="font-family: inherit;"><span style="font-size: small;">Now edit </span></span>/etc/sysconfig/rhn/up2date and change /usr/share/rhn/RHNS-CA-CERT to sslCACert=/usr/share/rhn/ULN-CA-CERT. Also, change serverURL setting from https://xmlrpc.rhn.redhat.com/XMLRPC to https://linux-update.oracle.com/XMLRPC.</b></div>
<div class="programlisting">
<br /></div>
<div class="programlisting">
Now run:</div>
<blockquote class="tr_bq">
<div class="programlisting">
<span style="font-size: small;"><span style="font-family: "Courier New", Courier, monospace;"># yum clean all && yum clean metadata && yum clean dbcache && yum makecache</span></span><br />
<span style="font-size: small;"><span style="font-family: "Courier New", Courier, monospace;"><span style="font-family: "Courier New",Courier,monospace;"># yum repolist<br /># yum list<br /># yum update</span></span></span></div>
</blockquote>
<span style="font-family: inherit;">You will see:</span><br />
<br />
<span style="font-family: inherit;"><i>[blah blah]...</i></span><br />
<blockquote class="tr_bq">
<span style="font-family: inherit;"><span style="font-family: "courier new" , "courier" , monospace;">warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY</span></span><br />
<span style="font-family: inherit;"><span style="font-family: "courier new" , "courier" , monospace;">Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle</span></span><br />
<span style="font-family: inherit;"><span style="font-family: "courier new" , "courier" , monospace;">Importing GPG key 0xEC551F03:</span></span><br />
<span style="font-family: inherit;"><span style="font-family: "courier new" , "courier" , monospace;"> Userid: "Oracle OSS group (Open Source Software group) <build oss.oracle.com="">"</build></span></span><br />
<span style="font-family: inherit;"><span style="font-family: "courier new" , "courier" , monospace;"> From : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle</span></span><br />
<span style="font-family: inherit;"><span style="font-family: "courier new" , "courier" , monospace;">Is this ok [y/N]: y</span></span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: inherit;"> <span style="font-family: "courier new" , "courier" , monospace;"> </span></span><span style="font-family: "courier new" , "courier" , monospace;"> ...<br />Replaced:<br /> redhat-logos.noarch 0:60.0.14-1.el6 <br /><br />Complete!</span></blockquote>
<span style="font-size: small;"><span style="font-family: inherit;">Now reboot and then login and check it out!</span></span><br />
<br />
<blockquote class="tr_bq">
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: small;"># cat /etc/redhat-release <br />Red Hat Enterprise Linux Server release 6.6 (Santiago)</span></span></blockquote>
<span style="font-size: small;"><span style="font-family: inherit;"><br /></span></span>
<span style="font-size: small;"><span style="font-family: inherit;">But we really know it's: </span></span><br />
<br />
<blockquote class="tr_bq">
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: small;"># cat /etc/oracle-release <br />Oracle Linux Server release 6.6</span></span></blockquote>
<h3>
OPTIONAL</h3>
I really like EPEL so:<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: "courier new" , "courier" , monospace;"># perl -MLWP::Simple -e "getstore('http://mirrors.cat.pdx.edu/epel/6/x86_64/epel-release-6-8.noarch.rpm','epel-release-6-8.noarch.rpm');"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: small;">(feel free to use wget if you've got it)</span></span></blockquote>
<h3>
QUESTIONS</h3>
Q: Will I have to relabel for SELinux?<br />
<br />
No, I'm asking you. Not sure, but so far so good so probably not or I'd have noticed an issue by now.<br />
<br />
<h3>
BUGS</h3>
[Still trys to look to Red Hat but fails]<br />
....<br />
Loaded plugins: product-id, rhnplugin, subscription-manager<br />
There was an error communicating with RHN.<br />
RHN Satellite or RHN Classic support will be disabled.<br />
Error communicating with server. The message was:<br />
Sysid checksum is incorrect<br />
<blockquote class="tr_bq">
</blockquote>
<div class="programlisting">
Also, AFTER REBOOT, this annoying nag IF you didn't buy a subscription:<br />
<br />
[root@oats ~]# yum update<br />
Loaded plugins: product-id, rhnplugin, subscription-manager<br />
There was an error communicating with ULN.<br />
ULN support will be disabled.<br />
Error communicating with server. The message was:<br />
Sysid checksum is incorrect<br />
Setting up Update Process<br />
No Packages marked for Update</div>
<div class="programlisting">
<br /></div>
<h3 class="programlisting">
CONCLUSION</h3>
<div class="programlisting">
As you know, I like it. I get to use Oracle Linux on the small one-offs for free and I have a half dozen systems that will enjoy KSplice - the rest get a basic subscription. Well, that's my opinion (for now).</div>
</div>
RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com4tag:blogger.com,1999:blog-5363581792338880814.post-6168128408584097882015-03-02T10:32:00.001-08:002015-03-02T10:32:58.888-08:00Book Review: Perl and XMLRecently, I pulled out my (mostly) unread copy of <a href="http://shop.oreilly.com/product/9780596002053.do" target="_blank">Perl and XML</a> and rather than using it as a reference, began reading the entire thing starting with the Preface. It was a very enjoyable read. The fact that I enjoyed reading it so much was a surprise to me - who would've thought it possible? I had worked with XML and RSS and LDIFs for a dozen years. In the past, I basically just did a quick google and then thought "Yeah, there's the module I need" and installed it an ran with it.<br />
<br />
This book explained the differences in the many modules and explained when and where to use them. After nearly eight years I had an "Ah-hah! That's why that program sometimes didn't always catch everything I was looking for!" (I was using a <a href="http://search.cpan.org/~grantm/XML-Simple-2.20/lib/XML/Simple.pm" target="_blank">generic XML parsing module</a> when I should've been using <a href="http://search.cpan.org/~tjmather/XML-DOM-1.44/lib/XML/DOM.pm" target="_blank">XML::DOM</a>. <br />
<br />
My only criticism (a minor one) is I would have liked to have seen more and varied examples in the RSS chapter. But, it was an XML book, not a RSS book and the goal was not to show you the difference between Atom and iTunes in RSS feeds, etc. <br />
<br />
If you use XML and Perl - you will want to READ this book. Note: I said READ this book. Don't just buy it as a reference and put it on your shelf like I did (at first). In fact, <b>everyone</b> reading this should buy it! (It's only <a href="http://www.amazon.com/gp/offer-listing/059600205X/ref=dp_olp_used?ie=UTF8&condition=used" target="_blank">one penny on the used market at Amazon.com</a>. Why not?!)RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-3762977959208094182013-06-14T07:55:00.002-07:002013-06-14T07:58:50.921-07:00YAPC::NA 2013 Austin, TXAnother great <a href="http://blog.yapcna.org/" target="_blank">YAPC</a> has come and gone. What a great bunch of folks! Although there were some great sessions, so far, my favorite was <a href="https://new.livestream.com/accounts/3585172/events/2037842/videos/20567978" target="_blank">Mark Keating's keynote</a> - specifically his advice to "<a href="http://www.amazon.com/gp/offer-listing/1118013840/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1118013840&linkCode=am2&tag=robertspage-20" target="_blank">buy this book</a>". I really didn't think I needed another Perl book - especially one that says "beginning" in the title. But I looked at it anyway. This is without a doubt the most complete "beginning" Perl book I've ever seen. He covered things like the Perl community - which you don't see treated so extensively. There was coverage of POD (which I love). Of course it had whole chapter on OOP and one on creating modules - not typically what you'd call "beginning" Perl... And then I saw a chapter on Moose and had to buy it. It looks to be fun summer reading for me.RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-86070716597116529782012-12-10T11:21:00.002-08:002012-12-10T11:21:17.739-08:00RCS and PODI've recently starting trying to use <a href="https://en.wikipedia.org/wiki/Plain_Old_Documentation" target="_blank">POD</a> for documenting more. I love <a href="http://www.cs.purdue.edu/homes/trinkle/RCS/" target="_blank">RCS</a> so combining the two not only made sense but I found they compliment each other nicely. I like that you can generate a <a href="http://search.cpan.org/~gsar/perl/pod/pod2man.PL" target="_blank">man page</a> or <a href="http://perldoc.perl.org/pod2html.html" target="_blank">HTML</a> from POD and you can use RCS variables to fill out part of the POD. Here's my new <a href="http://www.silug.org/~robert/perl/dev/PerlSlurpTemplate.txt" target="_blank">file slurping template</a> incorporating RCS and POD.<br />
<tt></tt><br />
<br />
<pre>#!/usr/local/bin/perl -w
=pod
=head1 NAME
$Id$
=head1 VERSION
$Revision$
=head1 DESCRIPTION
$Header$
=head1 REVISIONS
$Log$
=cut
$in = shift;
open(IN,"<$in") or die "Cannot open $in: $!\n";
while(<in>){
# meow
print $_;
} </in></pre>
<pre></pre>
RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-37340764682744017842012-03-07T14:45:00.000-08:002012-03-07T14:45:23.529-08:00Inspired by the new iPad ...Okay, I can't take credit for it. The Onion had this great <a href="http://is.gd/P7wrWx">story about the amazing power of the iPad</a>. That made me think - I wonder if you can could now use Perl on the new iPad from Apple. I'm still not sure. But, you can read several of your <a href="http://itunes.apple.com/us/app/intermediate-perl/id333215863?mt=8">favorite books</a> on the new Apple iPad. I couldn't really find anyone scripting Perl on the new Apple iPad so not much more to say except to quote The Onion "new iPad, new iPad, new iPad, new iPad, new iPad, new iPad, new iPad, new iPad, new iPad, new iPad." RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com4tag:blogger.com,1999:blog-5363581792338880814.post-66775834958174084672011-12-21T14:48:00.000-08:002011-12-21T14:48:59.839-08:00Lost in WindowslandFor 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 <a href="http://technet.microsoft.com/en-us/scriptcenter/dd742419">Powershell</a> and have been using it a bit for things. With the addition of <a href="http://www.vim.org/download.php#pc">gVim</a>, I am finding Windows to be more and more comfortable. (gVim is a lifesaver!) <br />
<br />
Another thing I use is <a href="http://strawberryperl.com/">Strawberry Perl</a>! 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!<br />
<br />
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?<br />
<br />
-------<br />
* I went directly from being the Netware guy to being the UNIX guy and skipped the Windows NT, etc.RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-75870493515874297582011-06-29T10:52:00.000-07:002011-06-29T11:36:03.818-07:00Excellent YAPC::NA (for me)Wow! A lot has changed since last year. It seems like this year was an emphasis on Perl 5 (which is fine by me). It looks like developement on Perl 5 has really picked up. There is a <a href="http://perlnews.org/2011/06/learning-perl-6th-edition-is-now-available/">6th edition of Learning Perl</a> out which emphasizes Perl 5.14! (I'm waiting on the Kindle Edition) I found out that most people are using Perl 5.12. My old Solaris systems have 5.8 and I'm not even using any of the cool stuff from 5.10 yet. I'm excited to start after seeing so many examples of things I've been missing out on. <a href="http://www.perlbrew.pl/">PerlBrew</a> should help with this and I need to start using cpanm.<br />
<br />
Notes and reminders<iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=robertspage-20&o=1&p=8&l=bpl&asins=1449303587&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe>: Look into <a href="http://search.metacpan.org/#/showpod/Test::More">Test::More</a>, <a href="http://search.metacpan.org/#/showpod/Mouse">Mouse</a>, <a href="http://search.cpan.org/dist/App-cpanminus/bin/cpanm">cpanm</a>, <a href="http://www.perlbrew.pl/">PerlBrew</a>, <a href="http://search.metacpan.org/#/showpod/ZeroMQ">ZeroMQ</a>, <a href="http://search.metacpan.org/#/showpod/Plack">Plack</a>, <a href="http://perldancer.org/">Dancer</a>, <a href="http://search.cpan.org/%7Emiyagawa/Starman-0.1000/lib/Starman.pm">Starman</a>, <a href="http://mongrel2.org/static/mongrel2-manual.html">Mongrel2</a>, <a href="http://www.catalystframework.org/">Catalyst</a> and, as usual, make a point to spend more time on <a href="http://www.irc.perl.org/">#perl</a> and <a href="http://www.perlmonks.org/">PerlMonks</a>.<br />
<br />
The interesting thing was Larry Wall's handling of the Perl 6 and the pumpkings. I have a feeling this year's State of the Onion will be jaw dropping.<br />
<br />
Really good conference - even better than last year (for me). I'm loving the Perl 5 emphasis!RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com2tag:blogger.com,1999:blog-5363581792338880814.post-51450078060843794752011-06-15T09:25:00.000-07:002011-06-15T09:25:15.375-07:00Looking forward to YAPC::NAI am really looking forward to <a href="http://www.yapc2011.us/yn2011/">YAPC::NA</a>. Looks like it'll be another good one. I was especially interested in the <a href="http://www.yapc2011.us/yn2011/talk/3294">Plack</a> and <a href="http://www.yapc2011.us/yn2011/talk/3153">Dancer</a> talks (which are not yet confirmed according to the site). If you see Tatsuhiko Miyagawa or Mark Allen - tell them I'm counting on them! <iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=robertspage-20&o=1&p=8&l=bpl&asins=0321496949&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe>RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-41012379924920700122011-05-18T06:49:00.000-07:002011-05-18T06:49:43.258-07:00Perl, I didn't know you could do thatI happened to be clicking around and saw Perl.com had an entry called <a href="http://www.perl.com/pub/2011/04/writing-on-walls-with-facebookgraph.html">Writing on Walls with Facebook::Graph</a>. Neat! It was preceded by <a href="http://www.perl.com/pub/2011/03/facebook-authentication-with-perl-and-facebookgraph.html">Facebook Authentication with Perl and Facebook::Graph</a>. I made a mental note to remember that and then Linux Magazine sent an article called <a href="http://www.linux-mag.com/id/8705/">FBCMB: Command Line for Facebook</a>. Although somewhat unrelated, that sent me off to look for more Perl modules for Facebook only to find someone had already covered it in a blog entry called <a href="http://thomasthurman.org/writing-a-facebook-application-in-perl">Writing a Facebook Applications in Perl</a>.<br />
<br />
Anyway, if, like me, you didn't know there was a lot of Perl resources for Facebook - now you do. <iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=robertspage-20&o=1&p=8&l=bpl&asins=B001EN71CW&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe>RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com1tag:blogger.com,1999:blog-5363581792338880814.post-946488441254548982011-04-20T11:40:00.000-07:002011-04-20T11:40:09.290-07:00CPAN to the rescueI needed a quick tool to change HTML to <a href="http://perldoc.perl.org/perlpod.html">POD</a>. I coulda sworn I had a html2pod utility at the command line - nope - must've been that other Linux distro. No worries - I just grabbed <a href="http://search.cpan.org/%7Esburke/Pod-HTML2Pod-4.05/lib/Pod/HTML2Pod.pm">Pod::HTML2Pod</a> and with very little modification to the example code I had just what I wanted.RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-53278106489509856882011-03-04T07:18:00.000-08:002011-03-04T07:18:24.250-08:00Mac OSX and CGI.pm"I'm NOT a web developer!" I've been saying that a lot lately. Even so, because I have done a bit of LDAP programming and they needed a web interface, I wrote a quick hack which turned into a big, long painful project. The biggest issue is so many things don't work the same (or at all) on Mac OSX. OpenLDAP, for instance (a whole other story). [It should be noted - I'm also not a Mac guy.]<br />
<br />
<a href="http://dilbert.com/strips/comic/2011-02-16/" title="Dilbert.com"><img alt="Dilbert.com" border="0" src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/100000/10000/3000/000/113035/113035.strip.gif" /></a><br />
<br />
I tried for several days to get CGI.pm redirects and refreshes to work but kept getting Error 302's. I found lots of people with the same issue on the Mac. Finally - someone said "You'll have to write it without CGI.pm because it doesn't 100% work on the Mac (and/or maybe the Apple Apache config was incriminated). Anyway, I rewrote the redirects without CGI.pm (ugly, inelegant Perl 4ish looking code) and it worked fine.<br />
<br />
Since I never exactly found the answer - I want to state for future folks looking for an answer - "IT DOESN'T WORK RIGHT ON A MAC" (this phrase can be re-used for a great many things). And, if I'm wrong (because, remember, I'm not a web developer) it'd be great for someone to comment with the right answer.<br />
<br />
I'll probably get comments such as "You're using CGI.pm for web development?! Are you from the past?!" To this I would say "Yes I am".RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com2tag:blogger.com,1999:blog-5363581792338880814.post-20946825949652355732011-02-21T14:18:00.000-08:002011-02-21T14:18:26.296-08:00SDL and PerlI missed this article from Perl.com last month: <a href="http://www.perl.com/pub/2011/01/visualizing-music-with-sdl-and-perl.html">Visualizing Music with SDL and Perl</a>. It caught my eye be<iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=robertspage-20&o=1&p=8&l=bpl&asins=1593271867&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe>cause I've just recently read <a href="http://www.amazon.com/Book-Xen-Practical-System-Administrator/dp/1593271867">The Book of Xen</a> (great book, btw) and it mentioned SDL as an alternative to, say, vnc, which sent me off looking up more about <a href="http://www.libsdl.org/">SDL</a>. Anyhoo, the code looks like fun and uses concepts that could come in handy - especially if I ever get around to writing a video game (kidding - not likely to make it down that far on the list in this lifetime). So check it out - there's still lots of cool things going on with Perl all the time.RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com1tag:blogger.com,1999:blog-5363581792338880814.post-59102771002698783252010-10-21T07:39:00.000-07:002010-10-21T11:38:12.220-07:00Really good Perl book under a secretive title<iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=robertspage-20&o=1&p=8&l=bpl&asins=B0043EWTTE&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe>Since I've been doing a lot of LDAP programming lately, I finally broke down and bought O'Reilly's <u>LDAP System Administration</u>. I found a used paperback for $4! While I was waiting, I got impatient and bought the Kindle version for my Android phone. I just bought it for the LDAP ACL info but I was thrilled to see chapter 10 was devoted to Perl-LDAP. It explained a lot of things in the Perl-LDAP example code that I hadn't seen explained before (I'm sure it's out there but the author has done a nice job of digging it all up and putting it together). Anyway, if you're looking for a nice LDAP book, this is looking like a good one so far (still reading).RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com4tag:blogger.com,1999:blog-5363581792338880814.post-60733530879542180062010-08-16T12:36:00.000-07:002010-08-16T13:12:42.177-07:00New technology I'm Working On<iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=robertspage-20&o=1&p=8&l=bpl&asins=1593271867&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe>I find that people often think because I work primarily on UNIX/Linux <i><b>and still use Perl that </b></i>I'm not learning anything new or that I do not like learning. Nothing could be further from the truth. I love new technology and I'm always learning something new.<br />
<br />
<b>Here's what I've been working on in the last year:</b><br />
<br />
<ul><li>Solaris <a href="http://myratnest.blogspot.com/2010/03/working-with-solaris-10-zones.html">Zones</a> and Containers</li>
<li>Solaris Zetabyte File system (<a href="http://myratnest.blogspot.com/search/label/zfs">ZFS</a>)</li>
<li>GNU Screen</li>
<li><a href="http://yesistilluseperl.blogspot.com/2010/04/programming-for-kids.html">Ruby</a></li>
<li><a href="http://yesistilluseperl.blogspot.com/2009/11/dsee-for-solaris-10x86-on-opensolaris.html">More</a> <a href="http://yesistilluseperl.blogspot.com/2009/07/use-netldapldif-no-really-use-it.html">Perl LDAP programming</a></li>
<li>More Perl programming in general </li>
<li><a href="http://yesistilluseperl.blogspot.com/2009/07/finally-installed-perl-6.html">Rakudo</a> (a Perl 6 distro)</li>
<li>PUGS (another Perl 6 distro)</li>
<li><a href="http://myratnest.blogspot.com/search/label/sqlite">SQLite3</a> and <a href="http://yesistilluseperl.blogspot.com/2010/08/perl-and-sqlite.html">Perl</a></li>
<li><a href="http://yesistilluseperl.blogspot.com/2010/02/love-new-system-admin-wperl-book-and.html">RCS</a> (Revision Control System) </li>
</ul><b>Here's the list of what I hope to cover this year VERY SOON:</b><br />
<ul><li>Solaris LDOMs (need a lab experiment)</li>
<li>See how ZFS is implemented under other OS's (e.g. FreeBSD)</li>
<li>Use More Ruby! (and I'm looking at a Rails book from the library)</li>
<li>Juniper's JunOS (I like the XML and the idea of scripting with Perl)</li>
<li>MORE Rakudo!! (Not so much Pugs) I hope to contribute bug reports</li>
<li>Sun's Dtrace (especially using Perl and Dtrace)</li>
<li>Xen and Linux - need a lab experiment</li>
<li>Btrfs - Linux's answer to ZFS? Need to explore in a lab. </li>
<li>Lots more SQLite (I really like that tool)</li>
</ul> <b>And, of course, my on going quests: (not necessarily in this order)</b><br />
<ul><li>Python (Because Zope runs on it!)</li>
<li>Plone (runs on Zope)</li>
<li>C - need to refreshen my C programming skills - getting rusty</li>
<li>Java </li>
<li>Command line Sun VirtualBox</li>
<li>I'm sure there's a few more...</li>
</ul>Anyway, this list keeps me pretty busy without doing anything much with any Windows projects. I can get around fine, IMO, on Windows. Just because I don't have any Windows projects on my plate doesn't mean I'm not learning anything new. Besides - aren't there plenty of others focusing JUST on Windows?<br />
<br />
I'm pretty excited about my list (above) and do as much reading and experimenting as time permits. It sure seems to me that I'm learning new stuff - Well, I'm learning things that interest me. I guess because non-Windows things don't interest some I guess it appears that I'm not learning anything (that interests <i>them</i>). Oh well. Can't please everyone and I stopped trying long ago.RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com1tag:blogger.com,1999:blog-5363581792338880814.post-85498771110808228312010-08-05T12:20:00.000-07:002010-08-05T12:20:49.648-07:00Perl and SQLiteFinally got around to finishing my little SQLite and Perl program. To speed things up, I used a shell script with remote SSH commands to grab the data, then used Perl to stuff it into SQLite. Very cool! Need to use Perl's Net-SNMP on next version but this was mainly an excuse to use SQLite. Glad I did. There's a lot of strangeness - can't get used to putting a dot in front of commands and many of my favorite SQL commands are missing or renamed. Still - SO COOL to be able to create a database on the fly like that. <iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=robertspage-20&o=1&p=8&l=bpl&asins=1590596730&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe><iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=robertspage-20&o=1&p=8&l=bpl&asins=0557076765&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe><iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=robertspage-20&o=1&p=8&l=bpl&asins=0596521189&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe>RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com0tag:blogger.com,1999:blog-5363581792338880814.post-34213037383988896242010-07-10T11:15:00.000-07:002010-07-10T11:15:24.311-07:00Nifty Perl HackI threw together a tiny bit of code with the example code from Net::IMAP::Simple to make a program that watches for Mailman unsubscribe messages, logs them, then deletes the message. It was a 5 minute job (except for the part where my iteration was off by one and kept deleting the wrong message). Perl is so handy for things like this.RAThttp://www.blogger.com/profile/10116429541709326996noreply@blogger.com1