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 #dim: control display brightness from terminal
#usage: dim x #usage: dim x
#where x is an integer for a new display brightness within the [min,max] range of [0,100] #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 #James B. Ackman 2019-02-06T15:55:20-08:00
#check kernel backlight driver names on your machine: `ls -l /sys/class/backlight/*` #check kernel backlight driver names on your machine: `ls -l /sys/class/backlight/*`

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/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 #default image location
blobFolder=$HOME/figures blobFolder=$HOME/figures

View File

@@ -1,31 +1,49 @@
#!/bin/bash #!/bin/bash
#pdf2bib if [ "$1" == "-h" ] ; then
# usage: echo "
# pdf2bib.sh file.pdf 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
# depends:
# xsltproc - xml processor, from GNOME project usage:
# pubmed2bibtex.xsl - xml processor stylesheet pdf2bib.sh file.pdf
#James Ackman 2018-11-07T14:41:53-08:00
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 #Setup defaults
styleSheet="$HOME/bin/pubmed2bibtex.xsl" styleSheet=${pubmedStyleSheet:-$HOME/bin/pubmed2bibtex.xsl}
bibdFileOut="$HOME/projects/bibd/OMEGA.bib" bibdFileOut=${bibdFileOut:-$HOME/projects/bibd/OMEGA.bib}
pdfPathOut="$HOME/projects/bibd/papers" pdfPathOut=${pdfPathOut:-$HOME/projects/bibd/papers}
relPath=$(basename $pdfPathOut) relPath=$(basename $pdfPathOut)
fn=$1 fn=$1
set -e #exit if an error set -e #exit if an error
echo "using $pdfPathOut" echo "using $pdfPathOut"
echo "using $bibdFileOut" echo "using $bibdFileOut"
#try to extract doi from pdf and retrieve a pubmed id #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#") 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 if [ -z "$doi" ]; then
echo "doi not found" echo "doi not found"
exit 1 exit 1
fi fi
## TODO: dedupe this with sdoi.sh ## 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#") 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 #!/bin/bash
#installation: place in home directory and make this file executable `chmod u=rwX,go= reveal.sh` if [ "$1" == "-h" ] ; then
#usage example: `./reveal.sh neuroanatomy1.md` 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" appPath="$HOME/projects/dev/reveal.js"

26
sdoi.sh
View File

@@ -1,12 +1,26 @@
#!/bin/bash #!/bin/bash
#sdoi - search for doi and append bibtex entry to db if [ "$1" == "-h" ] ; then
# usage: echo "
# sdoi.sh 'doi.string' 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 #Setup defaults
styleSheet="$HOME/bin/pubmed2bibtex.xsl" styleSheet=${pubmedStyleSheet:-$HOME/bin/pubmed2bibtex.xsl}
bibdFileOut="$HOME/projects/bibd/OMEGA.bib" bibdFileOut=${bibdFileOut:-$HOME/projects/bibd/OMEGA.bib}
pdfPathOut="$HOME/projects/bibd/papers" pdfPathOut=${pdfPathOut:-$HOME/projects/bibd/papers}
relPath=$(basename $pdfPathOut) relPath=$(basename $pdfPathOut)
doi=$1 doi=$1
fn=$2 fn=$2

View File

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

View File

@@ -1,13 +1,26 @@
#!/bin/bash #!/bin/bash
#spmid - search for pubmed id and append bibtex entry to db if [ "$1" == "-h" ] ; then
# usage: echo "
# spmid.sh '12345678' spmid - search for pubmed guid and append bibtex entry to bibtex db. Optionally import an associated pdf.
# spmid.sh '12345678' download.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 #Setup defaults
styleSheet="$HOME/bin/pubmed2bibtex.xsl" styleSheet=${pubmedStyleSheet:-$HOME/bin/pubmed2bibtex.xsl}
bibdFileOut="$HOME/projects/bibd/OMEGA.bib" bibdFileOut=${bibdFileOut:-$HOME/projects/bibd/OMEGA.bib}
pdfPathOut="$HOME/projects/bibd/papers" pdfPathOut=${pdfPathOut:-$HOME/projects/bibd/papers}
relPath=$(basename $pdfPathOut) relPath=$(basename $pdfPathOut)
uid=$1 uid=$1
fn=$2 fn=$2

View File

@@ -1,14 +1,29 @@
#!/bin/bash #!/bin/bash
#spubmed.sh - search for pubmed for author, journal, year if [ "$1" == "-h" ] ; then
# usage: echo "
# spubmed.sh 'kaas' 'trends+neurosci' '1995' spubmed.sh - search for pubmed for author, journal, year
# spubmed.sh 'rakic' 'j+comp+neurol' '1972'
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 #Setup defaults
styleSheet="$HOME/bin/pubmed2bibtex.xsl" styleSheet=${pubmedStyleSheet:-$HOME/bin/pubmed2bibtex.xsl}
bibdFileOut="$HOME/projects/bibd/OMEGA.bib" bibdFileOut=${bibdFileOut:-$HOME/projects/bibd/OMEGA.bib}
pdfPathOut="$HOME/projects/bibd/papers" pdfPathOut=${pdfPathOut:-$HOME/projects/bibd/papers}
relPath=$(basename $pdfPathOut) relPath=$(basename $pdfPathOut)
author=$1 author=$1
journal=$2 journal=$2
year=$3 year=$3

24
woola
View File

@@ -1,7 +1,25 @@
#!/bin/bash #!/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 #helper startup script for woola
appPath="$HOME/projects/dev/woola" appPath="$HOME/projects/dev/woola"
configFile=$HOME/.config/woola/config.js configFile=$HOME/.config/woola/config.js
optFlag=${1:-serve}
if [[ -e $configFile ]] && [[ ! -e config.js ]]; then if [[ -e $configFile ]] && [[ ! -e config.js ]]; then
ln -s $configFile config.js ln -s $configFile config.js
@@ -18,5 +36,9 @@ fi
#if [[ ! -d figures ]]; then #if [[ ! -d figures ]]; then
# ln -s $HOME/figures figures # ln -s $HOME/figures figures
#fi #fi
node $appPath/lib/index.js if [[ "$optFlag" == "build" ]]; then
node $appPath/lib/index --build
else
node $appPath/lib/index.js
fi