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
#Drag-and-drop upload files, via JavaScript, to a simple Python 3 HTTP server |
As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.
- Install the required build-tools (some might already be installed on your system).
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
# For Windows users# Note: <> denotes changes to be made | |
#Create a conda environment | |
conda create --name <environment-name> python=<version:2.7/3.5> | |
#To create a requirements.txt file: | |
conda list #Gives you list of packages used for the environment | |
conda list -e > requirements.txt #Save all the info about packages to your folder |
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
yum install gcc make ncurses-devel | |
yum install giflib-devel libjpeg-devel libtiff-devel -y | |
cd /usr/local/src | |
wget http://ftp.gnu.org/pub/gnu/emacs/emacs-24.5.tar.gz | |
tar xzvf emacs-24.5.tar.gz | |
cd emacs-24.5 | |
./configure --without-x --without-selinux | |
make && make install | |
which emacs | |
emacs --version |
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
#!/usr/bin/env python | |
# -*- encoding:utf-8 -*- | |
from PyPDF2 import PdfFileReader | |
import re | |
import sys | |
pdf_file = sys.argv[1] | |
doi_re = re.compile("10.(\d)+/([^(\s\>\"\<)])+") | |
input = PdfFileReader(file(pdf_file, "rb")) |
This is pretty specific to my setup but the idea can be adapted to work with pretty much anything.
Go has a flag package which makes parsing command line arguments really easy.
package main
NewerOlder