Tuesday, January 17, 2012

Stop SOPA / PIPA

Links to this post

For some time, the copyright abuse industries (primarily music and movies, but also newspaper and book publishers), have been plying politicians with campaign cash. Their objective has been to force everyone to continue paying them large sums of money. I haven't the time to find and link some of the stories of takedown notices against videos of toddlers dancing because of the music that was in the background or attempting to collect fees against auto repair shops if the music in the repair bays is audible in customer areas.

Recently, many in the technology fields noticed that PIPA (Protect IP Act) and its twin SOPA (Stop Online Piracy Act) included some requirements that would completely break the Internet as we know it.

I ask you, if you are a US citizen who is old enough to vote, to register and to contact your elected officials (your two senators and one representative, as well as the President) and urge them to prevent this from passing. Please remember to vote against anyone who supports these bills.

Thank you.

Saturday, March 13, 2010

Starting Over: Rexx As Enhanced Shell Scripting

Links to this post

I can hardly believe that it has been over a year since my last posting. I spent 8 months in Missouri, working six days a week, ten to twelve-plus hours per day. Since Rexx is not allowed in my employer's work environment, that meant little or no time to even look at the language. On top of that, I'm very much a beginner with this language. This blog is sort of a way of recording my journey and showing others how to get somewhere with it. And, of course, the resources to pick up the language are sparse and getting sparser.



Even so, I haven't done all that I could to learn the language. My earlier attempts used Regina Rexx--in part, because it is available in the Ubuntu repositories--which actually follows the standard well enough so that most of the examples you'll find in books will work. The problem I found there is that the language itself is rather thin in some areas. This is understandable, because the language was designed from the beginning as glue, to take the available tools that already exist and to chain them together into something that provides desired functionality.



As a cross-platform language, I really wanted something that was more WORA ("write once, run anywhere"). But I found that calling out to the environment necessarily involves platform-specific functionality that has to be rewritten whenever the platform changes. So this isn't the language I wanted, but I think it can still be useful, so let's try and find some uses for it, shall we?



Assumptions


In order for this to work, I have to make some assumptions. So I'm going to assume that you're using a similar environment to mine:



  • Operating system: Gnu+Linux, in particular, I'm running Xubuntu 9.10 64-bit. I'll probably be converting over to ArchLinux in a month or two. Whether you're on a Ubuntu-family OS, Mint, gNewSense, Arch, Debian, Mepis, Fedora, Mandriva, PCLinuxOS, or Suse, it should be pretty much the same.

  • The NetPBM image toolkit package. This is available for various Unix-like operating systems, and also for Windows. It should be available through your distribution's packaging system or from SourceForge. The documentation is online.

  • ooRexx, the IBM-derived, object-oriented, open source version of the Rexx language. The current version is 4.0, available from your distribution's packaging system or from SourceForge The oorexx and oorexx-docs downloads are on this page. This could potentially work with Regina Rexx or another version, but this is what I'm using.

  • Your $PATH variable is set properly, so that the above software list is available on your path.



Task 1: E-Mail Protection


As we all know, there are software "bots" that scan the Web, looking for e-mail addresses to add to the spam targeting lists. Unless you like the flood of "male enhancement" and other spam and scam messages, your best bet is to find another way to put your e-mail address online.



Using NetPBM at the command line, we could do something like this:
pbmtext "yourname@example.com" | pnmtopng >emailimage.png. But unless you use this often, you'll spend more time on NetPBM's doc site than you wish.



#!/usr/bin/rexx
/* emailimage.rex - protect someone's e-mail from some spambots */
/* copyright - none */
/* sends pbmtext "yourname@example.com" | pnmtopng >emailimage.png to shell */

say "Please enter your e-mail address."
parse pull addr
say "Please enter a name for the file."
parse pull flnm

outstring = "pbmtext " addr " | pnmtopng >" flnm ||".png"
outstring

You should have a PNG file in the directory where you ran this script. You can upload it to a web site or find another place to use it. There are some other options which could be set. If you'd like to know more, read the docs for NetPBM.



I am hoping that this is the first of many little things that can help make your life a little easier. I don't currently own any Windows machines, so these examples might not work for Windows users. In particular, on non-Unix platforms, the first line (#!/usr/bin/rexx) should be removed.



Powered by ScribeFire.

Thursday, March 11, 2010

Like Rexx? Consider Following Cosmogrammaticus

Links to this post

If you're interested in the Rexx language, I would encourage you to follow Cosmogrammaticus: http://cosmosgrammaticus.blogspot.com/ . He seems to be the person who is working on the Mac version of ooRexx. (NOTE: The site seems to be down right now--issues with their name server.)

I'm still interested in the language, but I'm very much a beginner with it, and finding that learning resources are slim. In addition, there are many times when I want to do something both on Linux and Windows, but most of the time (since Rexx does a lot of sending commands to the external environment), I wind up having to use platform-specific tools.

