To learn more about the e2scrub_all.timer on your system, you can use these systemctl commands:
- View timer details:
systemctl status e2scrub_all.timer
import AVFoundation | |
import Foundation | |
import os | |
// Microphone permission (supports macOS, fallback) | |
func requestMicrophonePermission() async -> Bool { | |
await withCheckedContinuation { continuation in | |
AVCaptureDevice.requestAccess(for: .audio) { granted in | |
continuation.resume(returning: granted) | |
} |
;; This is miraculously all you need to add decent support for python. | |
;; It requires that you have uv installed. Then run `eglot` in a python buffer. | |
(use-package eglot | |
:defer t | |
:config | |
(add-to-list 'eglot-server-programs | |
`(python-mode . ,(split-string "uvx --quiet --from pyright pyright-langserver --stdio")))) | |
;; this is handy for dumping web pages into buffers, to then add them to context for AI with gptel | |
(defun alg/insert-markdown-from-url (url) |
def find_free_port(candidates=[]): | |
for p in (candidates + [0]): | |
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: | |
try: | |
s.bind(('localhost',p)) | |
return s.getsockname()[1] | |
except Exception: | |
logging.info(f"Could not bind to port {p}. Trying another") | |
port = find_free_port([5001,5010,5100]) |
#!/usr/bin/env python3 | |
import os, os.path, sys, urllib.parse, base64, subprocess | |
def on_iterm2(): return 'ITERM_SESSION_ID' in os.environ or os.environ.get('LC_TERMINAL','') == 'iTerm2' | |
def on_macOS(): return sys.platform == 'darwin' | |
def on_remote_host(): return 'SSH_CLIENT' in os.environ or 'SSH_TTY' in os.environ | |
def openurl(url): |