2022-11-28

Published: Dec 05, 2022Last modified: Apr 24, 2023
Word count: 372

bb system interface via osquery

osquery + babashka is pretty close to ralphie / clawe. Maybe i should start refactoring towards using osquery for broader applicability?

In particular, he gets into using honeysql for the osquery language!

making clojure more interactive discussion

i ought to watch that 15 year round table

clojurians programmable desktop qq

I've been building up a tool like this - it's a bit of a never-ending project, but for me it's worth it to configure window-management code (keybindings and workspace/client behavior) in a clojure repl, then run keybindings/commands via babashka. I also think it's worth it just to own your own tools/dotfiles/etc.

It's not super mature, but I've been using it/refactoring it for a few years, and can say that I love it - these days I'm trying to rework things to separate my own config from the project itself, and add more wms (it supports awesomewm and yabai right now, but i3 and bspwm impls seem reasonable).

The recent osquery stuff is intriguing - I'm considering refactoring some of my namespaces to use it, as I'd expect it to be more broadly applicable.

One of my favorite hacks (though very AwesomeWM specific) is [this namespace](https://github.com/russmatney/clawe/blob/b0e37b2e0a417aae1659212001f7322669932221/src/ralphie/awesome.clj) and `ralphie.awesome/fnl` macro, which lets you write syntax-quoted fennel directly in clojure.

---

One thing that was a nice win (besides babashka itself) was babashka adding support for `-x`, which made it easy to execute any function in the project - that's how most of the bindings work, and you can get pretty far on just that.

---

The workflow I use is deving against a full jvm clojure repl, so the debugging experience is fully featured, but most of the things actually execute via babashka. You have to be careful/aware that things are not always 1:1, but for me that's only occurred when a library I want to reach for is not compatible.

clojure launchpad - what is this?

the one about lisp interactivity

programmy goals

> DONE neil better error message

>> handle in neil/curl or neil/git layer?

>> print error interferes with piping apis

maybe this is ok in the error case

>> system/exit 1, or nil-pun everywhere?

>> neil/curl comment and good/bad responses

(comment
  (->>
    (repeat 58 ".")
    (map
      (fn [_]
        (let [lib :babashka/neil]
          (curl-get-json (format "https://api.github.com/repos/%s/%s"
                                 (namespace lib) (name lib))))))
    doall
    )

  (def good-resp
    {:status  200
     :headers
     {"access-control-expose-headers"
      "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
      "referrer-policy"               "origin-when-cross-origin, strict-origin-when-cross-origin"
      "content-encoding"              "gzip"
      "server"                        "GitHub.com"
      "content-type"                  "application/json; charset=utf-8"
      "access-control-allow-origin"   "*"
      "x-content-type-options"        "nosniff"
      "content-length"                "1477"
      "x-frame-options"               "deny"
      "strict-transport-security"     "max-age=31536000; includeSubdomains; preload"
      "x-ratelimit-limit"             "60"
      "x-ratelimit-remaining"         "58"
      "x-ratelimit-reset"             "1669678835"
      "x-github-api-version-selected" "2022-11-28"
      "accept-ranges"                 "bytes"
      "x-github-request-id"           "F0E9:02F1:9CF3F:141F60:63853A3A"
      "etag"                          "W/\"d4ed4dbc540fc54c35f5cab206c59ab6cf8c84b623328a1457a38dfac6881c89\""
      "x-ratelimit-used"              "2"
      "x-github-media-type"           "github.v3; format=json"
      "date"                          "Mon, 28 Nov 2022 22:46:20 GMT"
      "vary"                          "Accept, Accept-Encoding, Accept, X-Requested-With"
      "x-ratelimit-resource"          "core"
      "last-modified"                 "Thu, 24 Nov 2022 12:10:32 GMT"
      "x-xss-protection"              "0"
      "content-security-policy"       "default-src 'none'"
      "cache-control"                 "public, max-age=60, s-maxage=60"}
     :body    ""
     :err     ""
     :process nil ;;#object [java.lang.ProcessImpl 0x5d5cfb40 "Process[pid=23641 exitValue=0]"]
     :exit    0})

  (def bad-response
    {:status  403
     :headers
     {"access-control-expose-headers"
      "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-RateLimit-Used, X-RateLimit-Resource, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
      "referrer-policy"             "origin-when-cross-origin, strict-origin-when-cross-origin",
      "server"                      "Varnish",
      "content-type"                "application/json; charset=utf-8",
      "access-control-allow-origin" "*",
      "x-content-type-options"      "nosniff",
      "content-length"              "279",
      "x-frame-options"             "deny",
      "strict-transport-security"   "max-age=31536000; includeSubdomains; preload",
      "x-ratelimit-limit"           "60",
      "x-ratelimit-remaining"       "0",
      "x-ratelimit-reset"           "1669678834",
      "x-github-request-id"         "F19B:47C3:DA282:1BE7F9:63853C57",
      "x-ratelimit-used"            "60",
      "x-github-media-type"         "github.v3; format=json",
      "date"                        "Mon, 28 Nov 2022 22:55:19 GMT",
      "x-ratelimit-resource"        "core",
      "x-xss-protection"            "1; mode=block",
      "content-security-policy"     "default-src 'none'; style-src 'unsafe-inline'"},
     :body    "{\"message\":\"API rate limit exceeded for 71.206.52.173. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\"documentation_url\":\"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting\"}\n"
     :err     "",
     :process nil
     :exit    0}))

> TODO neil handle upgrading more than just :extra-deps