Skip to content

Instantly share code, notes, and snippets.

@xyuanmu
xyuanmu / step1.py
Last active November 27, 2018 15:58
使用python对ip地址排序所用代码:http://yuanmu.mzzhost.com/tutorials/python-ip-sort.html
iplist=['192.168.1.33','10.5.1.3','10.5.2.4','202.98.96.68','133.120.1.1','192.168.1.22']
import socket
print sorted(iplist, key=socket.inet_aton)
@xyuanmu
xyuanmu / NetEase_API.py
Last active August 24, 2017 03:15
关于网易云音乐的一些笔记,Python版本
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
网易云音乐 New Api
'''
import os
import json
import base64
import binascii
@xyuanmu
xyuanmu / Picasa3取消关联.bat
Created May 17, 2017 12:55
用于关联 Picasa3 的图片查看器 PicasaPhotoViewer,将此批处理放于 PicasaPhotoViewer.exe 所在目录双击即可。
@echo off
echo.
echo.本工具将自动卸载 PicasaPhotoViewer ...
reg delete "HKLM\SOFTWARE\Classes\PicasaPhotoViewer" /F >NUL 2>NUL
reg delete "HKLM\SOFTWARE\RegisteredApplications" /V "Picasa3" /F >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Picasa3" /F >NUL 2>NUL
echo.
echo.卸载完成, 3秒后自动退出...
choice /t 3 /d y /n >NUL
@echo off & cd /d %~dp0 & title 酷狗关联M4A格式
reg add "HKCR\kugou8.M4A" /d "M4A文件" /f >NUL 2>NUL
reg add "HKCR\kugou8.M4A\DefaultIcon" /d "%~dp0KuGou.exe,1" /f >NUL 2>NUL
reg add "HKCR\kugou8.M4A\Shell\Open" /d "使用 酷狗音乐播放器 播放(&O)" /f >NUL 2>NUL
reg add "HKCR\kugou8.M4A\Shell\Open\Command" /d "\"%~dp0KuGou.exe\" /Open \"%%1"\" /f >NUL 2>NUL
reg add "HKCR\kugou8.M4A\Shell\PlayList" /d "添加到“酷狗音乐”播放列表(&P)" /f >NUL 2>NUL
reg add "HKCR\kugou8.M4A\Shell\PlayList\Command" /d "\"%~dp0KuGou.exe\" /List \"%%1"\" /f >NUL 2>NUL
reg add "HKCR\.m4a" /d "kugou8.M4A" /f >NUL 2>NUL
reg add "HKCR\.m4a" /v "Content Type" /d "audio/m4a" /f >NUL 2>NUL
@xyuanmu
xyuanmu / js_netease_encid.html
Created September 10, 2017 01:28
JavaScript 版计算网易云音乐加密ID
<script>
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
@xyuanmu
xyuanmu / youku_kux2mp4.bat
Last active August 18, 2022 14:35
利用优酷自带的ffmpeg转码kux加密文件为mp4,将此批处理放入kux所在目录双击运行即可。
@echo off & title 批量转码优酷KUX为MP4 & cd /d %~dp0
setlocal enabledelayedexpansion
rem 优酷客户端 ffmpeg.exe 所在目录,若路径不对,请自行修改
set ffmpeg="C:\Program Files (x86)\YouKu\YoukuClient\nplayer\ffmpeg.exe"
if not exist %ffmpeg% (
echo.请修改优酷客户端 ffmpeg.exe 所在目录!
)
if exist *.kux (
@xyuanmu
xyuanmu / decompress_qq_pinyin_qpys.bat
Last active December 6, 2023 13:16
解压QQ输入法皮肤,网上获得的方法,皮肤命名为 qq.qpys 然后放入相同目录,运行后生成 zip 文件可用压缩软件打开
@echo off
:do
if exist "%~f1" (
"D:\Program Files\Python3\python.exe" "%~n0.py" "%~f1"
) else (
"D:\Program Files\Python3\python.exe" "%~n0.py"
pause
call :do
)
@xyuanmu
xyuanmu / copy.js
Last active December 6, 2020 08:07
Copy text to Clipboard
function copy(text){
const input = document.createElement('input');
input.setAttribute('readonly', 'readonly');
input.setAttribute('value', text);
input.style = "position:absolute;opacity:0";
document.body.appendChild(input);
input.select();
if (document.execCommand('copy')) {
console.log('复制成功');
}
@xyuanmu
xyuanmu / odd-even.bat
Last active March 31, 2021 07:35
批处理奇偶运行不同代码
@echo off
setlocal enabledelayedexpansion
set n=0
:run
set /a n+=1
set /a x=!n! %% 2
if "!x!"=="1" (
// ==UserScript==
// @name 百度网盘一键批量修改后缀-替换文件及文件夹名
// @namespace dupanBatchRename
// @version 0.1.4
// @description 感谢wealding,修改自【百度网盘一键批量修改后缀&批量替换文件名】;增加了批量修改文件夹名的功能;百度网盘一键批量修改后缀,默认修改为MP4;批量替换文件名【说明:批量改后缀强制改所有后缀,批量替换文件名可以替换一些垃圾版权信息】
// @author ding(AT)gong.si - Modified By Moka
// @match *://pan.baidu.com/disk/home*
// @match *://yun.baidu.com/disk/home*
// @icon https://pan.baidu.com/m-static/base/static/images/favicon.ico
// @run-at document-end