keinerweiss.de
2022/04/09

Heureka - Blog

The small success stories are the ones that count.

Linux: Getting started with Stable Diffusion

Stable Diffusion is a AI image generator that runs on your own machine.

For Windows there are plenty of easily executable builds but we want to run it on Linux.

My attention was caught with this video and then I tried to figure out how to run it on Linux.

As far as I understand, it only works with pretty strong NVIDIA cards. I have a GeForce 3080 Ti with 12GB VRAM and can generate images of 256x512 Pixels in size within a few seconds but not much bigger.

→ Read more...

 

Metasploitable 2 does not start in VirtualBox 6

Change from USB 2 to USB 1.1. Then restart the VM.

Error was

The VM session was aborted.
Fehlercode: NS_ERROR_FAILURE (0x80004005)
Komponente: SessionMachine
Interface: ISession {c0447716-ff5a-4795-b57a-ecd5fffa18a4}

Python slow when concatenating strings

I was concatenating translation file contents to one string and observed rather long runtimes.

Turns out Python is not very efficient in this regard. So I reworked it to use a list.

strings_test.py
import time
 
start = time.time()
str1 = ""
for i in range(1,10000000):
    str1 += "A"*1000
print("Concat took: " + str(time.time() - start))
 
start = time.time()
str1 = ""
str2 = []
for i in range(1,10000000):
    str2.append("B"*1000)
print("List collection took: " + str(time.time() - start))
 
start = time.time()
str1 = "\n".join(str2)
print("Final join took: " + str(time.time() - start))
Concat took: 4.820241689682007
List collection took: 0.9731082916259766
Final join took: 2.7453043460845947

You are here: start » keinerweiss.de » Heureka - Blog