cli

81 posts tagged “cli”.

  1. 2023
  2. Counting SQLite virtual machine operations

    When SQLite executes a query, it does so by executing a sequence of virtual machine operations. There are mechanisms for cancelling a query after a specific number of these operations, to protect…

    1 min read
  3. Google Chrome --headless mode

    In the README for monolith (a new Rust CLI tool for archiving HTML pages along with their images and assets) I spotted this tip for using Chrome in headless mode to execute JavaScript and output the…

    2 min read
  4. Fixing broken text encodings with sqlite-transform and ftfy

    I was working with a database table that included values that were clearly in the wrong character encoding - values like this: Rue Léopold I I used my sqlite-transform tool with the ftfy Python…

    1 min read
  5. Accessing 1Password items from the terminal

    I save things like API keys in 1Password. Today I figured out how to access those from macOS terminal scripts.

    1 min read
  6. A simple pattern for inlining binary content in a Python script

    For simonw/til issue 82 I needed to embed some binary content directly in a Python script. I wanted to wrap that content to fit within 80 columns.

    1 min read
  7. Explicit file encodings using click.File

    I wanted to add a option to which could be used to change the file encoding used to read the incoming CSV or TSV file - see sqlite-utils 182.

    1 min read
  8. Extracting objects recursively with jq

    The Algolia-powered Hacker News API returns nested comment threads that look like this: https://hn.algolia.com/api/v1/items/27941108 (For this story: https://news.ycombinator.com/item?id=27941108) I…

    1 min read
  9. Converting Airtable JSON for use with sqlite-utils using jq

    The Airtable API outputs JSON that looks like this: The items in the array each have an , a nested dictionary and a .

    1 min read
  10. Accessing repository dependencies in the GitHub GraphQL API

    Access to a Repositories Dependency Graph describes a preview API for accessing GitHub repository dependencies.

    1 min read
  11. Building Mastodon bots with GitHub Actions and toot

    Twitter announced today that they'll be ending free API access for bots. My @covidsewage Twitter bot posts a screenshot of the latest Covid sewage data for parts of the San Francisco Bay Area every…

    2 min read
  12. Finding the largest SQLite files on a Mac

    This runs using Spotlight so it's really fast: mdfind "kMDItemDisplayName == .sqlite" -0 xargs -0 stat "-f%z %N" sort -nr head -n 20 I have a lot of files in my Dropbox so I excluded those like this…

    1 min read
  13. Generating documentation from tests using files-to-prompt and LLM

    I was experimenting with wasmtime-py today and found the current documentation didn't quite give me the information that I needed.

    2 min read
  14. Downloading every video for a TikTok account

    TikTok may or may not be banned in the USA within the next 24 hours or so. Here's a pattern you can use to download all of the videos from a specific account.

    2 min read
  15. How to call pip programatically from Python

    I needed this for the and commands, see issue 925. My initial attempt at this resulted in weird testing errors ( 928) - while investigating them I stumbled across this comment in the source code: So I…

    1 min read
  16. Expanding ChatGPT Code Interpreter with Python packages, Deno and Lua

    Update: Code Interpreter often claims that it can't run binaries uploaded like this, but it looks like it still works if you are are persistent enough with it.

    4 min read
  17. How to create a tarball of a git repository using "git archive"

    I figured this out in a Gist in 2016 which has attracted a bunch of comments over the years. Now I'm upgrading it to a retroactive TIL.

    1 min read
  18. Enabling a user to execute a specific command as root without a password

    I wanted a script running as a non-root user to be able to restart a systemd service on my Ubuntu machine without needing a password.

    1 min read
  19. git bisect

    I fixed two bugs in Datasette using - a tool which lets you run an automated binary search against a commit log to find the source of a bug.

    1 min read
  20. Comparing two training datasets using sqlite-utils

    WizardLM is "an Instruction-following LLM Using Evol-Instruct". It's a fine-tuned model on top of Meta's LLaMA.

    3 min read
  21. Converting no-decimal-point latitudes and longitudes using jq

    I had some data with weird co-ordinates in it: Note the and in there. I know that this data refers to somewhere in Houston, and a few people on Twitter pointed out that it's actually really simple…

    1 min read