Last active
August 6, 2020 18:26
-
-
Save atroia/163356aeb9ff464bc55c to your computer and use it in GitHub Desktop.
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
# ------------------------------- | |
# EPUB MANAGEMENT | |
# ------------------------------- | |
# KF8 | |
# ------------------------------------------------------------ | |
alias mkkf8='cd OEBPS;kindle29;mv content.mobi ../../Amz_KF8_v$(date +'%Y%m%d-%H%M%S').mobi; cd ../..; mv *.mobi ~finals; cd ~finals; open "`ls -t | grep .mobi | head -1`"' # adds incrementing number to file name an$ | |
alias kindle29='echo -e "\n\n/* ----- KindleGen 2.9 ----- */\n";/Volumes/Active/ScriptsLibrary/bin/kindlegen2.9/kindlegen content.opf -c2 -verbose' | |
# KF8 boneyard | |
# ------------------------------------------------------------ | |
#alias kindle0='/Volumes/Active/ScriptsLibrary/bin/Kindlegen1.2/kindlegen content.opf -c0 -verbose' | |
#alias kindle1='/Volumes/Active/ScriptsLibrary/bin/Kindlegen1.2/kindlegen content.opf -c1 -verbose' | |
#alias kindle2='/Volumes/Active/ScriptsLibrary/bin/Kindlegen1.2/kindlegen content.opf -c2 -verbose' | |
#alias kindle20='/Volumes/Active/ScriptsLibrary/bin/kindlegen2.9/kindlegen content.opf -c0 -verbose' | |
#alias kindle21='/Volumes/Active/ScriptsLibrary/bin/kindlegen2.9/kindlegen content.opf -c1 -verbose' | |
#alias kindle22='/Volumes/Active/ScriptsLibrary/bin/kindlegen2.9/kindlegen -dont_append_source content.opf -c2 -verbose' | |
# EPUB | |
# ------------------------------------------------------------ | |
#alias mkepub='step1; step2; step3; epc; fnRename; ..; open "`ls -t | grep .epub | head -1`"' #combine the aliases step1, step2, step3 and epc to one alias | |
alias mkepub2='e2_step1;e2_step2;e2_step3;epc;fnRename;..;mvEpub;cd ~finals;opnEpub' | |
alias mkepub3='e3_step1;e3_step2;e3_step3;epc;aces;fnRename3;..;mvEpub;cd ~finals;opnEpub' | |
alias mkbn='e3_step1;e3_step2;e3_step3;epc-30;epc-301;epc-411;fnRename4;..;mvEpub;cd ~finals;opnEpub' | |
#alias mkepub3test='e3_step1; e3_step2; e3_step3; fnRename5; ..; mvEpub; cd ~finals; opnEpub' | |
#alias mkapple='step1; step2; step3; epc; fnRename2; ..; mv *.epub ~finals; cd ~finals; open "`ls -t | grep .epub | head -1`"' | |
#alias test='epc;fs' | |
alias nzp='echo -e "\n/* ----- EPUB3 Unzip ----- */\n";unzip *.epub; fnDel' #unzip .epub file then move file to Trash | |
alias e2_step1='find . -name '*DS_Store' -type f -delete;find . -name '._*' -type f -delete' # deletes the dot files before zipping | |
alias e2_step2='zip -0Xq book.epub mimetype' # correctly zips the mimetype before other files | |
alias e2_step3='zip -Xr9Dq book.epub *' # completes file zip | |
alias e3_step1='echo -e "\n/* ----- EPUB3 Zip ----- */\n";zip -X book.epub mimetype' | |
alias e3_step2='zip -rg book.epub META-INF -x \*.DS_Store' | |
alias e3_step3='zip -rg book.epub OEBPS -x \*.DS_Store' | |
alias fnRename='mv book.epub ../ePub_Gen_v$(date +'%Y%m%d-%H%M%S').epub' # renames zipped file with incrementing version number | |
alias fnRename2='mv book.epub ../ePub_Apple_v$(date +'%Y%m%d-%H%M%S').epub' | |
alias fnRename3='mv book.epub ../ePub3_Gen_v$(date +'%Y%m%d-%H%M%S').epub' | |
alias fnRename4='mv book.epub ../ePub3_BN_v$(date +'%Y%m%d-%H%M%S').epub' | |
alias fnRename5='mv book.epub ../${PWD##*/}_ePub3_Gen_v$(date +"%Y%m%d-%H%M%S").epub' | |
#alias fnRename6='mv book.epub ../ePub3_Gen_v$(date +'%Y%m%d-%H%M%S').epub && touch ../~finals/ePub3_Gen_v$(date +'%Y%m%d-%H%M%S').ini' | |
alias fnTest='for i in *; do mv $i/book.epub $i/$i$((j++)).epub ; done' # this is a test... | |
alias fnDel='cp *.epub ~/.Trashes && rm *.epub' | |
#alias mvepub='mv *.epub ../ePub_Gen_v$(date +'%Y%m%d-%H%M%S').epub' # adds date and time as file name and moves file up in directory tree | |
#alias mvepub='mv *.epub ../ePub_Gen_v$((j++)).epub' # adds incrementing number as file name and moves file up in directory tree | |
alias mvEpub='mv *.epub ~finals' | |
alias opnEpub='open "`ls -t | grep .epub | head -1`"' | |
alias epubDate='date +%Y%m%d-%H%M%S' | |
alias changeExt='for file in *.html ; do mv $file `echo $file | sed 's/\(.*\.\)html/\1xhtml/'` ; done' #rename .html files wi$ | |
alias runPerl='for i in *.xhtml; do perl ~/ScriptsLibrary/perl/regex.pl $i; done' | |
alias xmax='changeExt; runPerl' | |
alias rubyNCX='ruby -pi.bak -e "BEGIN{\$num=0}; gsub(/(playOrder=.)\d*/) {|s| \$num+=1; \$1+\$num.to_s}" *.ncx' | |
alias uuid='uuidgen -hdr' | |
alias showDots='find . -name '._*' -type f' | |
alias dotClean='find . -name '._*' -type f -delete' | |
alias dotClean2='dot_clean .' | |
alias changePages='for file in *.pages ; do mv $file `echo $file | sed 's/\(.*\.\)pages/\1zip/'` ; done' | |
alias fs='osascript /Volumes/Active/ScriptsLibrary/applescript/fileSize.scpt' | |
# ePubCheck | |
# ------------------------------------------------------------ | |
# Stable Production-ready Releases | |
# --------------- | |
alias epc-30='echo -e "\n\n/* ----- ePubCheck 3.0 (Legacy) ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-3.0/epubcheck-3.0.jar *.epub' | |
alias epc-301='echo -e "\n\n/* ----- ePubCheck 3.0.1 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-3.0.1/epubcheck-3.0.1.jar *.epub' | |
alias epc-401='echo -e "\n\n/* ----- ePubCheck 4.0.1 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.0.1/epubcheck.jar *.epub' | |
alias epc-402='echo -e "\n\n/* ----- ePubCheck 4.0.2 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.0.2/epubcheck.jar *.epub' | |
alias epc-411='echo -e "\n\n/* ----- ePubCheck 4.1.1 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.1.1/epubcheck.jar *.epub' | |
alias epc-420='echo -e "\n\n/* ----- ePubCheck 4.2.0 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.2.0/epubcheck.jar *.epub' | |
alias epc-421='echo -e "\n\n/* ----- ePubCheck 4.2.1 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.2.1/epubcheck.jar *.epub' | |
alias epc-422='echo -e "\n\n/* ----- ePubCheck 4.2.2 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.2.2/epubcheck.jar *.epub' | |
alias epc-423='echo -e "\n\n/* ----- ePubCheck 4.2.3 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.2.3/epubcheck.jar *.epub' | |
alias epc-424='echo -e "\n\n/* ----- ePubCheck 4.2.4 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.2.4/epubcheck.jar *.epub' | |
# quick alias to most current version of ePC | |
alias epc='epc-424' | |
alias check='epc;aces;fs' # epc, aces and file size check | |
# Public Testing Releases | |
# ----------------------- | |
alias epc-420a1='echo -e "\n\n/* ----- ePubCheck 4.2.0 alpha 1 ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.2.0-alpha-1/epubcheck.jar *.epub' | |
alias epc-420b='echo -e "\n\n/* ----- ePubCheck 4.2.0 beta ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.2.0-beta/epubcheck.jar *.epub' | |
alias epc-420rc='echo -e "\n\n/* ----- ePubCheck 4.2.0-rc ----- */\n";java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.2.0-rc/epubcheck.jar *.epub' | |
#alias epca='export JAVA_HOME=`/usr/libexec/java_home -v1.6.0`;java -jar /Volumes/Active/ScriptsLibrary/bin/epubcheck-4.0.2/epubcheck.jar *.epub' | |
# For use when Java is unavailable | |
#alias epc='open -a "EPUB-Checker.app" *.epub' | |
# ACE Check | |
# ------------------------------------------------------------ | |
alias aces='echo -e "\n\n/* ----- ACE 1.1.1 ----- */\n";ace -o ../~src *.epub' | |
alias checkACE='ace -o ../~src *.epub' | |
# quick alias to check against most recent version ePC and ACE | |
alias ae-check='epc;aces' | |
# ------------------------------- | |
# MISC | |
# ------------------------------- | |
#perlScript | |
alias regex='perl /Volumes/Active/ScriptsLibrary/perl/regex.pl *.xhtml' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment