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
Solutions for Udacity Course CS348 - Functional Hardware Verification |
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 urllib2 | |
import os | |
import zipfile | |
def downloadimage(img): | |
r = urllib2.urlopen("http://www.limbero.org/jl8/comics/"+img) | |
f= open(path+'\\'+img,'wb') | |
f.write(r.read()) | |
f.close() | |
print img + ' has been downloaded and saved ! \n' |
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
#!/bin/bash | |
sudo tightvncserver | |
sudo vncserver :1 -geometry 1366x768 -depth 24 |
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 crypt | |
def testPass(cryptPass): | |
salt = cryptPass[0:2] | |
dictFile = open('dict.txt','r') | |
for word in dictFile.readlines(): | |
word = word.strip('\n') | |
cryptWord = crypt.crypt(word,salt) | |
if(cryptWord == cryptPass): | |
print "[+] Found Password: "+ word+"\n" |
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 zipfile | |
import optparse | |
from threading import Thread | |
def extractFile(zFile, password): | |
try: | |
zFile.extractall(pwd = password) | |
print '[+] Found password ' + password + '\n' | |
except: | |
pass |
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 nmap | |
import optparse | |
def nmapScan(tgtHost, tgtPort): | |
nmScan = nmap.PortScanner() | |
nmScan.scan(tgtHost, tgtPort) | |
state = nmScan[tgtHost]['tcp'][int(tgtPort)]['state'] | |
print " [*] " + tgtHost + " tcp/" + tgtPort + " " + state | |
def main(): |
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 pxssh | |
def send_command(s, cmd): | |
s.sendline(cmd) | |
s.prompt() | |
print s.before | |
def connect(user, host, password): | |
try: | |
s = pxssh.pxssh() |
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 GF2 import one | |
def GF2_addLists(L1,L2): return [vx+ux for (vx,ux) in zip(L1,L2)] | |
def solve(u): | |
#data | |
data = { | |
'a':[one,one,one,0,0,0,0] | |
, 'b':[0,one,one,one,0,0,0] |
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
var express = require('express') | |
, app = express() | |
, server = require('http').createServer(app) | |
, path = require('path') | |
, io = require('socket.io').listen(server) | |
, spawn = require('child_process').spawn | |
// all environments |
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 socket | |
import struct | |
def wake_on_lan(macaddress): | |
""" Switches on remote computers using WOL. """ | |
# Check macaddress format and try to compensate. | |
if len(macaddress) == 12: | |
pass |
OlderNewer