Native Windows Command

Posted in Windows with tags on August 26, 2008 by triz

Some of you may already know about this native windows command, but I didn’t…  so here it is if anyone is interested

 forfiles -pc:\act -m*.zip -d-7 -c”CMD /C del @FILE”

 The above command will delete zip files from “c:\act” that are older then 7 days.  This would be beneficial when having to delete files that are automatically created but only need to be retained for a certain amount of days.

Busted 6000 hits today…

Posted in Site Info, Uncategorized with tags on June 26, 2008 by triz

/me pats self on back…..

Verify reboot and oracle process with Perl Script

Posted in Linux, Perl Scripts, Tutorials/Whitepapers with tags , , , , on May 22, 2008 by triz

Here is a script I wrote that I will run in cron on the days that we have autosys reboot schedules. The script will check if the server has been rebooted in the last 2 hours and if it’s rebooted in the last 24 hours. It also checks to see if Oracle processes are running. In the case that either the reboot failed or the Oracle processes did restart or aren’t running it will send an e-mail notification to whoever is specified in the @to array variable. Read more »

Change ownership of files and directories with Perl script

Posted in Linux, Perl Scripts, Tutorials/Whitepapers, Windows with tags on May 12, 2008 by triz

I came across this method of changing the ownership of files when working on a DataStage startup/shutdown script and changing the permissions on the logfiles the script creates. So I wrote a simple script that takes a username from input and a file name or multiple names from input and changes the owner and group of that directory. Read more »

A Perl script called logHunter.pl

Posted in Linux, Perl Scripts, Tutorials/Whitepapers, Windows with tags on May 12, 2008 by triz

Ok here is a perl script that is pretty much useless in Linux, becuase linux has the grep command, but I’m a geek so I wrote it anyways. Hey, it could be usefull in windows…lol. So if you haven’t figured it out yet, this script will look thru a file for keywords and only print out the lines that contain the keyword. Of course you could also just output the results to a new file. Read more »

Monitor processes in Linux using Perl script

Posted in Linux, Perl Scripts, Tutorials/Whitepapers with tags on May 12, 2008 by triz

This is another perl script I wrote to monitor critical processes in Linux and report status to log. This script is alot like the earlier script I wrote to check mount points in that it opens a command and write it to a file in order to use regular expressions to check if something is true or not. Also this script can be edited to monitor any number of process and report it any number of ways including syslog, Nagios, or just system mail. Read more »

Check mount points with Perl script

Posted in Linux, Perl Scripts, Tutorials/Whitepapers with tags on May 3, 2008 by triz

Here is my script I wrote to possibly add to the cron job to check and mount… mount points.

#!/usr/bin/perl -w
#
# Name: chkMounts.pl
# written by trizsolo
# Usage: ./chkMounts.pl args args args
#you can check as many mount points as needed
#with arguments or use defaults
################################### Read more »

Alternate Data Streams… WARNING

Posted in Network Security, Tutorials/Whitepapers, Virus Alerts, Windows with tags on April 29, 2008 by triz

I came across this issue today… thankfully my network environement security uses both eTrust and Tripwire, so this should not be a big problem here, but I think it’s should be watched for. Basically, this is a way to hide spyware or incriminating (hacker) tools by casting or forking the file into another file. The original size will show the same and even the actual running process is hidden from process explorers, the only thing that changes is the modification date. Also, this only runs on NTFS and moving the file to another file system will corrupt the hidden file. Read more »

Text Formatting Perl Script

Posted in Linux, Microsoft Office, Perl Scripts, Tutorials/Whitepapers, Windows with tags on April 25, 2008 by triz

Here is a pretty basic Perl script that will take a tab seperated file and format it accoring to the arguments you pass with the command. This script will only work if the file has three fields, but can be edited for more. I am working on a way to unlimit this using arrays, but have not found a working solution yet. Also, this script is protable to windows. Just edit the environment path to reflect where your perl executable is located. Code below: Read more »

Multiple host ping sweep Perl script

Posted in Linux, Network Security, Perl Scripts, Tutorials/Whitepapers, Windows with tags , , on April 14, 2008 by triz

Here is one of the first Perl scripts I wrote at work.  I was tasked with verify host connectivity after some desktop patches were pushed out.  So instead of manually pinging each one, and I already had a text file with all the affected hostnames, I decided to put together a little script that would read from the text file and print out whether the host was up or down. 

So, for this to work you will need a file called hosts.txt with a list of hostnames or IP address.  Also, very simple shell script to read txt file into perl script.  I could have excluded the shell script and just used Perl to open the file and add each line to an array, which would loop thru and do the same thing… it is on my TODO, but as it is, this works fine, and there’s always another script that needs to be written.  Check it out. Read more »