Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-02-2005, 01:14 AM   #1
SplitInfinity
Confirmed User
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 3,047
Some helpful scripts I wrote... leech them here.

First one...

PHP Code:
#!/usr/bin/perl


# SplitInfinity Networks, INC.
# 858-560-2760
# Programmer: Chris Jester
[email protected]
# This program is free to use, but not to sell.
# Enjoy.

# Compatible and tested on Fedora Core 1,2,3 etc.
# As well as any other Linux that uses /etc/sysconfig/network-scripts
# as a mechanism to add ips and etc. Redhat, Suse, Etc.
# This shell script, was created for admins to easily
# add many ip's to one server. Make a list of the IP's
# in a file called iplist.txt which is to be created
# in the same directory as the one this program resides
# in (unless you modify the paths below).
# Run the program from the shell prompt like this:

# ./makeips.pl START_WITH_WHAT#
#
# Where START_WITH_WHAT# is the number of the first interface
# you wish to begin with. So for example, if you have already
# assigned ethernet 0, 0:0 and 0:1 then you will want to add
# interfaces beginning at 0:2 so you would enter 2 there to
# make sure the numbering is correct and your new interfaces
# are created correctly.  If you are adding interfaces to
# a system with more than 1 ethernet card, then you must
# specify the card by changing the variable below.
#
# Props: Special thanks to Swami who inspired me to write
# this quick hack. Customers make the world go round.
# My scripts make it happen a bit faster. Thanks.

$interface    =     $ARGV[0];
$card        =    "0";

$directory    =    "/root/test";
#$directory    =    "/etc/sysconfig/network-scripts";
$iplist        =    "./iplist.txt";



open(DB,"$iplist");

while(<
DB>) {

# Template of the ip configuration file
$template = <<__END_OF_FORMAT__;
DEVICE=eth<<CARD>>:<<INTERFACE>>
ONBOOT=yes
BOOTPROTO
=static
IPADDR=<<IPADDRESS>>
NETMASK=255.255.255.0
GATEWAY
=<<GATEWAY>>
__END_OF_FORMAT__

    $ipaddress 
$_;
    
chomp($ipaddress);
    (
$oct1,$oct2,$oct3) = split(/\./,$ipaddress);
    
$gateway "$oct1.$oct2.$oct3.1";
    
    
$template =~ s/<<IPADDRESS>>/$ipaddress/g;
    
$template =~ s/<<INTERFACE>>/$interface/g;
    
$template =~ s/<<GATEWAY>>/$gateway/g;
    
$template =~ s/<<CARD>>/$card/g;

    
open(FILE">$directory/ifcfg-eth$card:$interface");
    print 
FILE $template;
    
close(FILE);

    
$shell .= "ifup ifcfg-eth$card:$interface\n";

    
$interface++;
    
    }

print 
$shell;
print 
"\n\n\nCopy the above commands and paste into shell to bring the new interfaces up.\n"
Second one...
PHP Code:
#!/usr/bin/perl



# Another script to make my life easy.
# Purpose: Lets say you have a bunch of domains to add to a
# name server. And each domain is to have its own settings...
# This script takes a file input in the following format:
#
# domain.com    ns1ip    ns2ip
# Where ns1ip is the primary ns and ns2ip is the secondary ns.
# This script will create all the zone files and spit out
# the entries to add to named.conf to make those zone files
# active.
# It will use ns1ip as the web server ip address. (since thats
# what I needed it to do when I wrote it. )
# Enjoy

$directory    =    "/var/named";
$domainlist        =    "./domains.txt";

open(DB,"$domainlist");

while(<
DB>) {

# Template of the ip configuration file
$template = <<__END_OF_FORMAT__;
\
$TTL 1800
\@       IN      SOA     ns1.<<DOMAINNAME>>. si-support.splitinfinity.net.  (
                                      
2005043100 Serial
                                      28800      
Refresh
                                      14400      
Retry
                                      3600000    
Expire
                                      1800 
)     ; Minimum

                IN      NS      ns1
.<<DOMAINNAME>>.
                
IN      NS      ns2.<<DOMAINNAME>>.

                
IN      MX      5       mail

                        A       
<<NS1IP>>
                
IN      A       <<NS1IP>>
mail            IN      A       <<NS1IP>>
www             IN      A       <<NS1IP>>

ns1                IN        A        <<NS1IP>>
ns2                IN        A        <<NS2IP>>

*                
IN        A        <<NS1IP>>
__END_OF_FORMAT__

    $input 
$_;
    (
$domainname,$ipaddress1,$ipaddress2) = split(/\t/,$input);
    
chomp($ipaddress2);

    
$template =~ s/<<NS1IP>>/$ipaddress1/g;
    
$template =~ s/<<NS2IP>>/$ipaddress2/g;
    
$template =~ s/<<DOMAINNAME>>/$domainname/g;

    
open(FILE">$directory/$domainname.zone");
    print 
FILE $template;
    
close(FILE);

    
$shell .= "zone \"$domainname\"   {type master; file \"$domainname.zone\";};\n";

    
$interface++;
    
    }

print 
$shell;
print 
"\n\n\nCopy the above commands and paste into named.conf.\n"
SplitInfinity is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-02-2005, 01:16 AM   #2
MetaMan
I AM WEB 2.0
 
Industry Role:
Join Date: Jan 2003
Posts: 28,682
dude you are like the fucking warez topsite host from the oldschool days! i mean 99% of tgp webmasters owe it to you!

JAZNET SALUTES YOU!
MetaMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-02-2005, 01:17 AM   #3
SplitInfinity
Confirmed User
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 3,047
Im feeling love. :-)

Im in a coding mood. Anyone need any scripts?
:-)
SplitInfinity is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-02-2005, 01:18 AM   #4
SplitInfinity
Confirmed User
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 3,047
Hey, I just wrote a script to replace joel....

perl -p -i -e 's/Joel/Monkey/gi/' *

The funny thing is, the output is the same regardless of whether its Joel or the Monkey.
SplitInfinity is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-02-2005, 01:20 AM   #5
MetaMan
I AM WEB 2.0
 
Industry Role:
Join Date: Jan 2003
Posts: 28,682
you remember heXus aka a(idload?

not sure if you do or not, someone was trying to tell me he is dead. who knowS?!
MetaMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-02-2005, 01:21 AM   #6
SplitInfinity
Confirmed User
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 3,047
Whoa! Hexum? Brad hexum? He is dead? REALLY? Whoa!

OMG.
SplitInfinity is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-02-2005, 01:22 AM   #7
MetaMan
I AM WEB 2.0
 
Industry Role:
Join Date: Jan 2003
Posts: 28,682
Quote:
Originally Posted by SplitInfinity
Whoa! Hexum? Brad hexum? He is dead? REALLY? Whoa!

OMG.

NEVERMIND!
MetaMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-02-2005, 01:22 AM   #8
xclusive
Too lazy to set a custom title
 
Join Date: Apr 2004
Location: Buffalo, NY
Posts: 35,218
Quote:
Originally Posted by SplitInfinity
Hey, I just wrote a script to replace joel....

perl -p -i -e 's/Joel/Monkey/gi/' *

The funny thing is, the output is the same regardless of whether its Joel or the Monkey.
lol now that's funny
__________________

I support MediumPimpin.com / Shemp's Outlawtgp.com /


xclusive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.