diff --git a/bat/convertMusic2Flac.bat b/bat/convertMusic2Flac.bat new file mode 100644 index 0000000..5975dc1 --- /dev/null +++ b/bat/convertMusic2Flac.bat @@ -0,0 +1,8 @@ +:: 使用ffmpeg将音乐文件转换为flac格式 +:: ^((.*)\\(.*)\.ape)$ +:: C:\Software\jellyfin_10.8.10\ffmpeg -i "$1" -c:a flac "$2\\$3.flac" +:: set file to ansi encoding + +C:\Software\jellyfin_10.8.10\ffmpeg -i "D:\Music\han\Beyond - 光辉岁月.ape" -c:a flac "D:\Music\han\Beyond - 光辉岁月.flac" +C:\Software\jellyfin_10.8.10\ffmpeg -i "D:\Music\Instrumental\Bandari - Childhoood Memory.ape" -c:a flac "D:\Music\Instrumental\Bandari - Childhoood Memory.flac" + diff --git a/bat/win10Hibernate.bat b/bat/win10Hibernate.bat new file mode 100644 index 0000000..b60df93 --- /dev/null +++ b/bat/win10Hibernate.bat @@ -0,0 +1,9 @@ +:: https://stackoverflow.com/questions/7977743/how-do-i-make-a-hibernation-batch-file +:: https://answers.microsoft.com/en-us/windows/forum/all/anyone-know-a-batchscriptprogramexe-that-can-put/741c42d6-41a4-47b2-9c64-fddbf1605637 +:: https://superuser.com/questions/42039/change-windows-sound-volume-via-the-command-line +C:\Software\nircmd-x64\nircmd.exe changesysvolume -50000 +C:\Software\nircmd-x64\nircmd.exe mutesysvolume 1 +C:\Software\nircmd-x64\nircmd.exe setbrightness 30 + +cd c:\ +shutdown /h \ No newline at end of file diff --git a/bat/win10offwork.bat b/bat/win10offwork.bat new file mode 100644 index 0000000..242b3cd --- /dev/null +++ b/bat/win10offwork.bat @@ -0,0 +1,3 @@ +C:\Software\nircmd-x64\nircmd.exe mutesysvolume 0 +C:\Software\nircmd-x64\nircmd.exe setsysvolume 15000 +C:\Software\nircmd-x64\nircmd.exe setbrightness 100 diff --git a/bat/win10sleep.bat b/bat/win10sleep.bat new file mode 100644 index 0000000..527ede1 --- /dev/null +++ b/bat/win10sleep.bat @@ -0,0 +1,9 @@ +:: https://www.addictivetips.com/windows-tips/schedule-sleep-on-windows-10/ +@echo off &mode 32,2 &color cf &title Power Sleep +set "s1=$m='[DllImport ("Powrprof.dll", SetLastError = true)]" +set "s2=static extern bool SetSuspendState(bool hibernate, bool forceCritical, bool disableWakeEvent);" +set "s3=public static void PowerSleep(){ SetSuspendState(false, false, false); }';" +set "s4=add-type -name Import -member $m -namespace Dll; [Dll.Import]::PowerSleep();" +set "ps_powersleep=%s1%%s2%%s3%%s4%" +call powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -Command "%ps_powersleep:"=\"%" +exit \ No newline at end of file diff --git a/bookmarklet/demo.js b/bookmarklet/demo.js new file mode 100644 index 0000000..9b7fbbb --- /dev/null +++ b/bookmarklet/demo.js @@ -0,0 +1,18 @@ +// http://www.ruanyifeng.com/blog/2011/06/a_guide_for_writing_bookmarklet.html +if (!window.jQuery) { + + script = document.createElement('script'); + + script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js'; + + script.onload = foo; + + document.body.appendChild(script); + +} else { + foo(); +} + +function foo() { + alert($('a')[0].innerHTML); +} \ No newline at end of file diff --git a/npp_macro/shortcuts.xml b/npp_macro/shortcuts.xml new file mode 100644 index 0000000..61d042e --- /dev/null +++ b/npp_macro/shortcuts.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + firefox "$(FULL_CURRENT_PATH)" + iexplore "$(FULL_CURRENT_PATH)" + chrome "$(FULL_CURRENT_PATH)" + safari "$(FULL_CURRENT_PATH)" + http://www.php.net/$(CURRENT_WORD) + https://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD) + $(NPP_FULL_FILE_PATH) $(CURRENT_WORD) -nosession -multiInst + outlook /a "$(FULL_CURRENT_PATH)" + + + + + + + diff --git a/pdf621/pdf-nup-merger.html b/pdf621/pdf-nup-merger.html new file mode 100644 index 0000000..c1fe202 --- /dev/null +++ b/pdf621/pdf-nup-merger.html @@ -0,0 +1,544 @@ + + + + + + PDF N-Up Merger + + + + +
+

