Yeah good point. I suppose the problem is this function that operates on numbers allows numeric strings to be passed in in the first place. The only place where I would really expect numeric strings to exist is captured directly from user input which is where the parsing into a numeric data type should happen, not randomly in a library function.
- 0 Posts
- 11 Comments
418teapot@lemmy.worldto
Linux@lemmy.ml•Why is OpenSSL able to use a key file my user shouldn't have access to?English
17·1 year agoOn my machine at least
man opensslshows that-kis for specifying the password you want to derive the key from, so in that case I think you are literally using the string/etc/ssl/private/etcBackup.keyas the password. I think the flag you want is-kfile.You can verify this by running the command in
straceand seeing that there is noopenatcall for the file passed to-k.Edit: metiulekm@sh.itjust.works beat me to it while I was writing out my answer :)
418teapot@lemmy.worldto
Programmer Humor@programming.dev•average day in NPM landEnglish
354·1 year agoIt’s kind of insane how bad this whole
is-numberthing is. It’s designed to tell you if a string is numeric, but I would argue if you’re ever using that you have a fundamental design problem. I hate dynamic typing as much as anyone else, but if forced to use it I would at least try to have some resemblance of sanity by just normalizing it to an actual number first.Just fucking do this…
const toRegexRange = (minStr, maxStr, options) => { const min = parseInt(minStr, 10); const max = parseInt(maxStr, 10); if (isNaN(min) || isNaN(max)) throw Error("bad input or whatever"); // ...Because of the insanity of keeping them strings and only attempting to validate them (poorly) up front you open yourself up to a suite of bugs. For example, it took me all of 5 minutes to find this bug:
toRegexRange('+1', '+2') // returns "(?:+1|+2)" which is not valid regexp
418teapot@lemmy.worldto
Programmer Humor@programming.dev•FLOSS communities right nowEnglish
1·2 years agoAgreed, but my point is with a centralized network the lowest common denominator wins. There is no reason you can’t have QoL features on an open network, and thusly let everyone have the features that they care most about.
Can you imagine what a shithole the internet would have been if email wasn’t federated an open? There is absolutely no way that whatever centralized bullshit would have spawned instead would already be either long gone or enshittified to the point of being useless.
418teapot@lemmy.worldto
Programmer Humor@programming.dev•FLOSS communities right nowEnglish
61·2 years agoGood for you, you have a short list of requirements out of a chat service and discord perfectly fills your niche. But different people have different requirements for chat, and they don’t align. And network effects force people who have differing requirements to use the service with the most users which sucks.
For instance here are things that I require from any chat service that I use that discord completely falls flat at:
- Ability to run it on my linux machine without using an electron client (npm is a huge mess of supply chain attacks and I refuse to run any software that is likely to contain dependencies from it)
- Ability to run it on my AOSP phone which does not have any google play services installed
- Ability to write software to back up messages without fear of a company changing their API and breaking my backup system
418teapot@lemmy.worldto
No Stupid Questions@lemmy.world•If incandescent lightbulbs have a vacuum inside, why do they get so hot on the outside?
2·2 years agoIf I super heat a metal and it turns visibly red what is happening? Was it already emitting infrared and as it gets hotter the frequency shifts up? Or is it still emitting infrared but has a wider band of frequencies it is emitting as well (i.e. is it emitting frequencies below infrared as well as visible red)?
418teapot@lemmy.worldto
Fediverse@lemmy.world•What's the situation with Peertube?English
3·2 years agoI just tried subscribing to !sircmpwn@spacepub.space, but it’s empty despite the peer tube channel having many videos. Any idea what’s going on?
418teapot@lemmy.worldto
Linux@lemmy.ml•Anyone else starting to favor Flatpak over native packages?English
2·3 years agoI haven’t used any flatpacks, mostly because they don’t seem to have a good solution for running terminal programs. (Also I don’t like that the application developer chooses the permissions to expose rather than the user.
However, I have been using bubblewrap which is what flatpack uses under the hood to sandbox. This allows me to run both gui and non-gui programs, and I have the control of exposing the minimum required permissions that I’m comfortable giving an untrusted piece of software.
I seem to be in the minority here but I personally prefer using
and#to denote root. I like this because not everyone uses sudo and might not even have it installed.That being said, if you already have other commands that are using
sudo -u ...to run commands as a different user then it might be best to just be consistent and prefix everything with it, but if there is only a few of those maybe acp foo bar && chown www-data baris an alternative.
it has a nice working sync of connection profiles (even of ssh keys…encrypted!)
Sorry, but what on earth does this have to do with a terminal emulator? Something like this makes way more sense as a separate tool. It’s like if I was making a decision of what video player to use because it can sync my browser bookmarks.
Best I can do is
"\ude41🙂".split("").reverse().join("")returns
"\ude42🙁"