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 | |
ip_prefix=192.168.1 | |
for((i = 1; i < 255; i++)) | |
do | |
ip=${ip_prefix}.${i} | |
ping $ip -c 2 | |
arp -a | grep "(${ip})" | grep -E [0-9a-f]{2}:[0-9a-f]{2} >> ~/ip-mac-pairs.txt | |
done |
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 os | |
from fcntl import ioctl | |
import struct | |
import time | |
import random | |
from threading import Thread | |
from pyroute2 import IPRoute | |
from pypacker.layer3.ip import IP | |
from pypacker.layer3.ip6 import IP6 |
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 | |
// Eorder.php | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @Entity @Table(name="e_orders", options={"collate"="utf8_general_ci"}) | |
*/ | |
class Eorder | |
{ | |
/** | |
* @var integer |
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 | |
// Epost.php | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @Entity @Table(name="e_post", options={"collate"="utf8_general_ci"}) | |
*/ | |
class Epost | |
{ | |
/** | |
* @Id @GeneratedValue @Column(type="integer") |
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 | |
// Epost.php | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @Entity @Table(name="e_post", options={"collate"="utf8_general_ci"}) | |
*/ | |
class Epost | |
{ | |
/** | |
* @Id @GeneratedValue @Column(type="integer") |
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 | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity() | |
* @ORM\Table(name="user") | |
*/ | |
class User |
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/env python | |
import re | |
import tornado.ioloop | |
import tornado.web | |
from tornado import httpclient | |
class MainHandler(tornado.web.RequestHandler): | |
@tornado.web.asynchronous |
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 | |
/** | |
* function: 测试字符串编码(utf-8/gbk/ascii) | |
* author: 华仔 2010/12/27 | |
* params: | |
* @s:string 要测试的文本 | |
* @priencoding:string 当非acsii字节太少(少于3),且可能是两种编码时,优先使用的编码(一般是gbk) | |
* @reserveascii:boolean 如果为ascii,是否设置为优先编码 | |
* return:string 字符串编码(utf-8/gbk/ascii) | |
*/ |