Wikipedia

Search results

10 February 2023

Resource constrained VM appliance for testing

When you create a new virtual machine in VirtualBox, you can specify the amount of RAM and number of virtual CPU cores that the virtual machine can use. You can also specify the size of the virtual disk, which determines the maximum amount of disk space available to the virtual machine.

Here are the steps to create a resource-limited virtual machine in VirtualBox:

  1. Launch VirtualBox and click the "New" button to create a new virtual machine.
  2. Give the virtual machine a name and select the type and version of the operating system you want to install.
  3. In the "System" section, click the "Processor" tab and set the number of virtual CPU cores to 2.
  4. In the "System" section, click the "Motherboard" tab and set the amount of RAM to the desired amount.
  5. In the "Storage" section, click the "Create a virtual hard disk now" button and select the size of the virtual disk.
  6. Click the "Create" button to create the virtual machine.
  7. Start the virtual machine and install the operating system.

After you have created the virtual machine, you can monitor its resource usage to make sure that it is not exceeding the specified limits. 

08 February 2023

Ethereum: hex-encoding function ABI calls

Delegatecall is a feature in Solidity, the programming language used to write smart contracts on the Ethereum blockchain, that allows a contract to call another contract's code and use its storage. Essentially, delegatecall enables one contract to reuse code from another contract, and the storage of the calling contract will be used as if it was the storage of the called contract.

Delegatecall was hacked before in an exploit known as the "re-entrancy attack." In this type of attack, a malicious contract could call another contract's code multiple times in a single transaction, effectively re-entering the code and taking advantage of the storage of the called contract. This could lead to the malicious contract being able to steal funds from the called contract's storage before the called contract had a chance to update its storage to reflect the intended outcome of the transaction.

To mitigate these types of attacks, it is important to properly handle re-entrancy in smart contract code and to follow best practices for secure contract development. 

09 September 2022

Oracle VBox server config on NAT

So you want a flexible general-purpose VM with the latest Ubuntu LTS? Right now it's Ubuntu 22, so these may not apply in the future.

These instructions assume that NAT is the default network selection/configuration in Virtualbox.


1) add your user to visudo

sudo visudo

# in visudo add your user to a new line

user ALL=(ALL) NOPASSWD:ALL

2) configure netplan

sudo ip a

# determine if networkd or network-manager is running, it's your renderer

# by default networkd will be running on a fresh Ubuntu 22 LTS install

# acquire your network identifier (eth0, enp0s3, etc.)

network:

    version: 2

    renderer: networkd

    ethernets:

        eth0:

            addresses:

                - 10.0.2.23/24

            nameservers:

                addresses: [8.8.8.8, 8.8.4.4]

            routes:

                - to: default

                  via: 10.0.2.2


# then apply changes

sudo netplan apply

3) configure port forwarding

- In VirtualBox VM Settings > Network > Advanced set your port forwarding rules:


- Verify you can SSH in to your box, in Terminal it's with:

% ssh -p 2222 ubuntu@127.0.0.1

4) install guest additions dependencies

sudo apt update

sudo apt install -y virtualbox-guest-additions-iso virtualbox-guest-utils

5) create a shared folder

- In VirtualBox VM Settings > Shared Folders add your folder:


6) clone your machine

Restart/reboot your VM, verify everything's working then make a full clone!

11 February 2021

Sort directories by size in OSX

 In the Terminal application we'll be using the du command.



Let's specify depth as one so to avoid listing files and subdirectories, and the output in gigabytes. I know this particular folder is roughly 9 gigabytes overweight, and I'm looking for a > 5g whale.

Before that, let's pipe it to a sort operation to list directories by size in descending order with sort. This will take the -n option to sort by number and -r to list in reverse (descending) order.


Found it!





31 August 2020

Establishment Media

The bias from news and political shows, including John Oliver and Trevor Noah, are completely one sided in an eery chorus that holds an eery pitch on one wavelength.

What's going on is absolutely insane. These people promote GoFundMe donations for white supremacist, bolshevik and/or neonazi, serial pedophiles, yet fail to mention their carrying of guns during riots, nor the murders they cause.

This was starkly voiced during the time of Mr. Dorn's murder. However, the establishment media, with all infinite possibilities of having different voices and opinions (tunes), continues their chorus. It's been a recent symphony during the past 4 years Nancy Pelosi has been continuing to drive war and other questionable expenditures, and without said establishment media scrutinizing in any appreciable manner.

09 July 2020

Collage




To Show just how much in common countries have with one another.


21 April 2020

Network load performance between Starlette and Flask with urllib3, requests, and httpx clients

Flask and Starlette performance with urllib3, requests, and httpx

Source code available at https://github.com/aug2uag/starlette-flask-benchmark

The purpose of this benchmark was to evaluate the performance difference under load for a Flask and Starlette microframework with various popular HTTP clients.

These benchmark results were from 1000 cycles.

Results

Flask @ 1000 cycles (testing smaller JSON response)
urllib3:     6.009076181
requests:    8.310135888
httpx:       14.922275728
Flask @ 1000 cycles (testing larger text response)
urllib3:     6.489965677
requests:    7.959935096000001
httpx:       15.216326602
Starlette @ 1000 cycles (testing smaller JSON response)
urllib3:     6.489965677
requests:    7.959935096000001
httpx:       15.216326602
Starlette @ 1000 cycles (testing larger text response)
urllib3:     0.861392250999998
requests:    7.092012402999998
httpx:       12.933335759999999
HTTP libraries
Across the board, the httpx library underperformed relative to requests and urllib3. This might be because the httpx.get method is not benefiting from its async capabilities. The most efficient library of the three was consistently urllib3, followed by the requests library.

The size difference in the request body in this experiment had little or no effect, and indicates the difference in the request bodies was nominal.
Frameworks
Both Flask and Starlette are similar in implementation. Flask is more focused on delivering a full-stack experience, while Starlette is organized to be more biased towards headless services.

The performance of Starlette was modestly more good relative to the requests library. However, Starlette was significantly more performant with urllib3.


Discussion


The urllib3 results for Starlette may be indicating failure, although the server logs looked Ok-- the performance of urllib3 with Starlette is simply unbelievable. Starlette and Python 3 are optimized with subroutines, which may explain the dramatic differences between Flask and Starlette in their performance with urllib3 in case it is working. In that case there are clear multithreading capabilities at work that are stratespherically advantageous to utilize in high performance network I/O applications written in Python. Whereas Flask utilizes WGSI, Starlette implements ASGI that seems to be on its way for taking over Python internet gateways.

Therefore, Starlette with ASGI has superior advantages over Flask for microframework architectures.