Hacker Newsnew | past | comments | ask | show | jobs | submit | mattrighetti's commentslogin

I have a summary alias that kind of does similar things

  # summary: print a helpful summary of some typical metrics
  summary = "!f() { \
    printf \"Summary of this branch...\n\"; \
    printf \"%s\n\" $(git rev-parse --abbrev-ref HEAD); \
    printf \"%s first commit timestamp\n\" $(git log --date-order --format=%cI | tail -1); \
    printf \"%s latest commit timestamp\n\" $(git log -1 --date-order --format=%cI); \
    printf \"%d commit count\n\" $(git rev-list --count HEAD); \
    printf \"%d date count\n\" $(git log --format=oneline --format=\"%ad\" --date=format:\"%Y-%m-%d\" | awk '{a[$0]=1}END{for(i in a){n++;} print n}'); \
    printf \"%d tag count\n\" $(git tag | wc -l); \
    printf \"%d author count\n\" $(git log --format=oneline --format=\"%aE\" | awk '{a[$0]=1}END{for(i in a){n++;} print n}'); \
    printf \"%d committer count\n\" $(git log --format=oneline --format=\"%cE\" | awk '{a[$0]=1}END{for(i in a){n++;} print n}'); \
    printf \"%d local branch count\n\" $(git branch | grep -v \" -> \" | wc -l); \
    printf \"%d remote branch count\n\" $(git branch -r | grep -v \" -> \" | wc -l); \
    printf \"\nSummary of this directory...\n\"; \
    printf \"%s\n\" $(pwd); \
    printf \"%d file count via git ls-files\n\" $(git ls-files | wc -l); \
    printf \"%d file count via find command\n\" $(find . | wc -l); \
    printf \"%d disk usage\n\" $(du -s | awk '{print $1}'); \
    printf \"\nMost-active authors, with commit count and %%...\n\"; git log-of-count-and-email | head -7; \
    printf \"\nMost-active dates, with commit count and %%...\n\"; git log-of-count-and-day | head -7; \
    printf \"\nMost-active files, with churn count\n\"; git churn | head -7; \
  }; f"
EDIT: props to https://github.com/GitAlias/gitalias

Curious - why write it as a function in presumably .gitconfig and not just a git-summary script in your path? Just seems like a lot of extra escapes and quotes and stuff

It's a very old config that I copied from someone many years ago, agree that it's a bit hard to parse visually.

Not the poster, but one theory: so you only need to copy one file. Portability.

Looks like the above assumes a POSIX shell, so one could argue a dedicated script would actually be more portable.

Looks nice. Unfortunately I don't have log-of-count-and-email, log-of-count-and-day or churn


I was going to say, the OP's assertion that "they" are typing all these commands out by hand each time without an alias is just one of many tells that this post is AI slop. Nobody that proficient with shell commands should be typing any of those by hand more than once or twice without aliasing for reuse.

You could make a local `man` page.

I see tons of articles like this, and I have no doubt sqlite proved to be a great piece of software in production environments, but what I rarely find discussed is that we lack tools that enable you to access and _maintain_ SQLite databases.

It's so convenient to just open Datagrip and have a look at all my PostgreSQL instances; that's not possible with sqlite AFAIK (not even SSH tunnelling?). If something goes wrong, you have to SSH into the machine and use raw SQL. I know there are some cool front-end interfaces to inspect the db but it requires more setup than you'd expect.

I think that most people give up on sqlite for this reason and not because of its performance.


I have a project to help with that:

  uvx datasette data.db
That starts a web app on port 8001 that looks like this:

https://latest.datasette.io/fixtures



> As these were not logistical flights, they were not covered by the bilateral treaty governing U.S. military bases in Italy which allow for logistical and technical use; that led Defense Minister Guido Crosetto to deny the planes the use of the Sigonella base since permission in this case would need approval from the Italian parliament.

And:

> their flight plan was not communicated in advance to the Italian air force general staff, nor had the American aircraft received authorization to land,

Sounds like they might have gotten authorization if they had just told them in advance.


What is a logistical flight?

Cargo, passengers?

Versus combat operations.


[flagged]


This isn't the place for that

Yeah, I remember I’ve seen those signs in Luxembourg and Germany as well! We don’t have that in Italy though

Website has been hugged


Thats not good advertising for raris Performance claims.


Fair point! To be clear: rari handled the traffic perfectly fine - the issue was an overly defensive rate limiter I had configured (and it was grouping proxy traffic incorrectly). The framework itself was cruising, I just had the safety rails set too tight. Adjusted now and it's handling the load as expected!


