This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sun.awt.image.ImageWatched; | |
import java.util.Iterator; | |
import java.util.LinkedList; | |
public class NodeBasedTests { | |
public static void main(String[] args) { | |
PartA partA = new PartA(); | |
PartB partB = new PartB(); | |
PartC partC = new PartC(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this is unsafe way to get JSON from your MySQL... but it is fun... hahaha | |
$servername = "myhost"; | |
$username = "myusername"; | |
$password = "mypassword"; | |
$dbname = "mydb"; | |
$sql = $_GET['sql']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Create heterogeneous Hadoop cluster | |
Contains of 4 nodes in two different racks | |
""" | |
from mininet.net import Containernet | |
from mininet.node import Controller | |
from mininet.cli import CLI | |
from mininet.link import TCLink | |
from mininet.log import info, setLogLevel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class GetInfo { | |
public static void main(String[] args) { | |
Properties p = System.getProperties(); | |
// p.list(System.out); | |
System.out.println("Total CPU: " + Runtime.getRuntime().availableProcessors()); | |
System.out.println("Free memory: " + Runtime.getRuntime().freeMemory()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
This is a program to send emails to Scram email testing accounts | |
""" | |
import smtplib | |
from email.MIMEMultipart import MIMEMultipart | |
from email.MIMEText import MIMEText | |
from email.MIMEBase import MIMEBase | |
from email import encoders | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from loremipsum import get_sentences | |
import random | |
sentences_list = get_sentences(500) | |
flen = 5000000 | |
progress = -1 | |
with open('myfile.txt', 'w') as myfile: | |
for i in range(flen): | |
n = round(i/(flen/100)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
def getJSON(url): | |
r = requests.get(url) | |
return json.loads(r.text) | |
server = 'http://d1:19888' | |
url = server + '/ws/v1/history/mapreduce/jobs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script use InstagramAPI provided here: https://github.com/LevPasha/Instagram-API-python/tree/master/InstagramAPI | |
import sys | |
import os | |
sys.path.append(os.path.abspath("yourpath/Instagram-API-python/InstagramAPI")) | |
from InstagramAPI import InstagramAPI | |
import time | |
import random | |
user = 'yourname' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.StringTokenizer; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.Job; | |
import org.apache.hadoop.mapreduce.Mapper; | |
import org.apache.hadoop.mapreduce.Reducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
class MyClass | |
{ | |
public static void main (String[] args) throws java.lang.Exception | |
{ | |
int[] a = {1,2,3}; | |
int[] b = {1,3,5}; |