Skip to content

Instantly share code, notes, and snippets.

View joantune's full-sized avatar

João Antunes joantune

View GitHub Profile
# Finish headless installation via ssh. See /boot/config.txt
(local)$ ssh pi@192.168.2.X
$ sudo apt-get update && apt-get dist-upgrade
$ sudo raspi-config
# Add locale en.us-utf8 (but keep en.gb-utf8)
$ sudo dpkg-reconfigure locales
# Timezone
$ sudo dpkg-reconfigure tzdata
# Update firmware
$ sudo rpi-update
@joantune
joantune / DBMigrationMR.java
Created August 9, 2014 15:43
Play 2.2.X + JPA + Hibernate DB migration bootstrapper
package util.plugins;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.hibernate.HibernateException;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
import org.hibernate.tool.hbm2ddl.SchemaValidator;
@joantune
joantune / post-update.sh
Last active August 29, 2015 14:05
Git post-update hook to deploy Play application on a Docker container
#!/usr/bin/env bash
. /home/deploy/.profile
set -e
workspace="/home/deploy/sandbox"
conf_files="/home/deploy/fb/conf"
repo_location="/home/deploy/feedburner"
project_name="feedburner"
@joantune
joantune / sudoers-docker
Last active August 29, 2015 14:05
SUDOERS example for docker, without password prompting
User_Alias DOCKERADMINS = deploy
# Cmnd alias specification
DOCKERADMINS ALL = NOPASSWD: /usr/bin/docker
@joantune
joantune / Dockerfile-play
Created August 10, 2014 13:04
Dockerfile for deployment of a Play app
FROM joantune/morningreader-base
MAINTAINER joantune @joantune joao.antunes@tagus.ist.utl.pt
USER root
WORKDIR /home/player/
RUN mkdir -p /home/player/Feedburner
ADD . /home/player/Feedburner/
RUN chown -R player Feedburner
@joantune
joantune / Dockerfile
Last active August 29, 2015 14:06
Bmetrics - Ghost - Dockerfile
#
# Ghost Dockerfile
#
# https://github.com/dockerfile/ghost
#
# Pull base image.
FROM dockerfile/nodejs
# Install Ghost
@joantune
joantune / SecureSocialContextFixed
Created November 11, 2014 11:44
Several needed Java files for a quick and dirty fix on maintaining the context on a Play Framework 2.x with SecureSocial
SecuredActionCorrected.java:
package auth.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import play.mvc.With;
@joantune
joantune / DBMigrationMR.java
Created June 8, 2016 07:55
Hibernate migration SQL generator for Play 2.X
package util.plugins;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.hibernate.HibernateException;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
import org.hibernate.tool.hbm2ddl.SchemaValidator;

Keybase proof

I hereby claim:

  • I am joantune on github.
  • I am jantunes (https://keybase.io/jantunes) on keybase.
  • I have a public key ASB1p6oMIcvDAD8rCAr2TdjDiAUCeTzMqg_cUQf4tsOo5wo

To claim this, I am signing this object:

import os
import sys
import unittest
from pprint import pformat
from pyactiveresource.activeresource import ActiveResource
from pyactiveresource.connection import Request
from pyactiveresource.testing import http_fake
import shopify
from pyactiveresource.testing.http_fake import TestHandler, FakeResponse, Error
from typing import Callable