Skip to content

Instantly share code, notes, and snippets.

View spara's full-sized avatar

Sophia Parafina spara

View GitHub Profile
@spara
spara / Dockerfile
Created June 6, 2017 17:03
Dockerfile for AtSea Shop Sample Application
FROM node:latest AS storefront
WORKDIR /usr/src/atsea/app/react-app
COPY react-app/package.json .
RUN npm install
COPY . /usr/src/atsea/app
RUN npm run build
FROM maven:latest AS appserver
WORKDIR /usr/src/atsea
COPY pom.xml .
@spara
spara / atsea_build_script.sh
Created May 11, 2017 20:26
Bash build script for AtSea application
#!/bin/bash
docker-compose down
mkdir -p app/react-app/node_modules
npm install --prefix app/react-app
npm run build --prefix app/react-app
rm -r app/static; mv app/react-app/build app/static
mvn package
cp -f target/AtSea-0.0.1-SNAPSHOT.jar app/
docker-compose build
docker-compose u
@spara
spara / check_open_ports.sh
Created May 9, 2017 12:36
find open ports using netstat
sudo netstat -plunt

Protip 1: Create a Non-root User

This is good advice particularly in Linux

RUN groupadd -r nodejs \
   && useradd -m -r -g nodejs nodejs

USER nodejs

Rails on Docker

Note: many issues listed below are not specific to Rails or to Ruby. They can also exist in other languages or web frameworks presenting similar challeneges. It is important to note these challenges, because they can impede the workflow and best practices taught and used by Rails practitioners.

Challenges and Remediations

Different versions of Ruby

There are many different versions of Ruby in use. This is very unique, in that, in the Python world, you have many versions, but almost everyone will be using the last 2.X or the last 3.X. In the Java world, most use cases are covered by the last two major releases of either Java released by Oracle or on OpenJDK.

sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

Keybase proof

I hereby claim:

  • I am spara on github.
  • I am spara (https://keybase.io/spara) on keybase.
  • I have a public key ASBSciQqQqGDXOL9fPAm8Fu13Pu-BgfkxcuNmxi6dVo0dwo

To claim this, I am signing this object:

@spara
spara / Makefile
Created July 19, 2016 15:34 — forked from yanofsky/Makefile
This is workflow for downloading, processing, and mosaicing Landsat scenes, as a Makefile
# lansatutil directory
LANDSAT = ~/landsat
# scenes to target
LANDSAT_IDS = \
LC81220442016038LGN00 \
LC81220452016038LGN00 \
LC81210442014281LGN00 \
LC81210452014281LGN00
@spara
spara / Useful_docker_commands.md
Last active May 16, 2016 15:48
useful docker commands

Stopping and removing containers and volumes

Note: If you get a "no space left on device error", you may have stopped containers taking up space.

Show all containers, running and stopped

docker ps -a

One liner to stop / remove all of Docker containers:

@spara
spara / Landsat 8 gdal processing
Last active March 28, 2017 17:26 — forked from andymason/Landsat 8 gdal processing
Added projection wrap correction
#! /bin/bash
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * convert (image-magick)
#
# Reference info:
# http://www.mapbox.com/blog/putting-landsat-8-bands-to-work/