Skip to content

Instantly share code, notes, and snippets.


Gustaf Lindqvist gustaflindqvist

View GitHub Profile
gustaflindqvist /
Created Apr 16, 2018 — forked from kburdett/
Install Ubiquiti's UniFi Controller on a Raspberry Pi


I currently run Ubiquiti's UniFi Controller on a Raspberry Pi 3B without issue. I have tried with a Raspberry Pi 1B, but the application crashes on startup. I assume it is due to a lack of RAM. Presumably, it would run on a Raspberry Pi 2B as well (same amount of RAM), but I have not tested it on this model. YMMV.


  1. Install Raspbian on a SD card. I tested this with Jessie Lite (headless)

  2. Use raspi-config to expand the filesystem, rename your PI, etc

gustaflindqvist /
Created Jan 28, 2018 — forked from bwbaugh/
Installing Ubiquiti UniFi Controller 5 on Raspberry Pi.
# Mirror of the instructions available here:
# These commands CANNOT be run in a script.
# They're just for reference.
# Install on Raspbian Jessie, or upgrade from Wheezy.
# Make sure all packages are upgraded (update && upgrade).
gustaflindqvist / container.js
Created Nov 21, 2017 — forked from ntkoso/container.js
Server side data fetching using 'redux-saga'
View container.js
import { fork } from 'redux-saga';
import fetchEntitySaga from './fetchEntitySaga';
export default prefetch(
({ getState }) => {
if (needsFetching(getState())) {
return fork(fetchEntitySaga, getState, ...args);
gustaflindqvist / validator.js
Created Nov 13, 2017 — forked from emilbillberg/validator.js
Common Swedish validation in Javascript
View validator.js
/***************** POSTAL CODE *****************/
// cannot start with a zero and must contain 5 digits.
let postalCode = "12345";
let regexPostalCode = new RegExp("^[1-9][0-9]{4}$");
let postalCodeMathces = postalcode.match(regexPostalCode);
console.log('POSTAL CODE MATCHES:', postalCodeMathces !== null);
/***************** PERSONAL NUMBER *****************/
// can only start with one or two
// second character can only be a nine or zero
gustaflindqvist / jenkins.ec2.init.d
Created Nov 7, 2017 — forked from azam/jenkins.ec2.init.d
Startup script for the Jenkins Continuous Integration server for Amazon EC2 Linux (via jar execution)
View jenkins.ec2.init.d
# Startup script for the Jenkins Continuous Integration server for Amazon EC2 Linux
# (via jar execution)
# chkconfig: - 85 15
# description: Jenkins Continuous Integration Server
# processname: jenkins
# pidfile: /var/run/
gustaflindqvist / gist:951fcbfb29818b64c866bddf424fe087
Created Oct 23, 2017 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
View gist:951fcbfb29818b64c866bddf424fe087
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
gustaflindqvist /
Created Sep 4, 2017 — forked from juniorz/
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
gustaflindqvist /
Created Apr 6, 2017 — forked from devn/
Simple continuous deployment via Jenkins and Capistrano for all branches. Wire this up with Github post receive hooks from Jenkins for best results.
#!/bin/bash -x
# This should be your "script/ci" checked into version control, and then wired as your sole build step in Jenkins.
# Simplifying Assumptions:
# * You build all branches
# * You want to deploy all branches.
# * You wired up an SSH key to your CI server appropriately so it can talk to your deployment target(s) via Cap
gustaflindqvist / index.html
Last active Mar 13, 2017
Solve touch position and works great inside iframes
View index.html
<div id="scroller" style="width: 50%; overflow: auto;">
<iframe height="100%" id="iframe" scrolling="no" width="100%" id="iframe" src="responses.html" />