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
wifi.setmode(wifi.STATION) | |
wifi.sta.config("network","password") -- Replace these two args with your own network | |
ip, nm, gw=wifi.sta.getip() | |
print("\nIP Info:\nIP Address: "..ip.." \nNetmask: "..nm.." \n") | |
led1 = 3 | |
led2 = 4 | |
gpio.mode(led1, gpio.OUTPUT) | |
gpio.mode(led2, gpio.OUTPUT) | |
srv=net.createServer(net.TCP) |
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 __future__ import print_function | |
import os, sys, msvcrt, webbrowser | |
# first arg = location, i.e. c:\myfiles | |
# second arg = file mask, i.e. *.py | |
# third arg and so on = strings to find | |
args = sys.argv | |
if len(args) < 4: | |
print("Usage:") |
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 sys | |
import ctypes | |
import ctypes.wintypes | |
##################################################### | |
#script to query windows 8.x OEM key from PC firmware | |
#ACPI -> table MSDM -> raw content -> byte offset 56 to end | |
#ck, 03-Jan-2014 (christian@korneck.de) | |
##################################################### |
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
' VBS Script to get the Windows(R) 7 Product Key from a PC's registry. | |
' | |
' Save the VBScript as "getWin7Key.vbs" somewhere on your Windows7 PC. | |
' Now, when you double-click the local script file an alertbox pops up | |
' displaying the product key stored in the machine's Windows registry. | |
Set WshShell = WScript.CreateObject("WScript.Shell") | |
KeyPath = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId" | |
MsgBox ExtractKey(WshShell.RegRead(KeyPath)) |
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
print ("List of PCI devices found in the system:") | |
print ("\nBUS DEV FUN VENID DEVID SDEVID SVENID Desc") | |
from os import path, access, R_OK # W_OK for write permission. | |
path_to_reg_exe_X = os.path.join('x:', os.sep, 'Windows', 'System32', 'reg.exe') | |
path_to_reg_exe_C = os.path.join('c:', os.sep, 'Windows', 'System32', 'reg.exe') | |
path_to_reg_exe_D = os.path.join('d:', os.sep, 'Windows', 'System32', 'reg.exe') | |
if path.exists(path_to_reg_exe_X) and path.isfile(path_to_reg_exe_X) and access(path_to_reg_exe_X, R_OK): |
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 | |
class DB{ | |
//variable to hold connection object. | |
protected static $db; | |
//private construct - class cannot be instatiated externally. | |
private function __construct() { | |
try { | |
// assign PDO object to db variable | |
self::$db = new PDO( 'mysql:host='.DB_HOST.';dbname='.DB_NAME, DB_USER, DB_PASS ); | |
self::$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); |