Skip to content

Instantly share code, notes, and snippets.

@radupotop
radupotop / openpgp-card-guide.md
Created April 2, 2023 09:59 — forked from ageis/openpgp-card-guide.md
Quick GPG Smartcard Guide
From 4e270c2a67ecc627f87c8f37c6e36df0e67e7515 Mon Sep 17 00:00:00 2001
From: Radu Potop <radu@wooptoo.com>
Date: Thu, 16 Feb 2023 17:28:17 +0000
Subject: [PATCH] update
---
.SRCINFO | 10 +++++-----
PKGBUILD | 13 ++++++-------
2 files changed, 11 insertions(+), 12 deletions(-)
@radupotop
radupotop / sonata.txt
Created February 6, 2023 09:57
sonata
running install_egg_info
Traceback (most recent call last):
File "/home/tail/.cache/yay/sonata-git/src/sonata/setup.py", line 63, in <module>
setup(
File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 108, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
@radupotop
radupotop / create-superuser.py
Last active January 9, 2023 14:10 — forked from c00kiemon5ter/create-superuser.py
Extend Django's management createsuperuser command to allow non-interactive creation of a superuser with a password.
"""
Extend createsuperuser command to allow non-interactive creation of a
superuser with a password.
Instructions:
mkdir -p path-to-your-app/management/commands/
touch path-to-your-app/management/__init__.py
touch path-to-your-app/management/commands/__init__.py
@radupotop
radupotop / Reviewing profiles
Last active January 9, 2023 13:57 — forked from mmalone/Reviewing profiles
Replacement Django runserver command that does profiling... because I've rewritten this too many times.
>>> import pstats
>>> p = pstats.Stats('p.1258156459.52174278XcQE.prof')
>>> p.strip_dirs().sort_stats(-1).print_stats(5)
Fri Nov 13 15:54:20 2009 p.1258156459.52174278XcQE.prof
124278 function calls (122386 primitive calls) in 0.589 CPU seconds
Ordered by: standard name
List reduced from 1014 to 5 due to restriction <5>
alias cfg="git --git-dir=$HOME/.cfg --work-tree=$HOME"
alias cfg-tig="env GIT_DIR=$HOME/.cfg GIT_WORK_TREE=$HOME tig"
// Thomann Delete all items from basket.
var items = document.getElementsByClassName('delete-action')
for (var i = 0; i < items.length; i++) {
items[i].click()
}
#!/usr/bin/env python3
import CloudFlare
import argparse
import sys
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-e", "--email", required=True, help="The Cloudflare login email to use")
parser.add_argument("-n", "--hostname", required=True, help="The hostname to update, e.g. mydyndns.mydomain.com")
parser.add_argument("-k", "--api-key", required=True, help="The Cloudflare global API key to use. NOTE: Domain-specific API tokens will NOT work!")
error: failed to run custom build command for `openssl-sys v0.9.72`
Caused by:
process didn't exit successfully: `/home/alarm/cfddns/src/cfddns-1.6.2/target/release/build/openssl-sys-f45f371ab842d1b0/build-script-main` (exit s
tatus: 101)
--- stdout
cargo:rustc-cfg=const_fn
from celery import current_app
def send_task(name, args=(), kwargs={}, **opts):
task = current_app.tasks[name]
return task.apply(args, kwargs, **opts)
if 'test' in sys.argv:
current_app.send_task = send_task