Skip to content

Instantly share code, notes, and snippets.

View AndreiHondrari's full-sized avatar
🌊
surfin' them life waves

Andrei-George Hondrari AndreiHondrari

🌊
surfin' them life waves
View GitHub Profile
@AndreiHondrari
AndreiHondrari / generate_django_secret_key.py
Last active January 4, 2021 14:42
Useful python scripts
import secrets
def generate_django_secret_key(length=50):
allowed_chars=(
'abcdefghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
)
return ''.join(secrets.choice(allowed_chars) for i in range(length))
@AndreiHondrari
AndreiHondrari / useful_commands.txt
Last active June 17, 2021 14:44
Useful terminal commands
# Docker
# dummy docker containers
docker create --name ubuntu_can ubuntu /bin/bash -c "sleep infinity"
docker create --name alpine_box alpine /bin/sh -c "sleep infinity"
# Image conversion
find . -name "*.jpg" -print0 | xargs -0 -I xx convert xx -resize 1920 -quality 85 xx
find . -type f -name "*.png" | xargs -I xx basename -s .png xx | xargs -I xx convert xx.png -resize 960 -quality 90 output/xx.jpg

QEMU essential commands

Observations

  • KVM acceleration is for Linux machines
  • HVF acceleration is for MacOS Hypervisor.Framework

qemu-img options explained

  • -f specify disk format