FTP Using a One-Liner and Perl Script

by esofthub on Monday 30 June 2008

A colleague of mine, Mahlon Anderson, wanted to revisit the FTP Using a Shell Script post.

Here is what he had to say…

Here is a creative way to put an FTP command on a single line. Why one line? The short story is I needed to do an ftp in a crontab without calling another script.

Three things to note:

1) I have only tested this with Solaris 8.

2) This works in the one true shell, Bourne shell.

3) If you have a “$” in your password, it might cause you problems.

Use this in a Perl script. (I didn’t have access to the CPAN FTP module)

# vi myftp.pl

#!/usr/bin/perl

$USER = “esoft”;

$PASSWORD=”myftp125”;

$REMOTE=”esoft”;

$DIR=”/jpg_dir;

$FILE=”esoft.jpg”;

$echo = ‘echo “quote user ‘ . $USER. ‘\nquote pass ‘ . $PASSWORD .’\nbin\nlcd ‘ . $DIR . ‘\nmput $FILE\n”’;

@status = ‘$echo| ftp –nv $REMOTE‘;

print @status;

:wq!

The FTP module is for doing FTP directly with Perl…basically system calls to the C library directly. With the right modules, you can do all that from Perl without having to resort to the back quotes.

Run via CLI

# ./myftp.pl



Show HTML Tags Within a Blogger Post

by esofthub on Sunday 29 June 2008

Previously, I was having issues displaying HTML tags within a Blogger post. To get around that pesky issue, I used an underscore, e.g. <_head>,<_title>, <_file>, etc, or generated a jpg image of the example to demonstrate the use of a particular tag. But this action made it inconvenient to simply cut and paste without the arduous task of retyping or modification. Now I am using the textarea tag and it seems to be working fine with the Blogger platform.

Note: If you get the following error message when publishing/saving: “Your HTML cannot be accepted: Tag is not allowed: <_whatever_tag>“, check the box to ignore.

Here is an example run that is followed by the parameters used for the textarea.




time for a new post

by jamesd_wi on Saturday 28 June 2008

Well its time for another post, june has been a busy month.

Lots and lots of rain, seemed like it was fall more than spring/summer this year, are basement had a little water, maybe a gallon total, seeped in through the outside cellar door. Pretty awesome that is all we got this is a 100+ year old house.

Had my 21st wedding aniversary on the 20th.

Learned lots of stuff at work, where I am torchured by SCO unix and Cobol. I am the official administrator of the SCO unix box, yes I feel dirty but it pays the bills. I have never been a SCO admin before in fact the last time I had used SCO was at a site called deepthought.(org or net or something, it was a 386 DX40 with 4MB of ram that had 6 phone lines and 1/2 an isdn connection to the net it was located in Santa Cruz, CA. ) and I was just a user, but that box did lead to me getting into Linux this was back in the 1.0.9 days. yes it was that long ago. The other major part of my job is that the SCO box runs COBOL apps, back when I was back in college, 15+ years ago, I had the option of taking COBOL, but I said why should I its a dead language, now 15 years later I am now the admin of a box that now mainly runs COBOL, and since i have gotten there I have fixed a few cobol bugs, even though I don’t know the language. Life is strange. Of course I am also learning more and more Microsoft stuff, since 90% of the other machines I work with are Windows boxes with more than a few running MS SQL, so I have getting lots of experience. So this is great for my resume. They do have a couple Solaris boxes.

The latest thing we are doing is moving more and more towards AIX, we have one AIX box currently, a p520 yes its power6. We also have 6 more on the way that will be running oracle and apache.

Which leads me to why you probably wont to hear much from me in July, I allready have a 4 day training session scheduled plus I will still have to keep the other boxes up and running.

Well that is what I have been upto, I hope I will post at least once more this month.



Know field exit with implementation of field exit

by Pramita Singh on Saturday 28 June 2008


Compiling

by Wim on Thursday 26 June 2008

This is my explanation from now on: I’m compiling.


Copyright © 2010 IT Knowledge Hub | Advertise | Contact | Privacy Policy | Terms of Use | Register