0

Free Anti-Virus/Malware Software

Posted by admin on Jun 18, 2009 in Software

This is a list of windows utilities that can be used to clean some of the nastiest PC infections.  Links are provided for reference only.  Use at your own risk.
Malware Removal Software
Malwarebytes – This is a great program.  Download the free version and scan every couple of weeks or so.   Remove everything it finds.  The [...]

Tags: , , ,

 
0

Windows file names with space at end

Posted by admin on Jun 18, 2009 in My Notes

Have a file or directory that you can’t delete because there is a space at the end of the file name? 
If you try and delete from windows you will get the error message
“Error Deleting File or Folder”
“Cannot delete file: Cannot read from the source file or disk.”
To manipulate these files you need to address their [...]

 
0

Script – Purge spam folder

Posted by admin on Jun 18, 2009 in Scripts

#!/bin/bash
#This example is for a linux server using the following directory stucture to store email
#/home/unix-username/mail/domain/email-username/Maildir/.INBOX.spam/(cur | new)
#the following command will find all spam messages system wide over 14 days old and remove them
/usr/bin/find /home/*/mail/*/*/Maildir/.INBOX.spam/*/ -type f -ctime +14 | xargs /bin/rm -f
#-ctime n*24 hours
#-cmin n minutes
#-ctime +7 = > 1 week

Tags: , , , ,

 
0

Script – Avoid argument too long error

Posted by admin on Jun 18, 2009 in Scripts

When removing 10,000’s of files with rm -f * you get an argument too long error.
#### Remove too man files. 
#### First find -name ‘*’ > filelist
#!/bin/bash
for i in $( cat filelist );
do
echo $i
rm -f $i
done
#####
##### Easier way to remove too many files right from command line
#####
ls|xargs rm -f

Tags: , ,

 
0

Script – find and replace

Posted by admin on Jun 18, 2009 in Scripts

#########
#
#  change the same value in all files showen under ls in a directory
# good for mass IP changes
#
##########
#!/bin/bash
for i in $( ls );
do
sed -i ’s/find/replace/g’ $i
done

Tags: , ,

 
0

Script – bash while loop

Posted by admin on Jun 18, 2009 in Scripts

#!/bin/bash
while read line;
do echo “<option>$line</option>” >> cities.out;
done < cities.in
# above processes a text file where a line item might contain spaces
# a for loop that cat’s the file will process each space as a separate item
#!/bin/bash
x=1
while [ $x -le 100 ]
do
  echo “Hello World – $x times”
  x=$(( $x + 1 ))
done

 
0

Script – named.conf.secondary

Posted by admin on Jun 18, 2009 in Scripts

My Notes
#######
#
## Command Line Input – Create single secondary entry
#
#####
#!/bin/bash
# Edit IP variable to equal the IP address of the master name server
IP=10.0.0.1
echo -n “Enter Domain Name: ”
read name
echo “zone \”$name\” { type slave; masters { $IP; }; file \”/var/named/$name.sec\”; };” >> /etc/named.conf.secondary
#######
#  Make Secondary named.conf file
# FROM MASTER named.conf
#######
#!/bin/bash
IP=10.0.0.1
cat /etc/named.conf |grep zone |grep -v “type [...]

Tags: , , ,

Copyright © 2012 BenMcGrail.com All rights reserved.
Hosted by: VitexOnline.com