Skip to content

Instantly share code, notes, and snippets.

View whyvez's full-sized avatar

Yves Richard whyvez

View GitHub Profile
@whyvez
whyvez / nginx-proxy.sh
Created October 6, 2017 17:34
Install NGINX as proxy
#!/usr/bin/env bash
url=$1
sudo yum update -y
sudo yum install nginx -y
sudo bash -c "cat >/etc/nginx/nginx.conf" <<EOF
user nginx;
worker_processes 1;
@whyvez
whyvez / install.sh
Created August 28, 2017 19:55
Install Ansible via Homebrew
brew install ansible
echo "127.0.0.1" > ~/.ansible/hosts
echo "ANSIBLE_INVENTORY=~/.ansible/hosts" >> ~/.bash_profile
source ~/.bash_profile
@whyvez
whyvez / bcfiremap.json
Created July 12, 2017 15:48
BC Gov fires JSON data example
{
"Document": {
"Style": [
{
"@id": "Fire of Note",
"IconStyle": {
"scale": "1.0",
"Icon": {
"href": "http://openmaps.gov.bc.ca/kml/icons/fire/fire_of_note.png"
},
@whyvez
whyvez / repo-cleanup.sh
Created July 8, 2016 18:08
Shell script that prints out repos in a CSV format as a task list for repo cleanup.
#!/usr/bin/env bash
# prints a list of github org repos as csv with additional fields to track cleanup tasks.
# usage: bash ./repo-cleanup.sh <org> <your-gh-pat>
# gh api docs:
# auth: https://developer.github.com/v3/#authentication
# repos: https://developer.github.com/v3/repos/
# pagination: https://developer.github.com/v3/#pagination
org=$1
@whyvez
whyvez / xyz_vs_tms.md
Created May 13, 2016 14:55 — forked from tmcw/xyz_vs_tms.md
The difference between XYZ and TMS tiles and how to convert between them

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

@whyvez
whyvez / csv2dyn.awk
Created May 9, 2016 23:25
Converts csv to AWS DynamoDB STX/ETX ASCII delimited format
# converts a csv file to a dynamodb compatible stx/etx acsii delimited file
# awk -F, -v types=n,s,s,s,s,s,n,n -f csv2dyn.awk mydata.csv > dynamo.txt
BEGIN {
STX="\02"
ETX="\03"
split(types, dtypes, ",")
}
@whyvez
whyvez / gitiup-mini.sh
Last active April 5, 2016 19:57
minimal osx gitiup script
#!/usr/bin/env bash
# install apple command line tools
xcode-select --install
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# bins
brew install git
@whyvez
whyvez / winux.md
Last active March 24, 2016 22:39
Linux on Windows in 5 minutes flat.

###TL;DR

  1. Install the Docker Toolbox from : https://www.docker.com/toolbox
  2. Open on the Github Terminal application (CLI).
  3. Run these commands at the CLI.
docker-machine create --driver virtualbox --virtualbox-host-dns-resolver default
docker-machine env --shell powershell default | Invoke-Expression
docker run -ti debian /bin/bash
@whyvez
whyvez / installGithub.py
Created February 14, 2016 21:31
install python package from github
#!/usr/bin/env python
"""installGithub.r
Usage: installGithub.r <repo> [-h] [--ref=<ref>] [--token=<token>]
-h --help show this help text
-r --ref=<ref> Git ref
-t --token=<token> Github token
@whyvez
whyvez / gist:2bf7f8bc6074f026055d
Created February 12, 2016 21:58 — forked from fonnesbeck/gist:71fb84319d33e3227e87
Installing rpy2 against Homebrew R
env LDFLAGS="-L/usr/local/Cellar/r/3.1.0/R.framework/Versions/3.1/Resources/lib -L/usr/local/opt/openblas/lib" \
python setup.py build
python setup.py install
python -m 'rpy2.tests'