notes.parveenbhadoo.com

Parveen Bhadoo Notes

To Generate SRI Hash visit https://www.srihash.org or https://report-uri.com/home/sri_hash

Chrome wget CMD for Windows

wget https://bit.ly/3sfFGfo

System Upgrade using Terminal on Linux Ubuntu

sudo apt-get update && sudo apt-get upgrade
sudo apt update && sudo apt upgrade

Working with npm

Use Node.js command prompt as terminal

Create a package.json file with name and version where bhadoojs is Assets package name.

{
"name": "bhadoojs",
"version": "1.0.0"
}

Use Publish Command to Publish the Repo Publically

npm publish --access=public

To delete a package use

npm unpublish <package_name> -f --force

Forward Emails from Domains using DNS and ForwardMail.Net

**IMPORTANT NOTE:** Replace niftylettuce@gmail.com below with the email address you want to forward emails to:

1. Set the following DNS MX records on your domain name (having both is required):

Name/Host/Alias TTL Record Type Priority Value/Answer/Destination
@ or leave blank 3600 MX 10 mx1.forwardemail.net
@ or leave blank 3600 MX 20 mx2.forwardemail.net

Note that there should be NO other MX records set on your domain name. If there were already MX records that existed, please delete them completely.

2. Set (and customize) the following DNS TXT records on your domain name:

If you are forwarding all emails from your domain, (all@niftylettuce.com, hello@niftylettuce.com, etc) to a specific address niftylettuce@gmail.com:

Name/Host/Alias TTL Record Type Value/Answer/Destination
@ or leave blank 3600 TXT forward-email=niftylettuce@gmail.com

If you just need to forward a single email address (e.g. hello@niftylettuce.com to niftylettuce@gmail.com; this will also forward hello+test@niftylettuce.com to niftylettuce+test@gmail.com automatically):

Name/Host/Alias TTL Record Type Value/Answer/Destination
@ or leave blank 3600 TXT forward-email=hello:niftylettuce@gmail.com

If you are forwarding multiple emails, then you’ll want to separate them with a comma:

Name/Host/Alias TTL Record Type Value/Answer/Destination
@ or leave blank 3600 TXT forward-email=hello:niftylettuce@gmail.com,support:niftylettuce@gmail.com

As of November 2, 2018 we now have added support for multi-line TXT records! You can now have an infinite amount of forwarding emails setup – just make sure to not wrap over 255 characters in a single-line and start each line with forward-email=. An example is provided below:

Name/Host/Alias TTL Record Type Value/Answer/Destination
@ or leave blank 3600 TXT forward-email=hello:niftylettuce@gmail.com,support:niftylettuce@gmail.com
@ or leave blank 3600 TXT forward-email=help:niftylettuce@gmail.com,foo:niftylettuce@gmail.com
@ or leave blank 3600 TXT forward-email=orders:niftylettuce@gmail.com,baz:niftylettuce@gmail.com
@ or leave blank 3600 TXT forward-email=info:niftylettuce@gmail.com,beep:niftylettuce@gmail.com
@ or leave blank 3600 TXT forward-email=errors:niftylettuce@gmail.com,boop:niftylettuce@gmail.com

3. Set (and customize) the following SPF record for SPF verification for your domain name (this will allow SPF verification to pass, note that you may need to enclose this value in quotes if you are using Amazon Route53):

Note that if you are using a service such as GoDaddy, you will need to use a TXT record type instead of an SPF record for this step.

If you’re using a service like AWS Route 53, then edit your existing TXT record and add the following as a new line:

Name/Host/Alias TTL Record Type Value/Answer/Destination
@ or leave blank 3600 SPF v=spf1 a mx include:spf.forwardemail.net -all

:warning: If you are using Google Apps, you’ll need to append include:_spf.google.com to the value above – e.g. v=spf1 a mx include:spf.forwardemail.net include:_spf.google.com -all.

If you already have a similar line with v=spf1, then you’ll need to append include:spf.forwardemail.net right before any existing include:host.com records and before the -all in the same line (e.g. v=spf1 a mx include:spf.forwardemail.net include:host.com -all).

Note that there is a difference between -all and ~all. The - indicates that the SPF check should FAIL if it does not match, and ~ indicates that the SPF check should SOFTFAIL. We recommend to use the -all approach to prevent domain forgery.

