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
#include <db.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#define PATH_SEPARATOR "/" | |
char * __db_rpath(const char *path) | |
{ |
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
''' | |
异或指定路径下文件的头部1M字节的内容 | |
''' | |
import os | |
import sys | |
def do_xor(f): | |
with open(f,'r+b') as fp: |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
import os | |
import subprocess | |
def do_rename(dir_name, f): | |
new_name = f | |
p = os.path.splitext(f.replace('-', '')) | |
if p[1] is not None: | |
new_name = 'R{0}{1}{2}.TPP.ttd'.format( | |
p[1][1].upper(), p[1][-1].upper(), p[0]) |
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
#define _WIN32_WINNT 0x0400 | |
#include <windows.h> | |
#include <winioctl.h> | |
ULONGLONG *GetFileClusters( | |
PCHAR lpFileName, | |
ULONG ClusterSize, | |
ULONG *ClCount, | |
ULONG *FileSize |
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
import os | |
# import platform | |
import win32file | |
import win32con | |
def undo_hiden_file(file_path): | |
# if 'Windows' in platform.system(): | |
file_attr = win32file.GetFileAttributes(file_path) | |
if file_attr & win32con.FILE_ATTRIBUTE_HIDDEN: |
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
import os | |
import time | |
def main(): | |
DEST_PATH='Z:\Downloads' | |
RET_PATH='D:\Downloads' | |
vedio_files=[] | |
for parent,dirnames,filenames in os.walk(DEST_PATH): | |
for f in filenames: | |
if '.' in f and f.rsplit('.',1)[1] in ['avi','mkv','mp4','rmvb','asf','wmv']: |