PDF N-Up Merger

+

Merge PDF files with N-up tiling

+ +
+
馃搫
+
+ Click to upload or drag & drop PDF files +
+ +
+ +
+ +
+ + +
+ + + +
+
+
+ +
+ +
+ How it works: Upload multiple PDF files, specify how many pages (x) + should be combined onto a single sheet, and the app will create a merged PDF with N-up layout. + Default is 6 pages per sheet (2x3 grid). +
+
+ + + + diff --git a/sakura_editor_macro/escape_regex.mac b/sakura_editor_macro/escape_regex.mac new file mode 100644 index 0000000..b790ba1 --- /dev/null +++ b/sakura_editor_macro/escape_regex.mac @@ -0,0 +1,5 @@ +锘//銈兗銉溿兗銉夈優銈儹銇儠銈°偆銉 +S_ReplaceAll('([\\.\\^\\$\\*\\+\\?\\(\\)\\[\\{\\\\\\|])', '\\\\$1', 22); // 銇欍伖銇︾疆鎻 +S_ReDraw(0); // 鍐嶆弿鐢 +S_ReplaceAll('\\r\\n', '\\\\r\\\\n', 22); // 銇欍伖銇︾疆鎻 +S_ReDraw(0); // 鍐嶆弿鐢 diff --git a/sakura_editor_macro/grep_blog.mac b/sakura_editor_macro/grep_blog.mac new file mode 100644 index 0000000..6e9ea9f --- /dev/null +++ b/sakura_editor_macro/grep_blog.mac @@ -0,0 +1,2 @@ +锘//銈兗銉溿兗銉夈優銈儹銇儠銈°偆銉 +S_Grep('\\d+', '*', 'C:\\Users\\Shin.SHINJI-PC2\\Documents\\Code\\blog\\hugo-source\\content', 25393, 99); // Grep diff --git a/sakura_editor_macro/import_from_excel.mac b/sakura_editor_macro/import_from_excel.mac new file mode 100644 index 0000000..6798ce1 --- /dev/null +++ b/sakura_editor_macro/import_from_excel.mac @@ -0,0 +1,7 @@ +//Keyboard macro file +ReplaceAll('\\t', '\',\'', 6); // Replace All +ReDraw(0); // Redraw +ReplaceAll('^', 'insert into XXX_YYY select \'', 6); // Replace All +ReDraw(0); // Redraw +ReplaceAll('$', '\' from dual ;commit;', 6); // Replace All +ReDraw(0); // Redraw \ No newline at end of file diff --git a/shell/encoding.sh b/shell/encoding.sh new file mode 100644 index 0000000..b5a79ae --- /dev/null +++ b/shell/encoding.sh @@ -0,0 +1,12 @@ +#!/bin/bash +#enter input encoding here +FROM_ENCODING="GB2312" +#output encoding(UTF-8) +TO_ENCODING="UTF-8" +#convert +CONVERT=" iconv -f $FROM_ENCODING -t $TO_ENCODING" +#loop to convert multiple files +for file in *.txt; do + $CONVERT "$file" "$file" > "../${file}" +done +exit 0 \ No newline at end of file diff --git a/shell/ic.sh b/shell/ic.sh new file mode 100644 index 0000000..730875e --- /dev/null +++ b/shell/ic.sh @@ -0,0 +1,11 @@ +#!/bin/bash +#function batch_convert() { + for file in *.srt + do + # iconv -f BIG-5 -t UTF-8 "$file" > "sub/_$file" +# mv -f "$file.new" "$file" +recode BIG-5..UTF-8 "$file" + done +#} + +#batch_convert ~/Media/sf_share/sub \ No newline at end of file diff --git a/shell/subrename/mergesub.sh b/shell/subrename/mergesub.sh new file mode 100644 index 0000000..acf3307 --- /dev/null +++ b/shell/subrename/mergesub.sh @@ -0,0 +1,60 @@ +if [ $# -ne 2 ]; then + echo "--- need argument ---"; + exit 1; +fi +if [[ $1 == *"\\"* ]]; then + echo "--- path cannot contains \\ ---"; + exit 1; +fi +if [[ $2 == *"\\"* ]]; then + echo "--- path cannot contains \\ ---"; + exit 1; +fi + +if [[ ! -d $1 || ! -d $2 ]]; then + echo "--- path does not exist\\ ---"; + exit 1; +fi + +IFS=$'\n' + +root=`realpath ${0%/*}` +log=$root/`date '+%Y_%m_%d_%H_%M_%S'`.log + +cd $1; + +origin=(`ls`); + +echo ${origin[*]}>`expr $log` +echo "---">>`expr $log` +echo "origin files:" +for i in ${origin[*]};do + echo " "$i +done +echo + +echo "origin length is "${#origin[*]} + +cd .. +cd $2; +sub=(`ls`); +echo ${sub[*]}>>`expr $log` +echo "sub files:" +for i in ${sub[*]}; do + echo " "$i; +done +echo "sub length is "${#sub[*]}锛 +echo + +if [ ${#origin[*]} != ${#sub[*]} ]; then + echo "---- file num do not equal ---"; + exit 1; +fi + +for((i=0;i<`expr ${#sub[*]}`;i++));do + echo ${sub[`expr $i`]}; + echo ${origin[`expr $i`]%.*} + cat $1/"${origin[`expr $i`]}" >> "${sub[`expr $i`]}" + #mv ${sub[`expr $i`]} ${origin[`expr $i`]%.*}.srt +done +echo result $?; \ No newline at end of file diff --git a/shell/subrename/presubrename.sh b/shell/subrename/presubrename.sh index 27b8921..530bdc2 100644 --- a/shell/subrename/presubrename.sh +++ b/shell/subrename/presubrename.sh @@ -23,7 +23,7 @@ log=$root/`date '+%Y_%m_%d_%H_%M_%S'`.log cd $1; -origin=(*); +origin=(`ls`); echo ${origin[*]}>`expr $log` echo "---">>`expr $log` @@ -33,17 +33,17 @@ for i in ${origin[*]};do done echo -echo "origin length is "${#origin[*]} +echo "origin length is `ls | wc -l`" cd .. cd $2; -sub=(*); +sub=(`ls`); echo ${sub[*]}>>`expr $log` echo "sub files:" for i in ${sub[*]}; do echo " "$i; done -echo "sub length is "${#sub[*]}锛 +echo "sub length is `ls | wc -l`" echo if [ ${#origin[*]} != ${#sub[*]} ]; then diff --git a/shell/subrename/rename.sh b/shell/subrename/rename.sh new file mode 100644 index 0000000..22c80a6 --- /dev/null +++ b/shell/subrename/rename.sh @@ -0,0 +1,8 @@ +mv *S01E01* The.Staircase.2022.S01E01.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass +mv *S01E02* The.Staircase.2022.S01E02.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass +mv *S01E03* The.Staircase.2022.S01E03.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass +mv *S01E04* The.Staircase.2022.S01E04.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass +mv *S01E05* The.Staircase.2022.S01E05.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass +mv *S01E06* The.Staircase.2022.S01E06.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass +mv *S01E07* The.Staircase.2022.S01E07.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass +mv *S01E08* The.Staircase.2022.S01E08.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass \ No newline at end of file diff --git a/shell/subrename/subrename.sh b/shell/subrename/subrename.sh index ddaf066..023794a 100644 --- a/shell/subrename/subrename.sh +++ b/shell/subrename/subrename.sh @@ -23,7 +23,7 @@ log=$root/`date '+%Y_%m_%d_%H_%M_%S'`.log cd $1; -origin=(*); +origin=(`ls`); echo ${origin[*]}>`expr $log` echo "---">>`expr $log` @@ -33,17 +33,17 @@ for i in ${origin[*]};do done echo -echo "origin length is "${#origin[*]} +echo "origin length is `ls | wc -l`" cd .. cd $2; -sub=(*); +sub=(`ls`); echo ${sub[*]}>>`expr $log` echo "sub files:" for i in ${sub[*]}; do echo " "$i; done -echo "sub length is "${#sub[*]}锛 +echo "sub length is `ls | wc -l`" echo if [ ${#origin[*]} != ${#sub[*]} ]; then diff --git a/shell/subrename/zipmanga.sh b/shell/subrename/zipmanga.sh new file mode 100644 index 0000000..54d1c24 --- /dev/null +++ b/shell/subrename/zipmanga.sh @@ -0,0 +1 @@ +for dir in */; do ( cd "$dir" && zip -r ../"${dir%/}".zip . ) done