Skip to content

Instantly share code, notes, and snippets.

View gustaflindqvist's full-sized avatar
🚴‍♂️
Focusing

Gustaf Lindqvist gustaflindqvist

🚴‍♂️
Focusing
View GitHub Profile
@gustaflindqvist
gustaflindqvist / README.md
Created February 17, 2024 20:47 — forked from jasco/README.md
ARM64 Raspberry Pi 4 Unifi Controller Setup

Background

The instructions for setting up the Unifi Controller on ARM do not cover ARM64. The documentation states that ARM64 is not supported but hints it can be setup manually. The documentation also states that Java 8 is currently required. The following is therefore clearly in unsupported territory but so far seems to work fine. The internet has numerous references and resources but they weren't all easy to find and the ones I read required some modification for my configuration.

Note for the future: double check versions and source documentation if these instructions are dated. Also these instructions are specifically tailored for Ubuntu. See original references for other platforms.

Last update March 25, 2021

Base configuration

@gustaflindqvist
gustaflindqvist / .gitattributes
Created August 2, 2023 22:53 — forked from webbertakken/.gitattributes
.gitattributes for Unity projects
#
# Git attributes for Unity projects
#
# Compiled by the GameCI community under the MIT license - https://game.ci
#
# Latest version at https://gist.github.com/webbertakken/ff250a0d5e59a8aae961c2e509c07fbc
#
# Ensure that text files that any contributor introduces to the repository have their line endings normalized
* text=auto
@gustaflindqvist
gustaflindqvist / gpg-signing.md
Created June 18, 2023 20:13 — forked from xavierfoucrier/gpg-signing.md
GPG signing with Git and Github Desktop

GPG signing – git github-desktop

Here is a short guide that will help you setup your environment to create signed commits or signed tags with Git locally. This has been extensively tested on Windows with Git and the Github Desktop application: I use it every day for my professional development projects.

I you face any issue, feel free to leave a comment below.

Summary

  1. Sign commits or tags
  2. Key passphrase
  3. Disable signatures
  4. Renew a GPG key
@gustaflindqvist
gustaflindqvist / CameraAnchor.cs
Created August 1, 2021 19:20 — forked from fadookie/CameraAnchor.cs
Screen-relative anchoring component for Unity3D. Find more Unity code at http://www.eliotlash.com/2015/01/unity3d-components-and-code-snippets/
/***
* This script will anchor a GameObject to a relative screen position.
* This script is intended to be used with ViewportHandler.cs by Marcel Căşvan, available here: http://gamedev.stackexchange.com/a/89973/50623
* It is also copied in this gist below.
*
* Note: For performance reasons it's currently assumed that the game resolution will not change after the game starts.
* You could not make this assumption by periodically calling UpdateAnchor() in the Update() function or a coroutine, but is left as an exercise to the reader.
*/
/* The MIT License (MIT)
@gustaflindqvist
gustaflindqvist / rpi_unifi.md
Created April 16, 2018 20:06 — forked from kburdett/rpi_unifi.md
Install Ubiquiti's UniFi Controller on a Raspberry Pi

Compatibility

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.

Instructions

  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
gustaflindqvist / unifi-raspberry_pi-instructions.sh
Created January 28, 2018 14:25 — forked from bwbaugh/unifi-raspberry_pi-instructions.sh
Installing Ubiquiti UniFi Controller 5 on Raspberry Pi.
# Mirror of the instructions available here:
# http://www.lowefamily.com.au/2016/06/02/installing-ubiquiti-unifi-controller-5-on-raspberry-pi/
#
# 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
gustaflindqvist / container.js
Created November 21, 2017 15:36 — forked from ntkoso/container.js
Server side data fetching using 'redux-saga'
import { fork } from 'redux-saga';
import fetchEntitySaga from './fetchEntitySaga';
export default prefetch(
({ getState }) => {
if (needsFetching(getState())) {
return fork(fetchEntitySaga, getState, ...args);
}
}
)(Component);
@gustaflindqvist
gustaflindqvist / validator.js
Created November 13, 2017 15:19 — forked from emilbillberg/validator.js
Common Swedish validation in Javascript
/***************** 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
gustaflindqvist / jenkins.ec2.init.d
Created November 7, 2017 09:39 — forked from azam/jenkins.ec2.init.d
Startup script for the Jenkins Continuous Integration server for Amazon EC2 Linux (via jar execution)
#!/bin/sh
#
# 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/jenkins.pid
@gustaflindqvist
gustaflindqvist / gist:951fcbfb29818b64c866bddf424fe087
Created October 23, 2017 12:14 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
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