Skip to content

Instantly share code, notes, and snippets.

@findix
findix / xshell2mobaxterm.py
Created April 6, 2023 06:42
Convert xshell session to mobaxterm session file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# xshell session to mobaxterm session file
# Support: TELNET, serial, SSH
# Usage: xshell2mobaxterm.py Xshell_Session_Direcotry
# Example: python3 xshell2mobaxterm.py C:\Users\USERNAME\Documents\NetSarang Computer\7\Xshell\Sessions > mobaxterm.mxtsessions
# Linux platform enviroment: LANG=zh_CN.utf8/en_US.utf8
# Windows: python3.6 cmd run it.
import os, sys
@findix
findix / calibre.bat
Last active May 25, 2022 22:15
Open calibre on the NAS
@echo off
set CALIBRE_LIBRARY_DIRECTORY=\\NAS\book\talebook\books\library
set CALIBRE_EXE=C:\"Program Files"\Calibre2\calibre.exe
IF EXIST %CALIBRE_LIBRARY_DIRECTORY% (
SETX>nul CALIBRE_LIBRARY_DIRECTORY %CALIBRE_LIBRARY_DIRECTORY%
ECHO LIBRARY FILES: %CALIBRE_LIBRARY_DIRECTORY%
)
@findix
findix / restore_samba_backup_sensor.yaml
Last active April 2, 2022 14:33
restore_samba_backup_sensor.yaml
blueprint:
name: Restore Samba Backup sensor on startup
description: Restore Samba Backup sensor on startup
domain: automation
input:
addon:
name: Samba Backup Addon
description: Select samba backup addon.
selector:
addon:
@findix
findix / audio_concat.py
Created March 26, 2018 04:03
使用ffmpeg批量拼接音频
import os
import subprocess
def main():
for root, dirs, files in os.walk("mp3", topdown=False):
for name in files:
print(name)
try:
out_bytes = subprocess.check_output(
@findix
findix / LengthOfMP3.py
Created March 22, 2018 10:13
批量解析MP3文件时长
#!/bin/python
import os
from os.path import join
from mutagen.mp3 import MP3
def main():
root = r'/path/to/mp3_files'
csv = open("result.csv", 'w')
@findix
findix / EvilTransform
Created June 7, 2016 09:48
地球坐标系 -> 火星坐标系
//
// Copyright (C) 1000 - 9999 Somebody Anonymous
// NO WARRANTY OR GUARANTEE
//
using System;
namespace Navi
{
class EvilTransform
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// A base class for creating editors that decorate Unity's built-in editor types.
/// </summary>
public abstract class DecoratorEditor : Editor
# -*- coding: utf-8 -*-
import os
def main():
for root, dirs, files in os.walk("."):
for f in files:
if ".meta" not in f:
print root.replace(".\\",""),f.split('.')[0]
if __name__ == '__main__':
@findix
findix / getAllFileFromDir.py
Last active August 29, 2015 14:01
遍历目录获取所有文件
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path
import shutil
#需要遍历的目录
fromDir='.\\'
#文件汇总到的目录
@findix
findix / Xls2txt.py
Created May 13, 2014 11:28
批量下载全校学生照片并按性别分类的不道德行为
# -*- coding: utf-8 -*-
import xlrd
resultFile = open("./info.txt", "w")
fname = "./info.save.xls"
data = xlrd.open_workbook(fname)
table = data.sheets()[0]
nrows = table.nrows
ncols = table.ncols
for i in range(nrows):