Skip to content

Instantly share code, notes, and snippets.

View markedphillips's full-sized avatar

Mark Phillips markedphillips

View GitHub Profile
@markedphillips
markedphillips / install_fonts.sh
Last active September 24, 2019 17:42
install fonts and other stuff for latex after bringing up the docker container
#!/bin/bash
# docker exec -it sharelatex bash
apt-get update -y
echo "listing ttf directory"
ls /usr/share/fonts/ttf
echo "listing truetype directory"
ls /usr/share/fonts/truetype
@markedphillips
markedphillips / change_outline_port.sh
Last active September 22, 2019 15:20
After installing the Outline Server change the key-port to a lower port for packet-dropping countries like China
IP="167.71.219.140"
PORT="442"
SERVER_SECRET="xdh4-Q2MP8Mdegf9sC-5Th" # from the apiURL prior to the 'certsha'
curl --insecure -i -X PUT \
https://$IP:$PORT/$SERVER_SECRET/server/port-for-new-access-keys \
-H 'Content-Type: application/json' \
-d '{
"port": 444
}'
@markedphillips
markedphillips / docker-compose.yml
Last active November 14, 2019 01:34
In a folder "overleaf" with this file, "docker-compose up -d" and your overleaf will magically be updated. This addresses the overleaf base image which has a dated latex package and a broken update mechanism.
version: "2.2"
services:
sharelatex:
restart: always
image: dennis1f/sharelatex-texlive2018 # sharelatex/sharelatex:latest
container_name: sharelatex
depends_on:
mongo:
condition: service_healthy
redis:
@markedphillips
markedphillips / web-servers.md
Created September 9, 2019 13:32 — forked from neilhwatson/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
if which fasd >/dev/null; then
# install fasd hooks and basic aliases in the shell
eval "$(fasd --init auto)"
# if there is fzf available use it to search fasd results
if which fzf >/dev/null; then
alias v >/dev/null && unalias v
alias vd >/dev/null && unalias vd
alias z >/dev/null && unalias z
function preview_pdf () {
if [ $1 = "" ]; then
echo "Need filename."
else
convert $1 /var/TMP/output.jpg
imgcat /var/TMP/output*.jpg;
echo "cleaning up"
rm -f /var/TMP/output*.jpg;
# ls /var/TMP/output*.jpg;
fi
@markedphillips
markedphillips / prep_docs_ingest.sh
Last active June 8, 2019 08:24
The following script pulls documents from a few directories, renames them based on last name, first name file keyword, converts the documents to text and prepares them for ingestion to a sqlite3 database where further regex work will be done to extract data from the files. This was based on a file system with /Documents/Smith, Johnson File Close…
#!/bin/bash
ABS_PATH=.\
# Colourise the output
RED='\033[0;31m' # Red
GRE='\033[0;32m' # Green
YEL='\033[1;33m' # Yellow
NCL='\033[0m' # No Color
@markedphillips
markedphillips / tensorflow_1_8_high_sierra_gpu.md
Created January 2, 2019 09:12 — forked from edc/tensorflow_1_8_high_sierra_gpu.md
Install TensorFlow 1.8 on macOS High Sierra 10.13.6 with CUDA

Tensorflow 1.8 with CUDA on macOS High Sierra 10.13.6

Forked from @William-Zhang's gist

Requirements

  • NVIDIA Web-Drivers 387.10.10.10.30.106 for 10.13.4 (17E199) (w/o Security Update)
  • CUDA-Drivers 387.128
  • CUDA 9.1 Toolkit
  • cuDNN 7.0.5 (latest for macOS)
@markedphillips
markedphillips / tensorflow_1_7_high_sierra_gpu.md
Created January 2, 2019 09:03 — forked from Willian-Zhang/tensorflow_1_7_high_sierra_gpu.md
Install Tensorflow 1.7 on macOS High Sierra 10.13.4 with CUDA and stock python

Tensorflow 1.7 with CUDA on macOS High Sierra 10.13.4 for eGPU

Largely based on the Tensorflow 1.6 gist, and Tensorflow 1.7 gist for xcode, this should hopefully simplify things a bit.

Requirements

  • NVIDIA Web-Drivers 387.10.10.10.30.103 for 10.13.4
  • CUDA-Drivers 387.178
  • CUDA 9.1 Toolkit