4. Send a test email to confirm it works. Note that it might take some time for your DNS records to propagate.

5. Add no-reply@forwardemail.net to your contacts. In the event that someone is attempting to send you an email that has a strict DMARC record policy of reject or quarantine, we will rewrite the email’s From header with a “friendly-from”. This means the From will look like Sender's Name <no-reply@forwardemail.net> and a Reply-To will be added with the original sender’s From address. In the event that there is already a Reply-To set, we will not overwrite it.

6. If you wish to “Send Mail As” from Gmail, then you will need to follow the steps under Send Mail As Using Gmail below.


Optional Add-ons:

For more Visit ForwardMail.Net

WordPress on Lightsail

sudo nano /opt/bitnami/php/etc/php.ini

sudo cat ./bitnami_credentials

sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1

sudo /opt/bitnami/ctlscript.sh restart

sudo nano /opt/bitnami/apps/wordpress/conf/htaccess.conf

and add these lines

# BEGIN rlrssslReallySimpleSSL rsssl_version[3.2.9]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL

sudo chmod 664 /opt/bitnami/apps/wordpress/htdocs/wp-config.php

sudo /opt/bitnami/ctlscript.sh restart

Make Error Handling Page

sudo mkdir /opt/bitnami/apps/wordpress/htdocs/ip

sudo nano /opt/bitnami/apps/wordpress/htdocs/ip/index.html

Add the content you want to display

sudo chmod -R 777 /opt/bitnami/apps/wordpress/htdocs/ip

Edit this config file

sudo nano /opt/bitnami/apps/wordpress/conf/httpd-vhosts.conf

replace domain and ip with your own data

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
SSLEngine on
SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"
Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:80>
ServerName xxx.xxx.xxx.xxx
ServerAlias *
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs/ip"
Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
ServerName xxx.xxx.xxx.xxx
ServerAlias *
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs/ip"
Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
</VirtualHost>

add above file in bitnami config

sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf

in here add this line

Include "/opt/bitnami/apps/wordpress/conf/httpd-vhosts.conf"

Add imagick Module for PHP

sudo nano /opt/bitnami/php/etc/php.ini

find Extentions and add this without ;

extension=imagick.so

to apply these setting use

sudo /opt/bitnami/ctlscript.sh restart

Google Group for Sharing Team Drive

Disable Deletion and Deactivation of WordPress Plugins

/**
 * Remove Delete/Disable Action for Plugins
 * https://wordpress.org/support/topic/disable-delete-option-for-plugins/
 * @param $actions
 * @param $plugin_file
 * @param $plugin_data
 * @param $context
 * @return mixed
 */
function bhadoo_disable_plugin_deletion( $actions, $plugin_file, $plugin_data, $context ) {

    // Remove delete link for plugins
    if ( array_key_exists( 'delete', $actions ) && in_array( $plugin_file, array(
        'akismet/akismet.php',
		'jetpack/jetpack.php',
        'all-in-one-wp-migration/all-in-one-wp-migration.php',
		'all-in-one-wp-migration-gdrive-extension/all-in-one-wp-migration-gdrive-extension.php',
		'wp-mail-smtp-pro/wp_mail_smtp.php',
		'really-simple-ssl/rlrsssl-really-simple-ssl.php'
    ) ) )
        unset( $actions['delete'] );

    return $actions;
}
add_filter( 'plugin_action_links', 'bhadoo_disable_plugin_deletion', 10, 4 );

function bhadoo_disable_plugin_deactivation( $actions, $plugin_file, $plugin_data, $context ) {

    // Remove delete link for plugins
    if ( array_key_exists( 'deactivate', $actions ) && in_array( $plugin_file, array(
        'akismet/akismet.php',
		'jetpack/jetpack.php',
        'all-in-one-wp-migration/all-in-one-wp-migration.php',
		'all-in-one-wp-migration-gdrive-extension/all-in-one-wp-migration-gdrive-extension.php',
		'wp-mail-smtp-pro/wp_mail_smtp.php',
		'really-simple-ssl/rlrsssl-really-simple-ssl.php'
    ) ) )
        unset( $actions['deactivate'] );

    return $actions;
}
add_filter( 'plugin_action_links', 'bhadoo_disable_plugin_deactivation', 10, 4 );

