Bad Snippets

in #coding7 years ago

another-fun-malware-stock-image.jpg

These might break things. Use at your own stupidity!



This is more of a placeholder for now. I'll be adding more when I can be bothered to hunt them out and sort them into some form of readable format. They're fun!

Fill the drive with gak - Python


from string import digits, ascii_uppercase
from random import choice

while 1:
    c += 1
    with open(str(c), 'w+') as f:
        f.write(''.join(choice(ascii_uppercase + digits) for x in range(999999)))


Remove all in current dir - Python


from shutil import rmtree

rmtree('.')


Windows update prank - Python


import webview

webview.create_window('', 'http://fakeupdate.net/win10/', fullscreen=True, confirm_quit=True)


Fibinacci - Python


def fibonacci():
    a, b = 0, 1
    while True:
        yield a
        a, b = b, a + b


for x in fibonacci():
    print(x)



Thanks for reading. x

Sort:  

Congratulations @impshum! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 10 comments. Your next target is to reach 50 comments.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.076
BTC 64288.81
ETH 1666.04
USDT 1.00
SBD 0.41