- Set
ControllerMode = bredrby editing/etc/bluetooth/main.conffile usingsudo nano /etc/bluetooth/main.confcommand (or another text editor of your choice) sudo /etc/init.d/bluetooth restart
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
| # In a PROOT, pixi installs like `clear` (ncurses) don't always seem to find libs. | |
| # Setting an LD_LIBRARY_PATH in pixi.toml made it work nevertheless in a PROOT. | |
| [activation.env] | |
| LD_LIBRARY_PATH = "$PIXI_PROJECT_ROOT/.pixi/envs/$PIXI_ENVIRONMENT_NAME/lib" |
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
| hf jobs run --ssh --flavor cpu-basic \ | |
| quay.io/jupyter/pytorch-notebook \ | |
| -- jupyter lab --no-browser --NotebookApp.token="" --NotebookApp.password="" | |
| # Use ssh with local port forwarding to connect (ssh -L 8888:localhost:8888 <jobnr>@ssh.hf.jobs) |
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
| select regexp_substr('1,2,3,4','[^,]+', 1, level) | |
| from dual | |
| connect by regexp_substr('1,2,3,4', '[^,]+', 1, level) is not null; | |
| -- Nice, smart, declarative way to split a comma-delimited string in Oracle SQL. | |
| -- From: https://forums.oracle.com/ords/apexds/post/the-fastest-way-to-convert-comma-separated-list-into-table-3353 | |
| -- This may be slow for a long string, but for parsing a config value this results in concise code and may prevent boilerplate code. | |
| -- Replace the 'copied & pasted' string (e.g. '1,2,3,4' in the example above) by one variable/constant in PL/SQL. |
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
| # Not for efficiency | |
| def permutations(data, sign=0): | |
| return ([(1, data)] | |
| if len(data) == 1 else | |
| [(sign * -1 if idx % 2 == 1 else sign, [value] + nested_permutation) | |
| for idx, value in enumerate(data) | |
| for sign, nested_permutation in permutations(data[:idx] + data[idx+1:])] | |
| ) |
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
| const exec = (cmd) => console.log(require('child_process').execSync(cmd, { encoding: 'utf-8'})) |
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
| d2c() { | |
| docker save "$1" | ctr image import - | |
| } |
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
| from cryptography import x509 | |
| from cryptography.hazmat.backends import default_backend | |
| import socket | |
| import ssl | |
| from datetime import datetime | |
| HOST = 'www.rabobank.nl' | |
| def check_cert(host): | |
| context = ssl.create_default_context() |
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 | |
| # Install enscript and ps2pdf if not present | |
| # -r for rotate (landscape) | |
| ls -A *.txt | xargs -n 1 -I{} sh -c "enscript -r {} -o - | ps2pdf - {}.pdf" |
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 | |
| # Note: filenames are fixed, replace before use | |
| gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=ae.pdf ae2.pdf |
NewerOlder