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 os.path import basename, isdir, splitext, dirname | |
from os import listdir, rename, urandom | |
import json | |
filename = {} | |
def traverse(path, depth=0): | |
print depth* '| ' + '|_', basename(path) | |
if(isdir(path)): | |
for item in listdir(path): |
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
# -*- coding: utf-8 -*- | |
# ! /usr/bin/env python | |
''' 查找局域网可用Ip的程序 | |
by Gongchengdong | |
安装依赖: | |
sudo dnf install nmap | |
sudo pip install python-nmap | |
!!注意!!务必使用root权限运行。如: |
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 | |
#-*-coding:utf-8 -*- | |
#author:shiying;tongning;hxg | |
##通过自定义密码表自动登录系统,并传输 rsa 公钥和执行命令 | |
import paramiko | |
import threading | |
import time | |
import pdb | |
iplist = [] | |
passwd=[自定义的密码列表……] |
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 python3 | |
# Author: Ali Assaf <ali.assaf.mail@gmail.com> | |
# Copyright: (C) 2010 Ali Assaf | |
# License: GNU General Public License <http://www.gnu.org/licenses/> | |
from itertools import product | |
def solve_sudoku(size, grid): | |
""" An efficient Sudoku solver using Algorithm X. |
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 | |
# -*- coding: utf-8 -*- | |
'''将搜狗拼音导出的文本词库转换成ibus-libpinyin的用户词典 | |
by Conanca | |
''' | |
content = open("搜狗词库导出_2014_1_6.txt").read().decode('utf16').encode('utf8') | |
lines = content.split('\n') | |
f=open('ibus.txt','w') |
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 | |
# -*- coding: utf-8 -*- | |
'''抓取国家统计局网站上最新的县及县以上行政区划代码,并保存成 json 格式的js文件(供前端用)和SQL语句(供后端用) | |
by Conanca | |
''' | |
import urllib2,json | |
url_prefix = 'http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/' |
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 os.path import basename, isdir | |
from os import listdir | |
def traverse(path, depth=0): | |
print depth* '| ' + '|_', basename(path) | |
if(isdir(path)): | |
for item in listdir(path): | |
traverse(path+'/'+item, depth+1) | |
if __name__ == '__main__': |
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
package main | |
import ( | |
"fmt" | |
"github.com/PuerkitoBio/goquery" | |
"io" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"regexp" |
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 java.lang.reflect.Field; | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.neo4j.graphdb.Direction; | |
import org.neo4j.graphdb.GraphDatabaseService; | |
import org.neo4j.graphdb.Node; | |
import org.neo4j.graphdb.Path; | |
import org.neo4j.graphdb.PropertyContainer; |
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 | |
if [ $(id -u) != "0" ]; then | |
printf "Error: You must be root to run this tool!\n" | |
exit 1 | |
fi | |
clear | |
printf " | |
#################################################### | |
# # |