This file contains hidden or 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
| /* | |
| * linux 2.6.37-3.x.x x86_64, ~100 LOC | |
| * gcc-4.6 -O2 semtex.c && ./a.out | |
| * 2010 sd@fucksheep.org, salut! | |
| * | |
| * update may 2013: | |
| * seems like centos 2.6.32 backported the perf bug, lol. | |
| * jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist. | |
| */ |
This file contains hidden or 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 | |
| # Use shell calculate the date interval before today | |
| SECOND_TODAY=`date +%s` | |
| SECOND_PER_DAY=86400 | |
| INTERVAL=7 | |
| SEQ=`seq $INTERVAL` |
This file contains hidden or 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/env python | |
| import datetime | |
| import time | |
| import sys | |
| import urllib | |
| import smtplib | |
| from email.mime.text import MIMEText | |
| mail_to_list=["YourEmailRecieveMessage"] |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| from xml.etree import ElementTree as ET | |
| from xml.dom import minidom as dom | |
| import sys | |
| import os | |
| import time | |
| def parse(filename): | |
| """ |
This file contains hidden or 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/env python | |
| import re | |
| import sys | |
| from collections import OrderedDict | |
| Enum_Value_Dict = {} | |
| class Parse: | |
| """ |
This file contains hidden or 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 | |
| # Based on getifaddrs.py from pydlnadms [http://code.google.com/p/pydlnadms/]. | |
| # Only tested on Linux! | |
| from socket import AF_INET, AF_INET6, inet_ntop | |
| from ctypes import ( | |
| Structure, Union, POINTER, | |
| pointer, get_errno, cast, | |
| c_ushort, c_byte, c_void_p, c_char_p, c_uint, c_int, c_uint16, c_uint32 |
This file contains hidden or 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
| /* showif.c : PUBLIC DOMAIN - Jon Mayo - August 22, 2006 | |
| * - You may remove any comments you wish, modify this code any way you wish, | |
| * and distribute any way you wish.*/ | |
| /* finds all network interfaces and shows a little information about them. | |
| * some operating systems list interfaces multiple times because of different | |
| * flags, modes, etc. if you want to use this code you should be aware that | |
| * duplicate interfaces is a possibility */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> |
This file contains hidden or 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
| /* | |
| * Demonstrates retrieving hardware address of adapter using ioctl() | |
| * | |
| * Author: Ben Menking <bmenking@highstream.net> | |
| * | |
| * 此代码源自: | |
| * http://stackoverflow.com/questions/1519585/how-to-get-mac-address-for-an-interface-in-linux-using-a-c-program | |
| * | |
| * | |
| * 编译时会提示struct ifreq的大小不知道(当前已解决)。下面有相应的讨论 |
This file contains hidden or 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 | |
| # -*- coding: utf-8 -*- | |
| from flask import Flask, stream_with_context, request, Response, flash | |
| from time import sleep | |
| app = Flask(__name__) | |
| def stream_template(template_name, **context): |
This file contains hidden or 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 | |
| # -*- coding: utf-8 -*- | |
| from xml.etree import ElementTree as ET | |
| xml_file = 'ping.xml' | |
| def main(): | |
| host_info = list() | |
| doc = ET.parse(xml_file) |
OlderNewer