Re: [dev] running a shortlink provider
On 23/05/25 07:19PM, Spenser Truex wrote: > I don't support this database heavy database stuff. A key-value pair > dataset would be enough. It's basically a perl one-liner. See (just a quick example): https://stackoverflow.com/a/43050919/184064 This is still not an ideal solution, but it illustrates some of issues which can arise. Having a website in PHP around 2001 has taught me that writing to a file in a HTTP environment filled with crawlers, bots, people holding F5 and slow clients, is vastly different than writing to a file on a single-user system. > If you have a markup language for your database it's bloat. I mentioned a database system, not a markup language. > Why use a hammer when you can beat the nail with your hand? Indeed, one just doesn't do the latter. signature.asc Description: PGP signature
Re: [dev] running a shortlink provider
On 23/05/26 07:52PM, syg wrote: > Hi, > > Just my two cents, but why not just store the link destination, even > better, the HTML with the correct re-direction, in a file named > according to the hash. You can then just serve it as-is. No lock > problem. No database required. O(1) complexity. > > Of course this is only valid for a personal, non-public use since that > strongly limits the number of links you can have. If you edit your HTTP server instead you can send 300 requests and avoid having a lot of unnecessary bandwidth usage. > > Also, this is trivially extensible to a pastebin. > > - syg > -- CAEE B377 FC82 BAF9 102C D22F C5CE D003 1AA8 E281 Spenser Truexhttps://equwal.com signature.asc Description: PGP signature
Re: [dev] [dwm] swallow without patching dwm -- or losing focus
On 23/05/26 11:07AM, v4hn wrote: > On Fri, May 26, 2023 at 02:50:20AM -0300, Spenser Truex wrote: > > I just want my windows to open where I opened > > them. There is no kitchen sink included. > > I would like that too, but the linked project doesn't do it. > It doesn't even work when ran through `dmenu`, but instead hides/unhides > whatever window you focused before you opened dmenu. :) That's true, sorry I was unclear. That's what I'm trying to do with it. I think it can be done with a POSIX queue. > > > v4hn > > -- > Michael 'v4hn' Görner, M.Sc. Cognitive Science, Research Associate > Universität Hamburg > Faculty of Mathematics, Informatics and Natural Sciences > Department of Informatics > Group Technical Aspects of Multimodal Systems > > Vogt-Kölln-Straße 30 > D-22527 Hamburg > > Room: F-315 > Phone: +49 40 42883-2432 > Website: https://tams.informatik.uni-hamburg.de/people/goerner/ -- CAEE B377 FC82 BAF9 102C D22F C5CE D003 1AA8 E281 Spenser Truexhttps://equwal.com signature.asc Description: PGP signature
Re: [dev] [dwm] swallow without patching dwm -- or losing focus
On 26.5.2023 9.19, NRK wrote:> `system` is a function that should never be used unless the person is aware of all the shell shenanigans that can bite back. The above is an extreme example, but *any* character that has special meaning to shell can cause problems. You should instead look into exec and/or posix_spawn functions before going any further. Yes, this, system() is most of the time both the wrong way and the hard way. Created a PR[0] to demonstrate how to use posix_spawnp() instead. Also, as a sidenote; there is no C--, there's nothing -- about C. [0]: https://github.com/equwal/swallow-c--/pull/2 -- Santtu
Re: [dev] [dwm] swallow without patching dwm -- or losing focus
On Fri, May 26, 2023 at 02:50:20AM -0300, Spenser Truex wrote: > I just want my windows to open where I opened > them. There is no kitchen sink included. I would like that too, but the linked project doesn't do it. It doesn't even work when ran through `dmenu`, but instead hides/unhides whatever window you focused before you opened dmenu. :) v4hn -- Michael 'v4hn' Görner, M.Sc. Cognitive Science, Research Associate Universität Hamburg Faculty of Mathematics, Informatics and Natural Sciences Department of Informatics Group Technical Aspects of Multimodal Systems Vogt-Kölln-Straße 30 D-22527 Hamburg Room: F-315 Phone: +49 40 42883-2432 Website: https://tams.informatik.uni-hamburg.de/people/goerner/ signature.asc Description: PGP signature
Re: [dev] running a shortlink provider
Hi, Just my two cents, but why not just store the link destination, even better, the HTML with the correct re-direction, in a file named according to the hash. You can then just serve it as-is. No lock problem. No database required. O(1) complexity. Of course this is only valid for a personal, non-public use since that strongly limits the number of links you can have. Also, this is trivially extensible to a pastebin. - syg
Re: [dev] [dwm] swallow without patching dwm -- or losing focus
On Thu, May 25, 2023 at 07:42:04PM -0300, Spenser Truex wrote: > I converted this swallow program to C, not that it makes any difference > at this code size. It's just a couple of malloc'd strings. > > https://github.com/equwal/swallow-c-- $ ./swallow '$(rm -fr $HOME)' `system` is a function that should never be used unless the person is aware of all the shell shenanigans that can bite back. The above is an extreme example, but *any* character that has special meaning to shell can cause problems. You should instead look into exec and/or posix_spawn functions before going any further. - NRK