Skip to content

Instantly share code, notes, and snippets.

View sanderpick's full-sized avatar
🎟️
Got me a ticket to ride

Sander Pick sanderpick

🎟️
Got me a ticket to ride
View GitHub Profile
#!/usr/bin/env bash
set -e
# textile daemon
wget https://s3.amazonaws.com/dist.textile.io/textile-go-linux-amd64.tar.gz
tar xvfz textile-go-linux-amd64.tar.gz
rm textile-go-linux-amd64.tar.gz
sudo mv textile-go-linux-amd64 /usr/local/bin/textile
@sanderpick
sanderpick / ipfs.sh
Last active November 29, 2022 04:30
Install ipfs on Amazon Linux.
#!/usr/bin/env bash
set -e
echo 'export IPFS_PATH=/data/ipfs' >>~/.bash_profile
source ~/.bash_profile
# ipfs daemon
wget https://dist.ipfs.io/go-ipfs/v0.4.15/go-ipfs_v0.4.15_linux-amd64.tar.gz
tar xvfz go-ipfs_v0.4.15_linux-amd64.tar.gz
@sanderpick
sanderpick / install.sh
Last active March 13, 2018 20:12
Install an nginx reverse proxy + cache for an ipfs-cluster peer gateway on Amazon Linux.
#!/usr/bin/env bash
set -e
# install nginx
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install ./epel-release-latest-7.noarch.rpm -y
sudo yum install nginx -y
rm epel-release-latest-7.noarch.rpm
@sanderpick
sanderpick / ipfs-gateway-nginx.conf
Created February 27, 2018 23:54
nginx config files for an ipfs-cluster peer gateway on Amazon Linux.
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
@sanderpick
sanderpick / install.sh
Last active March 7, 2022 00:12
Install an ipfs-cluster peer on Amazon Linux.
#!/usr/bin/env bash
set -e
[ -z "$CLUSTER_SECRET" ] && echo "Need to set CLUSTER_SECRET" && exit 1;
echo 'export IPFS_PATH=/data/ipfs' >>~/.bash_profile
echo 'export IPFS_CLUSTER_PATH=/data/ipfs-cluster' >>~/.bash_profile
source ~/.bash_profile
@sanderpick
sanderpick / install-redis.sh
Last active February 22, 2017 21:50 — forked from FUT/install-redis.sh
Install Redis on EC2
1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
/etc/localtime
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download)
@sanderpick
sanderpick / distance.sql
Created March 24, 2015 13:31
ST_Length + ST_MakeLine: connect the dots and measure distance
SELECT
ST_Length(ST_MakeLine(the_geom_webmercator ORDER BY created_at ASC)) AS sum
FROM sf_muni
WHERE id = '2'
@sanderpick
sanderpick / trigger.sql
Last active August 29, 2015 14:17
TRIGGER: clear old data on INSERT
CREATE OR REPLACE FUNCTION clearOld()
RETURNS TRIGGER
AS $$
BEGIN
DELETE FROM sf_muni_points WHERE created_at < now()-'1 day'::interval;
RETURN NEW;
END;
$$ language plpgsql;
CREATE TRIGGER clearOldOnInsert
@sanderpick
sanderpick / index.html
Created March 2, 2015 19:34
Torque Heatmap w/ Leaflet
<!DOCTYPE html>
<html>
<head>
<title>Torque Heatmap w/ GMA</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8">
<link rel="shortcut icon" href="Icons/favicon.ico" />
<style>
html, body, #map-canvas {
@sanderpick
sanderpick / index.html
Last active August 29, 2015 14:16
Torque Heatmap w/ GM API is all black
<!DOCTYPE html>
<html>
<head>
<title>Torque Heatmap w/ GMA</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8">
<link rel="shortcut icon" href="Icons/favicon.ico" />
<style>
html, body, #map-canvas {