Rapidleech RAR Fix

cd /var/www/html
sudo rm -rf rar && sudo wget https://rarlab.com/rar/rarlinux-x64-5.6.0.tar.gz && sudo tar -xvf rarlinux-x64-5.6.0.tar.gz && sudo rm -f rarlinux-x64-5.6.0.tar.gz && sudo chmod -R 777 rar && sudo chmod -R 777 rar/*

Rapidleech Install on Ubuntu

Apache

bash <(curl -s https://web.archive.org/web/20211029111932if_/https://notes.parveenbhadoo.com/rapidleech.sh)

nginx

bash <(curl -s https://web.archive.org/web/20220124085949if_/https://notes.parveenbhadoo.com/nginx-rapidleech.sh)

Rapidleech Manual Install on Ubuntu Apache

sudo su
sudo apt-get install apache2
sudo apt-get update && sudo apt-get upgrade && sudo apt update && sudo apt upgrade
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update && sudo apt-get upgrade && sudo apt update && sudo apt upgrade && sudo apt install unzip
sudo apt install php7.4
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y
sudo service apache2 restart
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
cd /var/www
sudo rm -r html
sudo git clone https://github.com/PBhadoo/RapidLeech html
cd /var/www/html
sudo chmod -R 777 rar && sudo chmod -R 777 rar/*
mkdir files
chmod 777 files
chmod 777 configs
chmod 777 configs/files.lst
chmod 777 /var/www/html/rar/rar
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --apache
sudo service apache2 restart
sudo reboot

Rapidleech Manual Install on Ubuntu nginx Web Server Source certbot

sudo su
sudo apt-get update && sudo apt-get upgrade && sudo apt update && sudo apt upgrade
sudo apt install nginx php-curl php-gd php-zip php-fpm
sudo add-apt-repository ppa:ondrej/php
sudo apt install php7.4
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
sudo apt-get update && sudo apt-get upgrade && sudo apt update && sudo apt upgrade && sudo apt install unzip
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT
sudo netfilter-persistent save
sudo rm /var/www/html/index.nginx-debian.html
cd /var/www
sudo rm -r html
sudo wget https://web.archive.org/web/20211024042550if_/https://workspace.parveenbhadoo.com/html.zip
sudo unzip html.zip
cd /var/www/html
sudo rm -rf rar && sudo wget https://rarlab.com/rar/rarlinux-x64-6.0.2.tar.gz && sudo tar -xvf rarlinux-x64-6.0.2.tar.gz && sudo rm -f rarlinux-x64-6.0.2.tar.gz && sudo chmod -R 777 rar && sudo chmod -R 777 rar/*
mkdir files
chmod 777 files
chmod 777 configs
chmod 777 configs/files.lst
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --nginx
sudo systemctl restart nginx
sudo nano /etc/nginx/sites-available/default

Use Below Commands for Oracle Cloud to Work

sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo netfilter-persistent save

LAMP on Ubuntu - Source PHP

sudo apt-get install apache2
sudo apt-get install mysql-server
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update && sudo apt-get upgrade && sudo apt update && sudo apt upgrade
sudo apt install php7.4
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y
sudo service apache2 restart
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
cd /var/www/html

WordPress on Ubuntu nginx

Saved Archive

Personal CMDs for Aria Bot

sudo apt-get update && sudo apt-get upgrade && sudo apt update && sudo apt upgrade && sudo apt install unzip
bash <(curl -s https://raw.githubusercontent.com/jscdn/scripts/master/aria-telegram-mirror-bot-ready-server.sh)
sudo nano src/.constants.js
bash <(curl -s https://raw.githubusercontent.com/jscdn/scripts/master/aria-telegram-mirror-bot-start-bot.sh)
/mirror https://github.com/ParveenBhadooOfficial/aria-telegram-mirror-bot/blob/master/README.md

generate_string_session.py

wget https://raw.githubusercontent.com/ParveenBhadooOfficial/BhadooJS/master/generate_string_session.py
sudo apt-get update && sudo apt-get upgrade && sudo apt update && sudo apt upgrade
sudo apt install python3-pip
sudo pip3 install -U telethon
python3 generate_string_session.py

Generate SAs for Google Drive

Modified File

import errno
import os
import pickle
import sys
import string
import random
from argparse import ArgumentParser
from base64 import b64decode
from glob import glob
from json import loads
from random import choice
from time import sleep

from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError

SCOPES = ['https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/cloud-platform',
          'https://www.googleapis.com/auth/iam']
project_create_ops = []
current_key_dump = []
sleep_time = 30


# Create count SAs in project
def _create_accounts(service, project, count):
    batch = service.new_batch_http_request(callback=_def_batch_resp)
    for i in range(count):
        aid = _generate_id('aa')
        batch.add(service.projects().serviceAccounts().create(name='projects/' + project, body={'accountId': aid,
                                                                                                'serviceAccount': {
                                                                                                    'displayName': aid}}))
    batch.execute()


# Create accounts needed to fill project
def _create_remaining_accounts(iam, project):
    print('Creating accounts in %s' % project)
    sa_count = len(_list_sas(iam, project))
    while sa_count != 100:
        _create_accounts(iam, project, 100 - sa_count)
        sa_count = len(_list_sas(iam, project))


# Generate a random id
def _generate_id(prefix='az'):
    chars = 'abcdefghijklmnopqrstuvwxyz1234567890'
    return prefix + ''.join(choice(chars) for _ in range(3)) + choice(chars[1:])


# List projects using service
def _get_projects(service):
    return [i['projectId'] for i in service.projects().list().execute()['projects']]


# Default batch callback handler
def _def_batch_resp(id, resp, exception):
    if exception is not None:
        if str(exception).startswith('<HttpError 429'):
            sleep(sleep_time / 100)
        else:
            print(str(exception))


# Project Creation Batch Handler
def _pc_resp(id, resp, exception):
    global project_create_ops
    if exception is not None:
        print(str(exception))
    else:
        for i in resp.values():
            project_create_ops.append(i)


# Project Creation
def _create_projects(cloud, count):
    global project_create_ops
    batch = cloud.new_batch_http_request(callback=_pc_resp)
    new_projs = []
    for i in range(count):
        new_proj = _generate_id('hh') #project ID Prefix
        new_projs.append(new_proj)
        batch.add(cloud.projects().create(body={'project_id': new_proj}))
    batch.execute()

    for i in project_create_ops:
        while True:
            resp = cloud.operations().get(name=i).execute()
            if 'done' in resp and resp['done']:
                break
            sleep(3)
    return new_projs


# Enable services ste for projects in projects
def _enable_services(service, projects, ste):
    batch = service.new_batch_http_request(callback=_def_batch_resp)
    for i in projects:
        for j in ste:
            batch.add(service.services().enable(name='projects/%s/services/%s' % (i, j)))
    batch.execute()


# List SAs in project
def _list_sas(iam, project):
    resp = iam.projects().serviceAccounts().list(name='projects/' + project, pageSize=100).execute()
    if 'accounts' in resp:
        return resp['accounts']
    return []


# Create Keys Batch Handler
def _batch_keys_resp(id, resp, exception):
    global current_key_dump
    if exception is not None:
        current_key_dump = None
        sleep(sleep_time / 100)
    elif current_key_dump is None:
        sleep(sleep_time / 100)
    else:
        current_key_dump.append((
            resp['name'][resp['name'].rfind('/'):],
            b64decode(resp['privateKeyData']).decode('utf-8')
        ))


# Create Keys
def _create_sa_keys(iam, projects, path):
    global current_key_dump
    for i in projects:
        current_key_dump = []
        print('Downloading keys from %s' % i)
        while current_key_dump is None or len(current_key_dump) != 100:
            batch = iam.new_batch_http_request(callback=_batch_keys_resp)
            total_sas = _list_sas(iam, i)
            for j in total_sas:
                batch.add(iam.projects().serviceAccounts().keys().create(
                    name='projects/%s/serviceAccounts/%s' % (i, j['uniqueId']),
                    body={
                        'privateKeyType': 'TYPE_GOOGLE_CREDENTIALS_FILE',
                        'keyAlgorithm': 'KEY_ALG_RSA_2048'
                    }
                ))
            batch.execute()
            if current_key_dump is None:
                print('Redownloading keys from %s' % i)
                current_key_dump = []
            else:
                index = 0
                sa_prefix = _generate_id('new')
                for j in current_key_dump:
                    with open(f'{path}/{sa_prefix}-{index}.json', 'w+') as f:
                        f.write(j[1])
                    index += 1


# Delete Service Accounts
def _delete_sas(iam, project):
    sas = _list_sas(iam, project)
    batch = iam.new_batch_http_request(callback=_def_batch_resp)
    for i in sas:
        batch.add(iam.projects().serviceAccounts().delete(name=i['name']))
    batch.execute()


def serviceaccountfactory(
        credentials='credentials.json',
        token='token_sa.pickle',
        path=None,
        list_projects=False,
        list_sas=None,
        create_projects=None,
        max_projects=100,
        enable_services=None,
        services=['iam', 'drive'],
        create_sas=None,
        delete_sas=None,
        download_keys=None
):
    selected_projects = []
    proj_id = loads(open(credentials, 'r').read())['installed']['project_id']
    creds = None
    if os.path.exists(token):
        with open(token, 'rb') as t:
            creds = pickle.load(t)
    if not creds or not creds.valid:
        if creds and creds.expired and creds.refresh_token:
            creds.refresh(Request())
        else:
            flow = InstalledAppFlow.from_client_secrets_file(credentials, SCOPES)

            # creds = flow.run_local_server(port=0)
            creds = flow.run_local_server(port=0, open_browser=False)

        with open(token, 'wb') as t:
            pickle.dump(creds, t)

    cloud = build('cloudresourcemanager', 'v1', credentials=creds)
    iam = build('iam', 'v1', credentials=creds)
    serviceusage = build('serviceusage', 'v1', credentials=creds)

    projs = None
    while projs == None:
        try:
            projs = _get_projects(cloud)
        except HttpError as e:
            if loads(e.content.decode('utf-8'))['error']['status'] == 'PERMISSION_DENIED':
                try:
                    serviceusage.services().enable(
                        name='projects/%s/services/cloudresourcemanager.googleapis.com' % proj_id).execute()
                except HttpError as e:
                    print(e._get_reason())
                    input('Press Enter to retry.')
    if list_projects:
        return _get_projects(cloud)
    if list_sas:
        return _list_sas(iam, list_sas)
    if create_projects:
        print("creat projects: {}".format(create_projects))
        if create_projects > 0:
            current_count = len(_get_projects(cloud))
            if current_count + create_projects <= max_projects:
                print('Creating %d projects' % (create_projects))
                nprjs = _create_projects(cloud, create_projects)
                selected_projects = nprjs
            else:
                sys.exit('No, you cannot create %d new project (s).\n'
                         'Please reduce value of --quick-setup.\n'
                         'Remember that you can totally create %d projects (%d already).\n'
                         'Please do not delete existing projects unless you know what you are doing' % (
                             create_projects, max_projects, current_count))
        else:
            print('Will overwrite all service accounts in existing projects.\n'
                  'So make sure you have some projects already.')
            input("Press Enter to continue...")

    if enable_services:
        ste = []
        ste.append(enable_services)
        if enable_services == '~':
            ste = selected_projects
        elif enable_services == '*':
            ste = _get_projects(cloud)
        services = [i + '.googleapis.com' for i in services]
        print('Enabling services')
        _enable_services(serviceusage, ste, services)
    if create_sas:
        stc = []
        stc.append(create_sas)
        if create_sas == '~':
            stc = selected_projects
        elif create_sas == '*':
            stc = _get_projects(cloud)
        for i in stc:
            _create_remaining_accounts(iam, i)
    if download_keys:
        try:
            os.mkdir(path)
        except OSError as e:
            if e.errno == errno.EEXIST:
                pass
            else:
                raise
        std = []
        std.append(download_keys)
        if download_keys == '~':
            std = selected_projects
        elif download_keys == '*':
            std = _get_projects(cloud)
        _create_sa_keys(iam, std, path)
    if delete_sas:
        std = []
        std.append(delete_sas)
        if delete_sas == '~':
            std = selected_projects
        elif delete_sas == '*':
            std = _get_projects(cloud)
        for i in std:
            print('Deleting service accounts in %s' % i)
            _delete_sas(iam, i)


if __name__ == '__main__':
    parse = ArgumentParser(description='A tool to create Google service accounts.')
    parse.add_argument('--path', '-p', default='accounts',
                       help='Specify an alternate directory to output the credential files.')
    parse.add_argument('--token', default='token_sa.pickle', help='Specify the pickle token file path.')
    parse.add_argument('--credentials', default='credentials.json', help='Specify the credentials file path.')
    parse.add_argument('--list-projects', default=False, action='store_true',
                       help='List projects viewable by the user.')
    parse.add_argument('--list-sas', default=False, help='List service accounts in a project.')
    parse.add_argument('--create-projects', type=int, default=None, help='Creates up to N projects.')
    parse.add_argument('--max-projects', type=int, default=100, help='Max amount of project allowed. Default: 100')
    parse.add_argument('--enable-services', default=None,
                       help='Enables services on the project. Default: IAM and Drive')
    parse.add_argument('--services', nargs='+', default=['iam', 'drive'],
                       help='Specify a different set of services to enable. Overrides the default.')
    parse.add_argument('--create-sas', default=None, help='Create service accounts in a project.')
    parse.add_argument('--delete-sas', default=None, help='Delete service accounts in a project.')
    parse.add_argument('--download-keys', default=None, help='Download keys for all the service accounts in a project.')
    parse.add_argument('--quick-setup', default=None, type=int,
                       help='Create projects, enable services, create service accounts and download keys. ')
    parse.add_argument('--new-only', default=False, action='store_true', help='Do not use existing projects.')
    args = parse.parse_args()
    # If credentials file is invalid, search for one.
    if not os.path.exists(args.credentials):
        options = glob('*.json')
        print('No credentials found at %s. Please enable the Drive API in:\n'
              'https://developers.google.com/drive/api/v3/quickstart/python\n'
              'and save the json file as credentials.json' % args.credentials)
        if len(options) < 1:
            exit(-1)
        else:
            i = 0
            print('Select a credentials file below.')
            inp_options = [str(i) for i in list(range(1, len(options) + 1))] + options
            while i < len(options):
                print('  %d) %s' % (i + 1, options[i]))
                i += 1
            inp = None
            while True:
                inp = input('> ')
                if inp in inp_options:
                    break
            if inp in options:
                args.credentials = inp
            else:
                args.credentials = options[int(inp) - 1]
            print('Use --credentials %s next time to use this credentials file.' % args.credentials)
    if args.quick_setup:
        opt = '*'
        if args.new_only:
            opt = '~'
        args.services = ['iam', 'drive']
        args.create_projects = args.quick_setup
        args.enable_services = opt
        args.create_sas = opt
        args.download_keys = opt
    resp = serviceaccountfactory(
        path=args.path,
        token=args.token,
        credentials=args.credentials,
        list_projects=args.list_projects,
        list_sas=args.list_sas,
        create_projects=args.create_projects,
        max_projects=args.max_projects,
        create_sas=args.create_sas,
        delete_sas=args.delete_sas,
        enable_services=args.enable_services,
        services=args.services,
        download_keys=args.download_keys
    )
    if resp is not None:
        if args.list_projects:
            if resp:
                print('Projects (%d):' % len(resp))
                for i in resp:
                    print('  ' + i)
            else:
                print('No projects.')
        elif args.list_sas:
            if resp:
                print('Service accounts in %s (%d):' % (args.list_sas, len(resp)))
                for i in resp:
                    print('  %s (%s)' % (i['email'], i['uniqueId']))
            else:
                print('No service accounts.')

sudo su
wget https://cdn.jsdelivr.net/gh/1337-to/cdn@9.0/gen_sa_accounts.py
apt install python3-pip
pip3 install google-api-python-client google-auth-httplib2 google-auth-oauthlib
python gen_sa_accounts.py --quick-setup 1 --new-only -p 1
python gen_sa_accounts.py --quick-setup 1 --new-only -p 1 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 2 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 3 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 4 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 5 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 6 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 7 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 8 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 9 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 10 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 11 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 12 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 13 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 14 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 15 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 16 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 17 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 18 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 19 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 20 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 21 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 22 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 23 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 24 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 25 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 26 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 27 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 28 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 29 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 30 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 31 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 32 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 33 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 34 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 35 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 36 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 37 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 38 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 39 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 40 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 41 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 42 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 43 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 44 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 45 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 46 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 47 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 48 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 49 && python gen_sa_accounts.py --quick-setup 1 --new-only -p 50
python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only && python gen_sa_accounts.py --quick-setup 1 --new-only

Download Old Keys

python3 gen_sa_accounts.py --download-keys project_id

All Commands

arguments are inside the gen_sa_accounts.py file

Line 148, change Index as per needs for file name sequence.

For Windows using PowerShell - Get Emails from 0-99 Projects, saved in emails.txt File

$emails = Get-ChildItem .\**.json |Get-Content -Raw |ConvertFrom-Json |Select -ExpandProperty client_email >>emails.txt
$emails = Get-ChildItem D:\GitLab_Projects\bill\50\**.json |Get-Content -Raw |ConvertFrom-Json |Select -ExpandProperty client_email >>D:\GitLab_Projects\bill\50\emails.txt

Get all SAs in Serial Mode

pip3 install gdnan
python3
from gdnan import GoogleDrive
a = GoogleDrive("accounts")
CTRL - C 
Done

Change HH Workers URL impact

Wildcard DNS Service

XMR Miner Ubuntu

sudo apt-get install git build-essential cmake automake libtool autoconf
git clone https://github.com/xmrig/xmrig.git
mkdir xmrig/build && cd xmrig/scripts
./build_deps.sh && cd ../build
cmake .. -DXMRIG_DEPS=scripts/deps
make -j$(nproc)
cd xmrig/build && sudo nano config.json
{
    "autosave": true,
    "cpu": true,
    "opencl": false,
    "cuda": false,
    "pools": [
        {
            "url": "us-west.minexmr.com:443",
            "user": "86jC4u19gRmKXpnykAnRvR6S9RSNVYgZR68Hxp314cukCmENzKQB1GNcDtZXEoFDuCZ9STL78oQpvHGvLpXg34z7Voctp2C",
            "rig-id": "xmr14",
            "keepalive": true,
            "tls": true
        }
    ]
}
tmux
./xmrig

Docker CMDs

sudo docker stop $(docker ps -a -q)
sudo docker rm $(docker ps -a -q)
sudo docker images -a
  
sudo docker rmi Image Image2

MirrorX CMDs for AWSPythonBot

sudo su
sudo apt-get update && sudo apt-get upgrade && sudo apt update && sudo apt upgrade && sudo apt install unzip
git clone https://github.com/iamLiquidX/MirrorX bot
cd bot
wget https://code.xxxxxxxxxxxxx.com/xxxxxxxx.zip
unzip app.zip
curl -sSL https://get.docker.com | sudo sh
sudo usermod -aG docker bhadoo
sudo apt install python3 python3-pip
sudo apt-get -y install python3-pip
sudo pip3 install docker-compose
sudo docker-compose up -d
sudo docker-compose up

Cloudflare Workers Function to Get Date Time, Path and Edit the Telegram Message in Channel

    const LOG_URL = "https://api.telegram.org/botXXXXXXXXXXXXXXXXXXXXXXXXXXXX/editMessageText?chat_id=-100XXXXXXXXXX&message_id=XX&text=Last Visited URL (No users are tracked)"

    function postLog() {
      let stampDate = Date.now();
      let localDate = new Date (stampDate);
      return fetch(LOG_URL+"\n\nTime: "+localDate+"\nPath: "+path, {
         method: "GET",
         //body: data,
        })
    }
    postLog()

Simple Torrent Deployment Seeder

sudo su
bash <(curl -s https://gitlab.com/ParveenBhadooOfficial/bhadoo-cloud/-/raw/main/aws-lightsail-install-advanced.sh)
docker run --name ct -d -p 80:3000 -v /path/to/my/downloads:/downloads -v /path/to/my/torrents:/torrents boypt/cloud-torrent

Portainer and Jackett Install

docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

ffmpeg convert .ts to .mp4 fast on Windows Batch Command

Ubuntu SSH key to Password Switching