You should learn vim if you want to deal with systems. You can learn vim or not if you don't.
lookback: vi, sh and unix have become your vim, bash and linux systems of today. Now, while they have forward compatibility, of sorts, vi and sh, the same cannot be said in reverse, as a rule. Modern bash folks have bent bourne shell syntax into foreign looking contortions where bourne shell syntax is a) performant and conformant, b)a lot simpler when simpler is better and c) is why bash maintains posix.
I agree, learn basic vim. And bash. But not really to program with. It's more of a burden than not for a million languages and formats.
Not to be that guy but this is mostly garbage. I suggest simply paying attention and testing. Switches can be a useful part of the tool but they can break things. It doesn't make things better rather it alters behaviors of the shell in sometimes unintended ways. Try some loops with some -eo. If you have a pipe that fails your script you're just ripping the heart and potential out of your script. I think you might just be looking for one-liners. It can be good to catch your failures and try other things vs "woop, damn, nope." Maybe you need things to fail first.
"Quote liberally" - also ripe. Mind your aPostrophes and Quotes because they do things.
I like writing for me and what I need done, not what or how others might have me write or how others might think it should be done.
The shell is a base orchestration and interface tool for your os. If you think it's just that bad then just stick to your language of choice but please refrain from suggesting lazy habits make a better shell, they don't.
Ok, "garbage" may have been harsh but how about a fun example? Try this with and without -e
#!/usr/bin/env bash
bell=`tput bel`
tock='Blastoff!'
do_ring()
{
if [ "$1" ]; then # true
echo -n $bell; sleep 0.1
echo -n $bell; sleep 0.1
echo -n $bell; sleep 0.1
echo $tock
else
echo -n $bell; sleep 0.1
fi
}
i=3
while [ "$i" -ge "0" ];
do
if [ $i = 0 ]; then
sleep 0.5
echo ok
else
echo $i $bell
sleep 0.5
fi
i=`expr $i - 1`
done
do_ring $1 # do something different if arg
sleep 1
echo neat.
Semantic qualities aside there is something here that breaks with -e and if you're used to using -e by default you might be baffled and think shell sucks, for example.
I can appreciate the quip, especially given my curmundgeonly entry. But the point remains. The shell needs to be able to call any command on the system reliably. Even aged old counting methods. At no point in that loop would the expr subprocess return other than zero. Try to break out of that loop with that bash switch.
One should not rely on these magics, the ones that alter runtime behaviors, without truly understanding what you're after and what you're writing. Or mostly understand. They're fine and good if you have narrow routines with a very strict focus - "I'm in, I'm out, bang."
The best switches available to the shell without a bunch of feature and package and library this or that bloat are exactly
-x
-n
That's all that you need to ensure that your scripting is what you need it to be. Introduce the magic after you've written the thing. When it's ready and it passes your tests then test it again.
Every single utility and package on that system is at your fingertips. Demand accuracy. I do.
Sorry, I got a little discombobulated with your life in macos is better than unix/linux comment, but only because macos is unix. Thus life is better because macos is unix - unix with an excellent window treatment, no less.
If you are HN, you are expected to be able to understand that we all know that macOS is Unix and any reference to Unix/Linux means non-macOS. I contributed the first SCSI driver to Linux 0.12 so I've been around. Calling macOS "window dressing" doesn't suggest deep insight nor working experience with macOS.
The fact is that my professional working experience with daily driving macOS is, in my opinion, a nicer experience that the equivalent Gnome/KDE (though it goes deeper than that). Still I spend a roughly equivalent amount of time there (and some in FreeBSD).
But the trolling is a serious problem and more effort needs to go into addressing it directly. This is the stuff that righteous idiots grab a hold of - it's basically an iron buoy thrown to people that can't swim.
To top poster: these two things are not the same. They are wholly different classes where at the very base level one cannot exist without the other, literally. One is a utility provisioning and the other an appliance, figuratively.
lol. I guess that I'm a righteous idiot then (ie. someone who might not agree with you).
Mostly, the point is that people choose their battles based on bias or their own needs, not some sort of overall logic.
I can understand the argument over the various sorts of non-neutrality. A need to bring together cable tv and internet pricing and bandwidth needs, the opportunity to break out fixed and variable pricing on bytes moved, etc. The main point is that it simply isn't as simple as waving a sign around and getting out the vote.
Heck, we might as well all get worked up about the fact that the USPS allows you to buy 1 day shipping or that the shipping companies cut special deals with large customers. Another example is toll roads.
The world is a complicated place and doesn't succumb well to slogans.
Right, for the masses, but for focused enterprise, like a well resourced gang, for instance, refortifying your security is just another build away. Add on some sneakernet transport and side-load instructions and the only people affected by a weakened platform is everyone else.
A country that's going to mandate backdoors/access to such communications, are going to outlaw communication methods they can't backdoor.
Say Apple makes a federated end-to-end encrypted messenger app, the government will still go to Apple and say "let us read all the messages, otherwise you can't sell your devices". THAT is the problem, and it can't be solved by more technology and shouting "BLOCKCHAIN!"
If a largish group of users could create end-to-end encryption not with a single company but with "readily available materials", then stopping it could be harder.
So it's a combination of state dictate and the practical ability of users to defy that. This isn't saying I'm optimistic, I'm rather pessimistic on any ability of a wide home-grown encrypted-messaging milieu to appear - if few are aiming for this, those few can easily be picked-off. But I don't think we should just give up on any part of this.
Possession of encryption software could be treated the same as possession of drugs. On the next stop and search you would only had to handover your phone. If police password will not work it will be confiscated. If encryption software is found you go in the dock. It is the future. Society accepted ridiculous laws to jail people for having a plant, they'll accept jailing for programs. Only terrorists, thieves and adulterers encrypt their messages ;-)
The War on Drugs is considered a failure and in parts of the world like NSW, Australia made prostituion legal in 1979 in both cases because criminalising things most people use generally doesn't work and all you do is randomly jail people for doing the exact same thing as a large proportion of the population.
I fail to see the point, without encryption, there's no modern web, no e-commerce, no smartphones, absolutely everything relies on it like water. Unless you want to go back to pre-2000's technology of course.
Of course e-commerce will be fine, because browser vendors will obtain licenses to ship TLS modules and as a condition of such will include the .gov root cert.
It's trivial when you can pass arbitrary legislation.
Back in the 90s we had to deal with US gov restrictions on encryption export. Software companies and organisations fell into line. It was a big deal when 128-bit keyed Netscape became available globally in 1997, per State Dept approval, but even then the full-strength server-side SSL was still restricted to 'approved' entities.
And even 56-bit server SSL was only exportable with us.gov key escrow.
I used to use Apache with the 40-bit SSL option. Pathetic strength but no-one was going to risk jail-time by breaking laws.
The difference being that there's way too much necessary legitimate use of cryptography to stop now, and as the traffic is encrypted, you can't tell what traffic isn't legitimate. Plus steganography and plenty of places accessible on the net that aren't the United States.
This isn't meatspace, the dynamics are quite different.
There is nothing you cannot legislate for. For example use of encryption could be licensed, just as drugs are. If you don't have prescription, you go down.
Possession of encryption software could be treated the same as possession of drugs.
Well, then clearly it would quickly become ubiquitous. I mean, if a war on encryption that was just like the war on drugs were to be launched, why my local stream bed might "place burned passwords here" on the tin-can that currently reads "used needles here." (put there by the other homeless people).
There's a difference between running a Tor exit node and encrypting a personal conversation.
At least in the US, if a US citizen is part of a potentially incriminating conversation, the government's going to have a hard time forcing a court to force the citizen to decrypt the conversation.
Lawyers, correct me if I'm wrong, but it seems like a conversation wouldn't be subject to the vagaries of "combination to a safe"-production loopholes.
Its not laws since the US government and probably others have already shown with the NSA and the like that they have no respect whatsoever for the existing laws and nobody actually seemed to care one bit about that.
The issue is the government wanting to strip the encryption going forward. In other words, even the most decentralized & encrypted app can still have NSA_RemoteConn.Log(dat) written into it's source code
Stripping encryption is one thing, sure. But for the backdoor, you'd have to have the clients phone nsaserv.spy/writeremoteconnlog then or sure, write some record on the client's device. You can't "tap" encrypted communications unless you can figure out how to factor integers then you'd get a Field's medal.
Or, ofc, get people to adopt insecure protocols. That we know (or have good suspicion) they've tried.
This actually feels more like what I would expect police work to be like given the situation.
They most certainly do not have cause to demand access to swaths of comms no matter whose comms they're after and most assuredly when that access actually entails enabling access to all of the comms.
I posit there is no authority that should be able to demand this as a matter of the right to human existence. Law, order, society and government should not have ultimate authority on private communications no matter what the tech is capable of. We, as humans in a modern world, can speak and if desired do so in private. This is our right as individuals and if encryption helps us accomplish and enforce that right then so be it.
If they have probable cause then they need to beat feet or beat heads but either way they need to get to work. And by work I do not mean trying to impose a different reality than the one that we currently have - where math is fact, compute is cheap and source is open.
What's it going to be? 100 go free or six lines from everyone?
set up the device to wipe itself after $x number of incorrect attempts. keep giving the wrong password after every whack from the wrench. then you have plausible deniability. "how can i possibly think straight when you keep hitting me with that wrench?" just need to make $x a value small enough that you can survive the wrench.
No good, it is already standard for forensic teams to clone and checksum a hardrive before attempting to look through files. The clone is sent to evidence and any password attempts will be made on a copy. The "original" copy will be kept safe and any number of passwords can be used against nth iteration of copying the clone.
Isn't this the purpose of the secure enclave on iPhones? Taking the drive away from the secure enclave makes the drive useless and the enclave only allows a few password attempts.
This is exactly this. It also allows a weak password (4 digits PIN) to de ok. The enclave which holds the actual encryption keyd will refuse to hand them over if the right trigger is hit (too many attempts, too high a rate,...)
I can appreciate hn is mostly humor intolerant but these are all basically right on point. The web experience is now akin to walking the mall; loud, expensive, garbage.
-- sorry, sorry, impetuous. I'm simply tired of the bandwidth apologists. Data caps are 100% theft of service.