+-------------+
| |
| DHCP server |
| |
+-------------+
| 192.168.1.34
|
|
VLAN 1 | 192.168.1.12
+------[1]----+
<?php | |
include_once 'db.php'; | |
global $con; | |
define('ERROR','404');//Define Your Error message HERE | |
define('REQADDR', '127.0.0.1');//Define your REQUESTIN SERVER ADDR | |
if($_SERVER['REMOTE_ADDR']=='127.0.0.1'){ | |
//process it | |
if(isset($_GET['q'])){ | |
$q=mysql_real_escape_string($_GET['q']);//TO get rid of SQL Enjection |
+-------------+
| |
| DHCP server |
| |
+-------------+
| 192.168.1.34
|
|
VLAN 1 | 192.168.1.12
+------[1]----+
/* | |
* Extends ColorThief plugin to mark the most intense color in a palette. | |
* | |
* var colorThief = new ColorThief(); | |
* var palette = colorThief.getPalette(image, 5); | |
* var palette = colorThief.markBoomColors(palette); | |
* | |
* It ranks all colors in a palette according to the sum of saturation and color value (HSV) descending. | |
* The palette colors will be extended with boomRank and boomColor. | |
* boomColor is set to true if the color is the most intense color in the given palette. |
from app import db | |
from sqlalchemy import desc, event, func, orm | |
from sqlalchemy.ext.associationproxy import association_proxy | |
from sqlalchemy.ext.declarative import declared_attr | |
from sqlalchemy_utils import ArrowType, auto_delete_orphans | |
from slugify import slugify_unicode | |
tags = db.Table('tag_associations', | |
db.Column('tag_id', db.Integer, db.ForeignKey('tags.id')), | |
db.Column('article_id', db.Integer, db.ForeignKey('articles.id'))) |
import csv | |
import threading | |
from Queue import Queue | |
from getpass import getpass | |
from netmiko import ConnectHandler | |
from datetime import datetime | |
USER = 'pyclass' | |
PASSWORD = getpass() |
/* At first the image is grayscaled by the filter and then on hover the filter is set to 0% */ | |
img { | |
-moz-filter: grayscale(100%); | |
-o-filter: grayscale(100%); | |
-webkit-filter: grayscale(100%); | |
filter: grayscale(100%); | |
-moz-transition: .5s ease-in-out; | |
-o-transition: .5s ease-in-out; | |
-webkit-transition: .5s ease-in-out; |
from requests import Session | |
session = Session() | |
# HEAD requests ask for *just* the headers, which is all you need to grab the | |
# session cookie | |
session.head('http://sportsbeta.ladbrokes.com/football') | |
response = session.post( | |
url='http://sportsbeta.ladbrokes.com/view/EventDetailPageComponentController', |
__author__ = 'Tanner Ray Martin' | |
#this is for python 3, for python 2: change input to raw_input | |
import serial | |
#serial is the main module used and needs to be installed | |
import time | |
''' |
#!/usr/bin/python | |
# | |
# This script is performing DTP Trunk mode detection and VLAN Hopping | |
# attack automatically, running sniffer afterwards to collect any other | |
# VLAN available. To be launched only in Unix/Linux environment as the | |
# script utilizes following applications: | |
# - 8021q.ko | |
# - vconfig | |
# - ifconfig / ip / route |
This gist demonstrates the difference between threading and asyncio. To be clear, they're both limited by the Global Interpreter Lock and are both single process, multi-threaded. They are both forms of concurrency but not parallelism.
Threading (via Thread, concurrent.futures) employs time-slicing of CPU. All threads are given a slot of CPU time to do work. If the thread is blocking (sleeping or blocked on sockets), then off it goes to the next thread. With many threads that are blocked for long periods, this begins to degrade into polling (polling vs. interrupt)