Skip to content

Instantly share code, notes, and snippets.

View Joshfindit's full-sized avatar

Josh Joshfindit

View GitHub Profile
@Joshfindit
Joshfindit / Looking for duplicates
Created April 16, 2014 02:49
Text analysis for word frequency (good for finding common words in marketing material)
#First, create a folder and copy the raw text from each page in to it's own text file.
#Example: harv_eker1.txt , harv_eker2.txt , harv_eker3.txt , and so on.
#Open a terminal window in that folder, and run the following:
cat *.txt | tr -d '[:punct:]' | tr ' ' '\n' | tr 'A-Z' 'a-z' | sort | uniq -c | sort -rn
#most-used words will be at the top
#!/bin/sh
#This is to be run on the ubuntu docker image
#screen HIGHLY suggested - The steps take a while (esp the apache archive downloads) and are not fault-tolerant
#create 8GB swap file
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
#Set swap file to mount on boot
#!/bin/sh
# This is to be run on the DigitalOcean CentOS image
# create 8GB swap file
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Set swap file to mount on boot
@Joshfindit
Joshfindit / dropbox-monit
Last active May 11, 2016 14:39 — forked from richhollis/dropbox-monit
Shell script for monit to keep the dropbox daemon running
check process dropbox with pidfile /home/username/.dropbox/dropbox.pid
start program = "/home/username/dropbox.py start"
as uid username and gid username
stop program = "/home/username/dropbox.py stop"
as uid username and gid username
# Installed to /etc/monit/conf.d/dropbox-monit
# Assumes that https://www.dropbox.com/download?dl=packages/dropbox.py is installed at /home/username/dropbox.py
@Joshfindit
Joshfindit / README.md
Created November 30, 2016 15:57 — forked from fabiovalse/README.md
External SVG import & zoom

This example shows how to import an external SVG file into a web page. Furthermore, the D3 zoom bahaviour can be used for zoom in/out the image.

@Joshfindit
Joshfindit / docker
Last active January 10, 2017 18:52 — forked from CliffordAnderson/docker
Docker Image for Neo4j 3.1 with just APOC (Spatial plugin not currently updated for 3.1)
# Adding APOC to Official Neo4j Docker Image
FROM neo4j:3.1
ENV NEO4J_PLUGINS_PATH /var/lib/neo4j/plugins/
ENV NEO4J_APOC_FILE apoc-3.1.0.3-all.jar
ENV NEO4J_APOC_URI https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.1.0.3/apoc-3.1.0.3-all.jar
RUN curl --fail --silent --show-error --location --output $NEO4J_APOC_FILE $NEO4J_APOC_URI \
#!/bin/sh
#Exit `docker-compose run` containers
docker rm $(docker ps -a -f "name=_run_" -q)
#Make sure that exited containers are deleted.
docker rm -v $(docker ps -a -q -f status=exited)
#Remove unwanted ‘dangling’ images
docker rmi $(docker images -f "dangling=true" -q)