Friday, June 17, 2022

MacBook Pro and Raspberry Pi4

This tutorial showing how to connect Raspberry Pi4 to MacBook Pro via USB-C (used to power the Pi) and share internet from MacBook to the Pi. Works for Debian and Kali linux images.

-  Image Kali/Debian to Raspberry Pi

- Edit file /boot/config.txt, add

[all]

dtoverlay=dwc2,dr_mode=peripheral

- Edit file /boot/cmdline.txt

console=serial0,115200 console=tty1 root=PARTUUID=ef15daca-02 rootfstype=ext4 fsck.repair=yes modules-load=dwc2,g_ether rootwait

- Create usb0 interface at /etc/network/interfaces.d/usb0

auto usb0

    allow-hotplug usb0

    iface usb0 inet dhcp

On MacBook, open System Preferences 



Thursday, June 16, 2022

Kali Linux In a Docker Container

 Update: this post has been updated and works as of June 2020 (official Offensive Security image names have changed).

Background

Wednesday, February 5, 2020

Complex Data Types in Python: Shallow & Deep Copies in Python

Complex Data Types in Python: Shallow & Deep Copies in Python


Learn about copying operations on containers in Python. You will learn the subtle distinction between shallow and deep copies. Changes made to shallow copies affect the original whereas with deep copies do not.

Table of Contents

  1. Course Overview
  2. Copying Strings
  3. Performing Shallow Copies of Lists
  4. Performing Deep Copies of Lists
  5. Creating Shallow and Deep Copies of Tuples
  6. Creating Shallow Copies of Dictionaries
  7. Creating Deep Copies of Dictionaries
  8. Creating Shallow and Deep Copies of Sets
  9. Exercise: Shallow and Deep Copies

Shallow and Deep Copies

- A shallow copy are made when two variables with different variable names point to the same location in memory.
- Updates that you make using one variable are reflected when accessing the same data using the other variable.
- The same complex data type has just two names with shallow copies.
- Deep copies are made when the same data is copied over to an entirely new memory location.
- Changes made to the deep copy are not reflected in the original memory.

String Copy

- String are immutable in Python
- Once created, strings cannot be updated
- Using assignment operations with strings reference the same location in memory
- But that location cannot be changed
- Assigning a new string value to a variable just creates a new string

list_b=list_a (Shallow Copy)

list_b=list_a[:] (Deep Copy)

list_b=copy.copy(list_a) (Deep Copy of the outer list but shallow copies of nay complex data types)

list_b=copy.deepcopy(list_a) (Deep Copy of the outer list and all of the nested data types)

Monday, July 15, 2019

Windows update error with 80072efd

http://www.puryear-it.com/blog/2012/07/27/windows-server-update-fails-with-error-80072efd/
"One issue which causes Windows Updates to fail with error 80072EFD is if the Windows Server is looking at itself or another Server on the network for the updates.
To  check this:
  1. Click Start > Run > type “regedit” without the quotes, and accept the UAC prompt to continue
  2. Navigate to HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate
  3. Look at the keys in that folder, if they look something like this:
    “WUServer”=http://srv_name:8530
    “WUStatusServer”=http://srv_name:8530
If this entries are listed under that folder, backup then delete the WindowsUpdate folder
  1. Right-click on the folder and select “export” to save.
  2. Delete the “WindowsUpdate” key from the registry at HKLM\Software\Policies\Microsoft\Windows.
  3. Restart the Windows Update service. (located in Start > Run > type “services.msc” without quotes)"

Thursday, April 4, 2019

How to reset Windows 10 account passwords

Windows 10 users who forgot the password of a user account cannot sign in to that account anymore. Certain options are provided to reset the password depending on the account type and other parameters such as whether it is a work account managed by an IT department or a home account.
Windows 10 supports two main account types: local accounts and Microsoft accounts. Local accounts exist only on the device, Microsoft accounts globally.
The account type determines whether it is possible to reset an account password. The solution is straightforward for Microsoft accounts as it is possible to reset the account password online.