In the USA, it is open season on feral swine all year around, no permit required, as they are a very noxious pest. In Texas, you can even go heli-hogging!
At the time, Ireland was indeed a wealthy country, having made its fortune selling leather to the Romans three centuries before, because the semi-nomadic Irish cultivated large herds of cattle roaming on unfenced plains, while the settled Britons kept sheep. This permitted the establishment of a culturally sophisticated Gaelic Order so stable that it was able to assimilate the invading Vikings and the first wave of Normans, who actually went native and began speaking the Irish language.
i once managed to create a directory named ~ using the mirror tool written in perl.
then i naively tried to remove it using "rm -r ~" and started wondering why removing an empty directory would take so long, until it dawned on me...
i learned a few new habits since then. i almost never use rm -r and i avoid "*" as a glob by itself. instead i always try to qualify "*" with a path, remove files first: "rm dir/*"; and then remove the empty directory. "rmdir dir/"
if i do want to use rm -r, it is with a long path. eg in order remove stuff in the current directory i may distinctly add a path: rm -r ../currentdir/*" instead of "rm -r *"
related, i also usually run "rm -i", but most importantly, i disable any alias that makes "rm -i" the default, because in order to override the -i you need to use -f, but "rm -i -f" i NOT the same thing as "rm". rm has three levels of safety: "rm -i; rm; rm -f". if "rm -i" is the default the "rm" level gets disabled, because "rm -i -f" is the same as "rm -f"
Change your do block to `printf %q\ rm -f "$i" ; echo` and it won't lie about spaces. In case HN has "trimmed" my post in some way, as it often does, that's: percent q backslash space space. Works in bash/zsh, but not dash, probably not whatever your sh is. Can make a function of it trivially, but you have to handle the $# -eq 0 case, return whatever printf returns, etc.
When deleting, if it is more than a few specifically named files I will use a "find ... -delete" invocation.
I like it for two reasons. Find feels like it has more solidly defined patterns and recursion than shell globing and by leaving off the "-delete" it give me a chance to inspect the results before committing to my actions.
Very cool of you to post this. Too many people won't post stories like this, but I've done very similar multiple times. I think it definitely helps reinforce proper habits, and is the best way to cut your teeth on technology. It's also great for anyone new to read something like this, and be able to avoid something so devastating, and maybe make lesser mistakes, but still learn from both!
when you get to be as old as i am, these are the war stories you share with your kids and grandkids around the campfire ;-)
like the one from my colleague who once fat fingered fsck into mkfs and i lost my personal homepage because of it. what makes me uncomfortable about that story is that it was not my fault. if it were it would have been easier to tell. but at the time i was quite frustrated and my colleague felt that despite me trying to not get angry at him. i still feel really bad about my reaction then, adding to his predicament, since he had to live with the guilt about losing our website and everyone's personal home directory. it's bad when a mistake causes you to loose something personal, but so much worse when you loose someone elses stuff.
talking about mistakes is how we learn from them. the important part is not to get embarrassed about them. however that requires an environment where we are not blaming each other when something goes wrong.
i could have made that mistake myself. and i applied this lesson to my own learning as if i had.
blessed be the pessimist, for he hath made backups...
Absolutely, the worst mistakes are the biggest opportunities for learning. Destroying your own files is painful. Destroying EVERYONE'S files is a lesson that is more painful and something you will be more careful not to repeat.
I try to tell as many of these stories in person as possible, to let everyone know that unless you have dealt with this kind of accident, you're either in the 1% or due for your turn. I'd like to think that sharing these stories might at least give someone some pause before they go ahead and throw caution to the wind.
> if "rm -i" is the default the "rm" level gets disabled, because "rm -i -f" is the same as "rm -f"
You can use "\rm" to invoke the non-aliased version of the command. I made "rm -i" the default using an alias and occasionally use "\rm" to get the decreased safety level you described. I think it is more convenient that way.
I love zsh auto completion for this stuff. It automatically escapes really messed up paths like paths with new lines or emojis and crazy characters like that. Its really rare but I still intentionally practiced removing these things just so I can do it safely if it ever happens.
I've long fantasized about a tool I call "expect" that safeguards against crazy stuff like that.
It has a syntax of your expectations, functionally existing as a set of boundaries, and you can hook it to always run as a wrapper for some set of commands. It essentially stages the wrapped command and if none of the boundaries are violated it goes through. Otherwise it yells at you and you need to manually override it.
For instance, pretend I'm ok with mv being able to clobber except in some special directory, let's call it .bitcoin or whatever. (chattr can also solve this, it's just an example). The tool can be implemented relying on things like bpf or preload
Originally I wanted it as a SQL directive ... a way to safeguard a query against doing like `update table set field=value expect rows=1` where you meant to put in the where clause but instead blew away an entire column. I think this would be especially useful surfacing it in frameworks and ORMs some of which make these accidents a bit too easy.
When it comes to SQL, I will often write a SELECT with very explicit search (WHERE) criteria for this very reason. Then copying that statement, commenting the original, and pasting to change into an UPDATE or DELETE statement seems to be a technique that works well for me. The SELECT tells me exactly what I'm going to UPDATE or DELETE, and once I have that, changing the syntax is very minimal. In the case of an ORM, you might have to write a tool that only listens on LOCALHOST to run these statements first.
I always write the where first. It's kinda like thinking in RPN or postfix. I put the parts in out of order in a way that prioritizes the minimization of error.
But this is stupid. These are computers, we can make whatever we want. Executing a delete or update should, if one desires, not have to be database knifeplay.
I know what you mean, I do the same. I agree, but at the same time, it's difficult to start building in protections for the user. Where do you start and where do you stop? I have been forced to do the extreme to protect the user, and then you are asked why things are so difficult to use. I think to make something for someone that concentrates in the technology, as well as a beginner, means you've got to give up so much power (or create a secondary syntax/interface for both audiences). It would be nice to be able to set modes, but then it's going to be database specific unless it has proven itself to be useful across engines. Like most standardization, then you play syntax games between vendors. It would be nice to at least be able to write an UPDATE or DELETE statement with a leading character or keyword to display affected rows.
I understand, but with how much of a change to the language? Such a change would take an enormous amount of time to make it into the ANSI/ISO SQL standard, and what database would start to implement it first, and which would hold out as long as possible?
I don't disagree that it's impossible, but how do you get the syntax standardized at this point? Do you get various dialects, or an agreement between vendors? Look how slowly the standard moves, when do we get this where it's usable in most popular RDBMS?
I have upvoted you for each comment you've made, but I feel like it's not that simple. Even just getting a single vendor to implement it is a huge undertaking. I know that you and I see the value in it, but I don't feel like we're the first to see that. There's a reason behind not implementing this feature, and it's the complexity that lies behind such a feature, like most things. This seems like one of those recursive and interactive features that don't fit into SQL. Does it present the rows that will be updated or deleted, and then ask if you wish to perform the operation? That doesn't work like anything SQL based, and I feel that's why we don't have it. I appreciate the back and forth on this, and am curious as to how you think it should be handled, if there's a way to fit in the way SQL works.
If the expectation is not met then it rolls back and fails. I implemented a slipshod version of it years ago for a previous employer (it got the job done with a lousier syntax)
Sounds like a solid idea, but I feel like just replacing your UPDATE with a SELECT COUNT(whatever_column_is_indexed_from_your_where) would be a good practice. If your DBMS supports an external language, that might be the best idea, so you can write your own logic, while keeping mostly everything in the database itself.
I only mean this from a more ANSI SQL side of things, where you might want to build your skills up to use as much of the standard as possible, until it's no longer possible and make sense to dip into platform specifics. I used to build code around being cross-platform, but at the same time realized that it's more useful to learn the ANSI standard, and then break free with LOTS of useful comments where it makes sense to do things more efficiently and with safety that you don't get normally.
For sql specifically, “limit 2” is my default way to write “expect 1”; if it affects two rows, I know that I have screwed up, whereas “limit 1” can be wrong without my noticing.
because then i become to rely on stuff being in the trash and i'd be less careful when deleting, which means i have to double check when i clean the trash. that's extra work.
. and since the trash is one single folder for the whole desktop, that means the trash is full of stuff from all over the place, making a review extra hard.
in most cases i know something needs to be gone, so i'd rather delete it on the spot.
besides that, the primary reason for deleting stuff is to gain space. moving things to trash doesn't help with that.
what i sometimes do though, when mass deleting, is to move stuff to be deleted into a new folder (usually called "del" or "delete"). then verify the contents of the folder before removing it.
what would be more useful is a kind of trash implementation that does not take space, in that it keeps files around but reports them as unused space that can be overwritten when space is needed. kind of like undelete is possible on some filesystems. so that gone is gone because i can't control when deleted space gets used up, but in a panic situation i can revert the most recent deletes.
I've heard that one of the Unix founding fathers had a directory with 125 files that all had single-byte names: one for each ASCII symbol except slash, dot and null. He would then test any new utility against this directory and chew the careless programmer out if it couldn't correctly handle every one of these names.
In the long run, special cases like that often turn out to be more trouble than they are worth. If an ordinary file happened to start with '~' it would not be handled correctly. So you either accept or ignore that potential problem, or you have to write extra code to work around it. It's safer to not have such special cases at all.
The original design decision was to behave like a shell, where ~ means your own home dir and ~fred means fred's home dir. With the benefit of experience, this is now seen to be unwise and a different decision has been made.
Just recently I used '~' in the remote target path in the scp command, and, somewhat unexpectedly, it created the directory with that name and put the files there.
In 99% of cases, yes - this is a pain in the backside. Long ago I adopted something from the plan9 way of doing things (when I was heavily using acme).
Just symlink /h to /home. So ~user becomes /h/user, in places where ~ is not expanded for you.
There are claims that Signal has already been compromised by the Five Eyes Intel Agencies, albeit through bribery rather than the overt coercion we see here. The key change is that Signal can no longer guarantee end-to-end encryption based on a passphrase tied to the app itself, and known only to the user.
From experience, I would agree that the first thing activists who wish to take over a group will do is to behave badly, and then use this as the pretext to demand a Code of Conduct.
They will then subvert the spirit of the CoC, while adhering legalistically to the letter, in order to control others. They allows them divert a topic into pointless discussion of the rules, or to needle someone persistently, while remaining within the rules, until that person reacts, at which point they will insist that he has violated the CoC.
The minimum standard of good behavior need not be explicitly stated, and violations can be dealt with as they arise. The problem with written sets of rules is that they can be subverted and misused.
> The problem with written sets of rules is that they can be subverted and misused.
That's also a problem with unwritten sets of rules that are based on vibes. If the baseline expectations are written down, at least people can notice if the rules aren't being followed.
It should be stated. Not everyone shares in the same values as everyone else. There are also those who are unable to understand the social norms of others.
Plus unwritten rules can be subverted and misused at least as much as written ones.
Aristotle's actual writings are lost. The books attributed to Aristotle are comprised of lecture notes collected by his students, later compiled according to topic, so you get the Ethics, the Politics, the Physics and Metaphysics.
They didn't quite know how to name the last book since its contents were so abstract and unrelated to the everyday world, so they simply called it "the book that comes after the Physics," which eventually became known as the Metaphysics. It is worth noting that the title is a specific reference to the book, not to any notion of the subject matter somehow transcending physics. After all, why physics, in particular?
In the light of that, it is even more jarring to see the term 'metaphysics' being used to describe spiritualism and new age mysticism.
Thierry Breton, the author of the letter, appears to have a personal grudge against Elon Musk, and has directed several aggressive ultimatums towards him such as, "In Europe, the bird will fly by our rules," "You can run but you can't hide" and "Our teams will be ready for enforcement."
Breton is set to be the next EU Commissioner, succeeding Ursula Van Der Leyden.
I can get the frustration when someone whose job it is to enforce the law repeatedly comes up against someone in the public eye who openly flaunts their violation of the law wearing a shirt that says "make me" where other companies that have sane compliance departments just follow the law and course-correct when it's pointed out without the need for a big lawsuit.
Big, "I shouldn't have to keep wasting my time on this" energy.
That is one plausible scenario, but another is that Breton, by all accounts, an arrogant, petty autocrat, is simply attempting to impose his will, not just on Musk, but everyone else. The words he has chosen to use suggests the latter may be closer to the truth.
If such a person is "frustrated" then it sounds like they don't actually have the power they claim to have, or, they would just file that "big lawsuit". And, if this is really his job, and he has the power to litigate this, then certainly this is what he should be "wasting" his time on, should it not?
The wheels of EU enforcement grind slow, but exceeding fine (eg the recent 1.2bn eur fine for Facebook was as a result of behaviour from 2020 onwards), so there's something to be said for warning someone off bad behaviour rather than just launching an enforcement action, because the enforcement action will probably take _years_.
EU fines have to be paid immediately and are transferred directly to the Commission's budget (making them a huge conflict of interest). Then, if you want, you can try to appeal and get your money back. That's the part that takes years.
This is the other way around to how law works in real democracies, where the government must actually win a case first before being able to levy punishment. But it's normal to be confused. The EU constitution dresses itself in the language and idioms of democracy without actually having the core spirit of it.
You have an oddly efficient view of "government agency sues $company for doing obviously horrible thing." These lawsuits drag on for ages, become huge political battles, and are a just a huge expenditure of resources for everyone involved that it's saved as a last resort.
I don't think you would like living in a world where things like this could be settled swiftly and decisively. Having a government where voluntary compliance is the expected norm and applying real force takes time and resources is a feature not a bug.
Why should people and corporations voluntarily comply with stupid laws which limit freedom of expression? It would be better if everyone drags things out to the extent that those laws become unenforceable. In general, given that the EU itself is so fundamentally flawed, anything that undermines the power of EU bureaucrats and wastes their time is probably a net positive.
You just need to look at Twitter's downward slope towards the misinformation abyss to recognize the expected results of unmoderated expression. Bad actors take advantage of this freedom to drive up clicks with little regard for accuracy or nefarious side effects. If that only affects the platform, it requires no action from government: let Twitter circle the drain onto oblivion. If negative externalities affect society as a whole, intervention is required.
In short: freedom of expression isn't an absolute right. The EU is correct, blatantly false posts should be suppressed. Twitter should have a moderation team, twitter MUST have someone answer take-down requests.
Nah, I don't need to look at anything. I see little or no misinformation in my feed. If you see a lot then you're probably using it wrong.
Freedom of expression isn't absolute, but should be close to it. The EU (or constituent national governments) should adopt the US Constitution's Bill of Rights. We have an existence proof that it works better than whatever unprincipled, haphazard policies they happen to pursue.
Neither is the naked assertion "We have an existence proof." Especially in the context of a 250-year-old country stacked up against thousands-of-years-old countries.
England has a monarchy going back thousands of years. Meanwhile, I think it remains to be seen if the younger governments failed to learn the right lessons from the US or have learned from the US's mistakes.
We shall see. Probably on the next quarter century, given how precarious the political situation is in the US right now.
I don't need to look at anything because I already see my feed every day. There's no confirmation bias involved.
The correct way to use X is to follow high-quality accounts and like their posts. Mute or block low-quality accounts (including those reposted by accounts you do follow). Never read the replies as they are almost entirely junk.