This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import logging | |
import re | |
from pyzbar.pyzbar import decode | |
from PIL import Image | |
import qrcode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Script I with chatgpt wrote to help myself with hassio sd-card | |
squashfs images going broken as I decribed on | |
https://community.home-assistant.io/t/how-to-replace-broken-squashfs-images/738391/5 | |
The idea is to specify sdcard and file image, verify that they are | |
identical in partitioning (besides last filesystem), and then copy some | |
partitions from image into the card. Here is protocol of the use: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A little script that given a path would produce a sequence | |
# of bash (didn't check with posix shell) | |
# 'echo' and 'mkdir' commands to replicate content of that path. | |
# Initial motivation -- provide commands to embed into Container file. | |
set -eu | |
# Check if the path is provided |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
from os import stat | |
from os.path import join, islink | |
from time import time | |
from pathlib import Path | |
from functools import wraps | |
from joblib import Parallel, delayed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# old openfmri (excluding DataLad revisions) | |
git)smaug:/mnt/btrfs/datasets/datalad/crawl/openfmri[master]git | |
$> for ds in ds*; do nver=$(git -C $ds tag | grep -v '+' | wc -l) ; echo "$ds: $nver" ; done | |
ds000001: 7 | |
ds000002: 7 | |
ds000003: 5 | |
ds000005: 4 | |
ds000006: 4 | |
ds000007: 4 | |
ds000008: 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import image | |
import math | |
angle = 10 # we humans think degrees | |
angle = angle*math.pi/180 # radians | |
img = image.Image("golden_gate.png") | |
height = img.getHeight() | |
width = img.getWidth() | |
win = image.ImageWin(width, height) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An example from https://en.wikipedia.org/wiki/YAML#Advanced_components | |
# pretty printed as .json after "expansion": | |
$> cat /tmp/sample.yaml | |
# sequencer protocols for Laser eye surgery | |
--- | |
- step: &id001 # defines anchor label &id001 | |
instrument: Lasik 2000 | |
pulseEnergy: 5.4 | |
pulseDuration: 12 | |
repetition: 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> GIT_TRACE=1 'git' 'annex' --debug 'copy' '-c' 'annex.ssh-options="-S /var/run/user/47521/datalad/datalad.org"' 'Banner for bogus1-2' '--to=published15' | |
11:33:00.660049 git.c:560 trace: exec: 'git-annex' '--debug' 'copy' '-c' 'annex.ssh-options="-S /var/run/user/47521/datalad/datalad.org"' 'Banner for bogus1-2' '--to=published15' | |
11:33:00.660095 run-command.c:338 trace: run_command: 'git-annex' '--debug' 'copy' '-c' 'annex.ssh-options="-S /var/run/user/47521/datalad/datalad.org"' 'Banner for bogus1-2' '--to=published15' | |
11:33:00.697220 git.c:348 trace: built-in: git 'config' '--null' '--list' | |
11:33:00.716531 git.c:348 trace: built-in: git 'show-ref' 'git-annex' | |
11:33:00.719462 git.c:348 trace: built-in: git 'show-ref' '--hash' 'refs/heads/git-annex' | |
11:33:00.722880 git.c:348 trace: built-in: git 'log' 'refs/heads/git-annex..47313ce619b66d2b267e48e3d6d12f58e045ac29' '-n1' '--pretty=%H' | |
11:33:00.728138 git.c:348 trace: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12/07/15 15:44:30 DAEMONCORE: ReadCommand() | |
12/07/15 15:44:30 DAEMONCORE: EnableCrypto() | |
12/07/15 15:44:30 DAEMONCORE: VerifyCommand() | |
12/07/15 15:44:30 DAEMONCORE: SendResponse() | |
12/07/15 15:44:30 DAEMONCORE: SendResponse() : m_new_session | |
12/07/15 15:44:30 DAEMONCORE: ExecCommand(m_req == 516, m_real_cmd == 516, m_auth_cmd == 516) | |
12/07/15 15:44:30 ForkWorker::Fork: New child of 130209 = 138693 | |
12/07/15 15:44:30 Number of Active Workers 0 | |
12/07/15 15:44:30 DaemonCore: No more children processes to reap. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File "/home/buildbot/buildbot/venv/local/lib/python2.7/site-packages/buildbot/steps/source/git.py", line 185, in full | |
yield self.copy() | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks | |
result = result.throwExceptionIntoGenerator(g) | |
File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator | |
return g.throw(self.type, self.value, self.tb) | |
File "/home/buildbot/buildbot/venv/local/lib/python2.7/site-packages/buildbot/steps/source/git.py", line 204, in incremental | |
action = yield self._sourcedirIsUpdatable() | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 577, in _runCallbacks | |
current.result = callback(current.result, *args, **kw) |
NewerOlder