helpFound

This commit is contained in:
ackman678
2020-02-13 12:11:29 -08:00
parent cf734dc8aa
commit 74b88b38eb
9 changed files with 130 additions and 35 deletions

2
dim
View File

@@ -2,7 +2,7 @@
#dim: control display brightness from terminal
#usage: dim x
#where x is an integer for a new display brightness within the [min,max] range of [0,100]
#user should be part of the video user group to run this wcd ithout sudo
#user should be part of the video user group to run this without sudo
#James B. Ackman 2019-02-06T15:55:20-08:00
#check kernel backlight driver names on your machine: `ls -l /sys/class/backlight/*`

View File

@@ -1,5 +1,5 @@
#!/bin/bash
#mv2figs: used by the <cmd-z> screenshot shortcut set in .config/i3/config
#mv2figs: used by the <ctrl-z> screenshot shortcut set in .config/i3/config
#default image location
blobFolder=$HOME/figures

View File

@@ -1,31 +1,49 @@
#!/bin/bash
#pdf2bib
# usage:
# pdf2bib.sh file.pdf
# depends:
# xsltproc - xml processor, from GNOME project
# pubmed2bibtex.xsl - xml processor stylesheet
#James Ackman 2018-11-07T14:41:53-08:00
if [ "$1" == "-h" ] ; then
echo "
pdf2bib - search for a doi within a pdf, query pubmed, and append bibtex entry with pdf to your local bib database file. Last two steps are identical to sdoi.sh
usage:
pdf2bib.sh file.pdf
depends:
pdftotext - from ghostscript or poppler or texlive ?
xsltproc - xml processor, from GNOME project
pubmed2bibtex.xsl - xml processor stylesheet
defaults:
Set the three required default file locations (xsl file, bib file, pdf directory)
"
exit 0
fi
#Setup defaults
styleSheet="$HOME/bin/pubmed2bibtex.xsl"
bibdFileOut="$HOME/projects/bibd/OMEGA.bib"
pdfPathOut="$HOME/projects/bibd/papers"
styleSheet=${pubmedStyleSheet:-$HOME/bin/pubmed2bibtex.xsl}
bibdFileOut=${bibdFileOut:-$HOME/projects/bibd/OMEGA.bib}
pdfPathOut=${pdfPathOut:-$HOME/projects/bibd/papers}
relPath=$(basename $pdfPathOut)
fn=$1
set -e #exit if an error
echo "using $pdfPathOut"
echo "using $bibdFileOut"
#try to extract doi from pdf and retrieve a pubmed id
#for 'DOI:' syntax
doi=$(pdftotext -q -f 1 -l 1 $fn - | grep -i doi: --max-count=1 | tr [:upper:] [:lower:] | sed -E "s#doi:(.+)#\1#")
#for 'https://doi.org' syntax
if [ -z "$doi" ]; then
doi=$(pdftotext -q -f 1 -l 1 $fn - | grep -i "doi.org/" --max-count=1 | tr [:upper:] [:lower:] | sed -E "s#.+doi\.org\/(.+)#\1#")
fi
if [ -z "$doi" ]; then
echo "doi not found"
exit 1
fi
## TODO: dedupe this with sdoi.sh
uid=$(curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=$doi&field=doi&retmode=xml" | grep -E "<Id>[0-9]+</Id>" | sed -E "s#<Id>([0-9]+)</Id>#\1#")

View File

@@ -1,6 +1,18 @@
#!/bin/bash
#installation: place in home directory and make this file executable `chmod u=rwX,go= reveal.sh`
#usage example: `./reveal.sh neuroanatomy1.md`
if [ "$1" == "-h" ] ; then
echo "
reveal - helper app for opening reveal.js markdown presentations
Useful for serving markdown text files locally with reveal.js
Usage: reveal.sh neuroanatomy1.md
"
echo "$(tput setaf 6)$EDITOR $(tput setaf 7)is currently set as editor"
exit 0
fi
set -e
appPath="$HOME/projects/dev/reveal.js"

26
sdoi.sh
View File

@@ -1,12 +1,26 @@
#!/bin/bash
#sdoi - search for doi and append bibtex entry to db
# usage:
# sdoi.sh 'doi.string'
if [ "$1" == "-h" ] ; then
echo "
sdoi - search for doi guid on pubmed and append bibtex entry to bibtex db. Optionally import a downloaded pdf.
usage:
sdoi.sh 'doi'
sdoi.sh 'doi' download.pdf
depends:
xsltproc - xml processor, from GNOME project
pubmed2bibtex.xsl - xml processor stylesheet
defaults:
Set the three required default file locations (xsl file, bib file, pdf directory)
"
exit 0
fi
#Setup defaults
styleSheet="$HOME/bin/pubmed2bibtex.xsl"
bibdFileOut="$HOME/projects/bibd/OMEGA.bib"
pdfPathOut="$HOME/projects/bibd/papers"
styleSheet=${pubmedStyleSheet:-$HOME/bin/pubmed2bibtex.xsl}
bibdFileOut=${bibdFileOut:-$HOME/projects/bibd/OMEGA.bib}
pdfPathOut=${pdfPathOut:-$HOME/projects/bibd/papers}
relPath=$(basename $pdfPathOut)
doi=$1
fn=$2

View File

@@ -20,6 +20,7 @@ set -e
#Setup defaults
fn=$1
fn2=$2
set -e #exit if an error
#decide whether to use a provided new file name or too write over the original filename

View File

@@ -1,13 +1,26 @@
#!/bin/bash
#spmid - search for pubmed id and append bibtex entry to db
# usage:
# spmid.sh '12345678'
# spmid.sh '12345678' download.pdf
if [ "$1" == "-h" ] ; then
echo "
spmid - search for pubmed guid and append bibtex entry to bibtex db. Optionally import an associated pdf.
usage:
spmid.sh '12345678'
spmid.sh '12345678' download.pdf
depends:
xsltproc - xml processor, from GNOME project
pubmed2bibtex.xsl - xml processor stylesheet
defaults:
Set the three required default file locations (xsl file, bib file, pdf directory)
"
exit 0
fi
#Setup defaults
styleSheet="$HOME/bin/pubmed2bibtex.xsl"
bibdFileOut="$HOME/projects/bibd/OMEGA.bib"
pdfPathOut="$HOME/projects/bibd/papers"
styleSheet=${pubmedStyleSheet:-$HOME/bin/pubmed2bibtex.xsl}
bibdFileOut=${bibdFileOut:-$HOME/projects/bibd/OMEGA.bib}
pdfPathOut=${pdfPathOut:-$HOME/projects/bibd/papers}
relPath=$(basename $pdfPathOut)
uid=$1
fn=$2

View File

@@ -1,14 +1,29 @@
#!/bin/bash
#spubmed.sh - search for pubmed for author, journal, year
# usage:
# spubmed.sh 'kaas' 'trends+neurosci' '1995'
# spubmed.sh 'rakic' 'j+comp+neurol' '1972'
if [ "$1" == "-h" ] ; then
echo "
spubmed.sh - search for pubmed for author, journal, year
usage:
spubmed.sh 'kaas' 'trends+neurosci' '1995'
spubmed.sh 'rakic' 'j+comp+neurol' '1972'
depends:
xsltproc - xml processor, from GNOME project
pubmed2bibtex.xsl - xml processor stylesheet
defaults:
Set the three required default file locations (xsl file, bib file, pdf directory)
"
exit 0
fi
#Setup defaults
styleSheet="$HOME/bin/pubmed2bibtex.xsl"
bibdFileOut="$HOME/projects/bibd/OMEGA.bib"
pdfPathOut="$HOME/projects/bibd/papers"
styleSheet=${pubmedStyleSheet:-$HOME/bin/pubmed2bibtex.xsl}
bibdFileOut=${bibdFileOut:-$HOME/projects/bibd/OMEGA.bib}
pdfPathOut=${pdfPathOut:-$HOME/projects/bibd/papers}
relPath=$(basename $pdfPathOut)
author=$1
journal=$2
year=$3

24
woola
View File

@@ -1,7 +1,25 @@
#!/bin/bash
if [ "$1" == "-h" ] ; then
echo "
woola shell script - a helper app to invoke the woola markdown content build or server programs
Usage: woola
woola build
Takes an optional flag that can be 'build' to build website files instead of serving.
By default this app will serve files from the current directory by default using woola.
Installation: place in home directory and make this file executable chmod: u=rwX,go= woola
"
exit 0
fi
set -e
#helper startup script for woola
appPath="$HOME/projects/dev/woola"
configFile=$HOME/.config/woola/config.js
optFlag=${1:-serve}
if [[ -e $configFile ]] && [[ ! -e config.js ]]; then
ln -s $configFile config.js
@@ -18,5 +36,9 @@ fi
#if [[ ! -d figures ]]; then
# ln -s $HOME/figures figures
#fi
node $appPath/lib/index.js
if [[ "$optFlag" == "build" ]]; then
node $appPath/lib/index --build
else
node $appPath/lib/index.js
fi