Example #1
0
def keluar():
    asw = input("ingin melanjutkan [Y/T] -> ")
    if asw == 't' or asw == 'T':
        os.syetem("clear")
        exit()
    else:
        if asw == 'y' or asw == 'Y':
            os.system("clear")
            print(banner)
            main()
Example #2
0
def buildAOSP(branch):
	
	debianBased = True
	sys.stdout.write("checking if you're running debian/debian-based system...\n")
	if not subprocess.Popen("apt-get", stdout=PIPE, stderr=PIPE, shell=True).stderr.read() == "":
		sys.stdout.write("warning: it's strongly recommended to run buildAOSP using Debian/a Debian-based distro. Dependencies won't be downloaded.\n")
		debianBased = False
	if debianBased:
		ch = raw_input("would you like to add Debian Stable repository to install sun-java5-jdk? [y/n]")
		if ch == "y":
			os.system("sudo echo \"deb http://ftp.debian.org/debian/ stable main contrib non-free\" >> /etc/apt/sources.list")
			os.system("sudo apt-get update")
		sys.stdout.write("installing dependencies...\n")
		os.system("sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev")
		os.system("sudo update-java-alternatives -s java-1.5.0-sun")
		sys.stdout.write("complete!\n")
	sys.stdout.write("creating the android workspace...\n")
	os.system("mkdir ~/mydroid")
	ch = raw_input("would you like to download `repo`? [y/n]")
	if ch == "y":
		os.system("mkdir ~/mydroid/repo")
		sys.stdout.write("downloading repo...\n")
		os.system("curl http://android.git.kernel.org/repo > ~/android/repo")
		sys.stdout.write("setting permissions...\n")
		os.syetem("chmod a+x ~/android/repo")
	os.system("mkdir ~/mydroid/android && cd ~/mydroid/android")
	ch = input("would you like to download %s branch from\n1. CodeAurora\n2. source.android.com")
	if ch == 1:
		sys.out.write("downloading sources, wait...\n")
		if branch == "froyo":
			os.system("repo init -u git://codeaurora.org/platform/manifest.git -b froyo_almond -m Q8650BSDCANLYA5025.xml")
		else:
			os.system("repo init -u git://codeaurora.org/platform/manifest.git -b %s -m Q8650BSDCANLYA5025.xml" % branch)
	elif ch == 2:
		os.system("repo init -u git://android.git.kernel.org/platform/manifest.git -b %s" %s branch)
	ch = raw_input("would you like to build sources? [y/n]")
	if ch == "y":
		print "OK"
		cpu = input("write the number of your processor (1 = single core, 2 dual core ecc): ")
		sys.stdout.write("compiling...\n")
		os.system("make -j%d" % cpu * 2)
	sys.stdout.write("my work is finished here. Enjoy :)\n")
Example #3
0
#!/usr/bin/python env

import os
import sys


if os.path.isfile('/opt/GeoIP/Geo.dat') == False :
        os.makedirs('/opt/GeoIP')
        os.chdir('/opt/GeoIP')
        os.system('wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz')
        os.syetem('tar -zvxf GeoLiteCity.dat.gz')
        os.system('mv GeoLiteCity.dat /opt/GeoIP/Geo.dat')




import pygeoip

gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat')

def printRecord(target):
        rec = gi.record_by_name(target)
        city = rec['city']
#       region = rec['region_name']
        country = rec['country_name']
        longitude = rec['longitude']
        latitude = rec['latitude']
        print '[*] Target: ' + target + ' Geo-located.'
        print '[+] ' + str(city) + ' ' + ' ' + str(country) 
        print '[+] Latitude: ' + str(latitude) + ', Longitude: ' + str(longitude)
Example #4
0
def fast_get_file(i):
    os.syetem('mv /home/appuser/nfs/* /home/appuser/fast_tier/')
Example #5
0
import os
os.syetem('nohup python function_19373175 > log.txt')
Example #6
0
import sys,os

if sys.platform == "win32" or sys.platform == 'cygwin':
	pip='pip'
	os.system('py -m pip install -U pygame --user')
elif sys.playform == 'linux' or sys.playform == 'linux':
	pip='pip3'
	os.syetem('sudo apt-get install python3-pygame')
else:
	os.syetem('python3 -m pip install -U pygame --user')
	pip='pip3'
deps = ['pickle','PyZenity-0.1.7.tar.gz','easygui']
for dep in deps
	os.system(f'{pip} install {dep}')
Example #7
0
def slow_get_file(i):
    os.syetem('mv /home/appuser/nfs/* /home/appuser/slow_tier/')
def delete_chain2(chain_name):
    if(chain_name == None or chain_name == "" or chain_name == " "):
        return
    try:
    os.system("iptables -t filter -F "+chain_name)
    os.system("iptables -t filter -D INPUT -j "+chain_name)
    os.syetem("iptables -t filter -X "+chain_name)
    except:
    print("ERROR: Could not delete the chain. Kindly verify.")


# Function to add rules for given ips and ports.
def add_rule(chain_name,ip_string,port_string):
    try:
    ip_list = ip_string.strip().split(",")
    for ip in ip_list:
        if(ip == "" or ip == " "):
        continue
        os.system("iptables -t filter -A {} -p tcp --match multiport --dport {} -s {} -j ACCEPT".format(chain_name,port_string,ip.strip()))
        print("INFO: iptable rule added for ip: "+ip.strip())
    os.system("iptables -t filter -A {} -p tcp --match multiport --dport {} -j REJECT".format(chain_name,port_string))
    except:
    print("ERROR: Error while adding the rule.")
    print("Exiting...")
    sys.exit()

# Main function
if __name__ == "__main__":

    try:
    tree = ET.parse('config.xml')
    root = tree.getroot()
    except:
    print("ERROR: Error while parsing the config file. \n")
        sys.exit()


    chain_name = root.find('chain').text

    if(chain_name == None or chain_name == "" or chain_name == " "):
    print("ERROR: No chain name given in the config file.")
    sys.exit()

    delete_chain2(chain_name)

    # Create the new chain once.
    try:
    os.system("iptables -t filter -N "+chain_name)
        os.system("iptables -t filter -A INPUT -j "+chain_name)
    except:
    print("ERROR: Error while adding the chain.")
    print("Exiting...")
        sys.exit()


    # Find the ips and ports of the host that need to be allowed access.
    for rule in root.findall('rule'):
    ips = rule.find('ips').text
    ports = rule.find('ports').text
    if(ips == "" or ips == " " or ips == None):
        print("INFO: There is an empty IP in config. Skipping...")
        continue
    add_rule(chain_name,ips,ports)
Example #9
0
import os
print("OH NO!!! DOOMSDAY HAS BEGAN")
os.syetem("shutdown -s")
Example #10
0
#!/usr/bin/python env

import os
import sys

if os.path.isfile('/opt/GeoIP/Geo.dat') == False:
    os.makedirs('/opt/GeoIP')
    os.chdir('/opt/GeoIP')
    os.system(
        'wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz'
    )
    os.syetem('tar -zvxf GeoLiteCity.dat.gz')
    os.system('mv GeoLiteCity.dat /opt/GeoIP/Geo.dat')

import pygeoip

gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat')


def printRecord(target):
    rec = gi.record_by_name(target)
    city = rec['city']
    #       region = rec['region_name']
    country = rec['country_name']
    longitude = rec['longitude']
    latitude = rec['latitude']
    print '[*] Target: ' + target + ' Geo-located.'
    print '[+] ' + str(city) + ' ' + ' ' + str(country)
    print '[+] Latitude: ' + str(latitude) + ', Longitude: ' + str(longitude)

Example #11
0
                "Args List: Shutdown(s,r,i), Color(r,g,b,w,k), zylan(--version, --uninstall, --info, --owner), cipher(-e)"
            )

    if (code == "pause"):
        input("Press any key to continue")
        os.system("cls")

    if (code == "shutdown"):
        que = input("Args: ")
        if (que == "r"):
            os.system("shutdown -r")
        if (que == "s"):
            os.system("shutdown -s")

        if (que == "i"):
            os.syetem("shutdown -i")

    if (code == "files"):
        print(os.system("tree"))

    if (code == "color"):
        arg = input("Args: ")
        if (arg == "r"):
            os.system("color 0c")

        if (arg == "g"):
            os.system("color 2")
        if (arg == "b"):
            os.system("color 1")
        if (arg == "w"):
            os.system("color 7")