Skip to content

Instantly share code, notes, and snippets.

View andreif's full-sized avatar
👾
invading spaces

Andrei Fokau andreif

👾
invading spaces
View GitHub Profile
@andreif
andreif / podman_macos.md
Created April 13, 2022 06:17 — forked from kaaquist/podman_macos.md
Podman with docker-compose on MacOS.

Podman with docker-compose on MacOS.

Podman an alternative to Docker Desktop on MacOS

Getting podman installed and started is super easy.
Just use brew to install it.

> brew install podman

Now since podman uses a VM just like the Docker Client on MacOS we need to initialize that and start it.

# convert. note: must contain trailing new line
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
# generate new key
ssh-keygen -t ed25519 -C ""
ssh-keygen -t rsa -b 4096 -C "" -m PEM
# public part for ssh
ssh-keygen -y -f somekey > somekey.pub
ffmpeg -i "http://example.com/video_url.m3u8" -c copy -bsf:a aac_adtstoasc "output.mp4"
@ EXPECTED=$$(cat test/__init__.py | head -1 | cut -d " " -f3); \
pytest --collect-only | grep "collected $$EXPECTED items" || \
(echo "\033[1;31mERROR: Collected number of tests does not match $$EXPECTED \033[0m" && exit 1)
alias pip-uninstall-all="pip freeze --local | xargs -r pip uninstall -y"
# pip freeze --exclude-editable
# https://realpython.com/pypi-publish-python-package/
pip install twine
python ./setup.py sdist bdist_wheel
python ./setup.py --help-commands
twine check dist/*
# not working: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
twine upload dist/*
from datetime import datetime, timedelta
import AppKit
import Foundation
import PyObjCTools.AppHelper
class App(Foundation.NSObject):
started_at = status_item = duration = None
callbacks = {}
from datetime import datetime
from functools import wraps
from django.core.cache import cache
def locked(timeout):
def decorate(func):
@wraps(func)
def call(*args, **kwargs):
key = f"locked:{func.__name__}"
if [ $# -eq 0 ]; then
echo "No arguments supplied"
return
fi
LOCAL="/Users/andrei/Project/src/$1/"
REMOTE="andrei@10.0.0.1:~/src/$1"
RSYNC="rsync -avzr --exclude=.git --exclude=ENV --exclude=dist"
FSWATCH='fswatch -0rl 3 --exclude=".*\.git.*" --exclude=".*___jb_.*"'
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
elif settings.IS_LOCAL: # for testing with DEBUG=False
urlpatterns += patterns('',
(r'^%s(?P<path>.*)$' % re.escape(settings.STATIC_URL.lstrip('/')),
'django.contrib.staticfiles.views.serve', {'insecure': True}),
(r'^%s(?P<path>.*)$' % re.escape(settings.MEDIA_URL.lstrip('/')),
'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),