So I would encourage you to add Cosmogrammaticus to Google Reader, RSS Owl, or RSS Bandit. He doesn't publish often, but when he does, it is deeper stuff than I write.

Sunday, February 1, 2009

NetREXX Going Open Source

Links to this post

I guess I hadn't been to the Rexx Language Ass'n's front page in a while. IBM announced in April 2008 that they wanted to open source NetRexx. RexxLA has been negotiating it with IBM. I'm looking forward to the announcement. Maybe NetRexx will begin to move closer to OORexx, toward a more or less unified object oriented version of the language.

That is great news!

Saturday, August 9, 2008

New Awakening, Thanks To OORexx

Links to this post

Objects!




In the past several months, I stopped posting much here. In part, it is because of my employment schedule. And in part, it is because many of the things I wanted to do with REXX required platform-specific calls to the system shell. If you are interested in doing things more or less cross-platform, this is a major killer. Additionally, there is no variety of Rexx on the acceptable software list for my employer, so I have little opportunity to do anything practical with it.




On my main "road dog" laptop, which now runs Ubuntu Linux, Regina Rexx was installed from the Ubuntu repositories. I have since removed it and installed Open Object Rexx. My intention is to utilize only OORexx (and possibly NetRexx, even though it appears to be abandoned) from here on out, because of additional functionality built into the language that is not found in Regina or other standard Rexx interpreters. I want to emphasize that it is not an indictment of Regina or other standard Rexx interpreters, but merely a reflection of my desire for WORA cross-platform scripts.




One place where some version of Rexx might be useful is as a drop-in replacement for the somewhat ambiguously named KiXtart, a scripting language for Windows. However, most of my use of KiX is in automating software installation & configuration. KiX has support for editing the Windows registry, and is also a small, movable executable. For example, I might use KiX on a CD of software updates, as a kind of batch script on steroids. I am not yet seeing a case for building such a CD with Rexx instead, even if it was allowable in my workplace.




One area where I have some amount of interest is file format transformations. In the workplace, it is common for one person to send data in MSOffice 2007 formats, while most others use MSOffice 2003 formats, and some use OpenDocument Format(ODF) or WordPerfect Office format. Occasionally, I even run into data in MSWorks format. There are also JPEG, GIF, PNG, SVG, and other image/graphics formats that one might want to transform between. There is little likelihood of my writing a full-featured transformation engine, whether in Rexx or in <insert shiny new language here>, but I do hope to do some minor transformations and to demonstrate them for others who are (like me) just starting on their Rexx journey.




This change has been a long time coming, but it was inspired by a situation I faced two years ago and again last year. A number of people that I dealt with had a common situation: they had a fairly large number of photographs taken over a period of several days that were dumped into their "My Pictures" folder. Inside that folder, they needed to find photos for particular dates or locations in order to associate those photos with content (reports, articles) they were writing. I found it particularly difficult even to find out how to obtain that information in Rexx, while I found it within the same day once I started researching how to accomplish the task in KiX. The biggest issue with KiX was that the solution as implemented was Windows-specific, and some of the need came from Linux users.




Actually, I installed and configured DigiKam for my Linux users, so that photo uploads are automatically placed in date-coded directories. Every couple of months, I manually move these into a ~/year/month hierarchy. (I am planning to write a script to do it and use cron to run it monthly.)




Anyway, consider this a rebirth of interest in this blog and its subject matter. One of my interests is finding ways to use Rexx to automate repetitive tasks in a small business environment, alongside Python, Ruby, REBOL, and so on. The docs are becoming my friends. Also recommended: The Rexx Language (TRL).

Blogged with the Flock Browser

Saturday, March 15, 2008

Love The One You're With

Links to this post

There is an old song by that name, with the message that you cannot always have your own way, so make do with what is available.

In a lot of Windows environments, there is no way to use Regina REXX or OOREXX, because they are not installed. Instead, you may have to use KiXtart or VBScript. If your environment does use Java, try NetRexx as a way to use the REXX-like syntax you like in a package that is approved by the organization.

Too often, we beat our heads against the wall, trying to convince our upline supervisors that they should allow us to us something that we are already familiar with instead of the organization's approved toolset. I want you to know that you are very rarely going to convince management to listen to the employees.

Instead, try to find ways to leverage your existing knowledge and skills with the approved toolset. Perhaps someone should re-implement NetRexx in .Net (C#) as a way to bring it into that environment also.

This is a continuation of the ideas in "Use What You Can".

Wednesday, January 30, 2008

Use What You Can

Links to this post

Many times, we will have a preferred toolset, but be unable to utilize some or all of those tools in our employment environments. You may be thinking, "What can I use in that situation?"

The answer is clear: use what you can. You may have to use NetRexx, if other REXX versions are not on your company's approved list (but Java is). Unfortunately, it looks like it has not been maintained for a while. Hopefully, its Java 1.2 ("Java 2") compatible output will still work correctly under Java 1.5/Java 1.6/Java 1.7 ("Java 5"/"Java 6"/"Java 7"), which is likely to be what you have in your environment.