Does anyone self host maps? If you do, mind sharing the pros, cons and tools to do that?


We've been self-hosting protomaps (aka pmtiles) for several years. The only thing you need server-side is a web server that can serve static files and supports range requests (so anything works; I've tried caddy and nginx). The map is one large file, it's easy to share it between however many servers you need.

https://docs.protomaps.com/guide/getting-started

Downsides? Nothing major that I can think of. You have to add another client-side dependency (support for their custom protocol); the library is pretty small and easy to audit.

Editing map styles is slightly more difficult because generic maplibre styles won't work with it: they add a bit of custom sauce on top. IIRC this editor worked fine, you can import one of protomaps styles and base your work off it:

https://maputnik.github.io/editor

That's probably it.


Are the names of cities/streets included in the tiles, or do they have to be placed from a different data source?


No, the names are there in the file, streets included. Their default styles did not support the languages we needed out of the box (everything was shown in the local language or English IIRC), but it was easy to fix by patching the style. I don't remember the exact fix, but it was about as simple as replacing something like `["get", "name_en"]` with `["get", ["coalesce", "name_xx", "name_en"]]`.


Is there enough information to show exact addresses? For example "221B Baker Street"


Sure. You can look at their demo, it uses the exact same single-file hosting mechanism (the network requests tab in the browser dev tools confirms it — it doesn't send any other requests), and street/house addresses are visible on the map.

https://maps.protomaps.com


How do you update pmiles? Do you have to rebuild the entire map every time? If so, I think that's a downside/limitation for some use cases.


Don't know about pmtiles specifically, but on tile servers I've used it's possible to update administrative regions separately.


Have used pmtiles to self-host a “find your nearest store” map, which only needed to cover Australia. Created two sources: (1) a low-detail worldwide map to fill out the view (about 50 MB), and (2) a medium-to-high detail source for Australia only, up to zoom level 15 (about 900 MB). In this case, there’s no need for up-to-date maps, so we were able to upload these two files to S3 and forget about them. Works great!


We use mod_tile+renderd: https://github.com/openstreetmap/mod_tile

In short: We have a script that builds a pbf of the area we are interested in (Colorado, USA) from OSM, then set up a openstreetmap-tile-server container with that data, bring in our styles, and then set up renderd.


I had to go down this path for a print-on-demand book project. If you need high-DPI assets for physical print the commercial static map APIs are prohibitively expensive or restrict usage rights for resale. Self-hosting was basically the only way to generate 300dpi rasters at scale without destroying the margins.


I do. The pros are hosting own data and have total control over stack and cloud hosting. The cons are having to code your own stack and do cloud management. I use PostGis to storage and serve vector tiles. And I use a simple backend with AWS S3 to store and serve raster data (GeoTiff COG).


Respect this commitment. I think to be honest I'd only ever consider hosting a tile server if I was actually rendering data on the tiles or there was something 'special' about them (e.g style). Using $whatever hosted tiles are likely to be faster for the user as they'll be cached, served statically.


I am hosting user data from the database. It is very easy with this stack: - PostgreSQL with PostGIS - Django with MVT-tiles plugin - MapLibre


One quick thing I can think of is multiple writers [0]

[0]: https://turso.tech/blog/beyond-the-single-writer-limitation-...


This is a huge differentiator. I built our internal meme platform with Turso. Really fun and easy to use.


How much internal traffic are you generating that single thread sqlite writes can't keep up?


The meme machine cannot be stopped. It's really not that much, but this has the nice side effect of I simply don't need to worry about it.


What's the isolation level? They only mention write-write conflicts.

The reason SQLite's BEGIN CONCURRENT does not greatly increase concurrency (unless you're very careful with your schema and queries) is as much due to page level conflict detection as it is because it enforces serializable isolation.


isn't this just pushing the complexity around? Either my write thread manages the lock, or turso's does.


MVCC is a non-locking algorithm for concurrent writers that the big databases like postgres use (with caveats like aborting some transactions if conflicts would exist). It's not a matter of pushing locks around but allowing multiple threads to operate on the data concurrently.


thanks helpful thanks. seems to have some tradeoffs. I would likely lean toward the simpler thread model but it sounds compelling.


Nice, always wanted to get my hands on eBPF and this looks like a good way to try it out. Thanks!



Finally managed to find some time to implement encryption for envelope [0]

[0]: https://github.com/mattrighetti/envelope/pull/46


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: