Skip to content

Instantly share code, notes, and snippets.

View ulve's full-sized avatar

Olov Johansson ulve

  • Future Ordering
  • Umeå
View GitHub Profile
@ulve
ulve / install_phoenix.sh
Last active February 1, 2021 19:21
Install Erlang/Elixir/Phoenix on a Raspberry Pi
#!/bin/bash
sudo apt-get update
sudo apt-get --assume-yes install wget
sudo apt-get --assume-yes install libssl-dev
sudo apt-get --assume-yes install ncurses-dev
sudo apt-get --assume-yes install m4
# erlang
wget http://erlang.org/download/otp_src_18.2.tar.gz
tar -xvzf otp_src_18.2.tar.gz
cd otp_src_18.2
@ulve
ulve / phoenixprodstart.sh
Created February 2, 2016 20:16
Run phoenix in production mode
MIX_ENV=prod mix compile.protocols
MIX_ENV=prod PORT=4001 elixir -pa _build/prod/consolidated -S mix phoenix.server
@ulve
ulve / remoteobserver.sh
Created February 2, 2016 20:19
Connect to remote phoenix node with observer
# On the phoenix node
# if production mode
MIX_ENV=prod PORT=4001 elixir --name phoenix@127.0.0.1 --cookie 123 --erl "-kernel inet_dist_listen_min 9001 inet_dist_listen_m 9001" -pa _build/prod/consolidated -S mix phoenix.server
# if debug mode
elixir --name phoenix@127.0.0.1 --cookie 123 --erl "-kernel inet_dist_listen_min 9001 inet_dist_listen_m 9001" -S mix phoenix.server
# On the observing node
# Terminal 1, start SSH tunnel
ssh -N -L 9001:localhost:9001 -L 4369:localhost:4369 pi@192.168.1.31
@ulve
ulve / du.ps1
Last active July 17, 2023 06:28
du-h in powershell
param([string]$Directory)
get-childitem $Directory |
% { $f = $_ ;
get-childitem -r $_.FullName |
measure-object -property length -sum |
select @{Name="Namn";Expression={$f}},@{Name="Sum (Mb)"; Expression={"{0:N1}" -f ($_.sum / 1MB)}}}
@ulve
ulve / reddit example.json
Created June 6, 2016 12:53
example of reddit comments
[
{
"kind": "Listing",
"data": {
"modhash": "",
"children": [
{
"kind": "t3",
"data": {
"domain": "engadget.com",
@ulve
ulve / reddit example.json
Created June 6, 2016 12:53
example of reddit comments
[
{
"kind": "Listing",
"data": {
"modhash": "",
"children": [
{
"kind": "t3",
"data": {
"domain": "engadget.com",

Keybase proof

I hereby claim:

  • I am ulve on github.
  • I am ulve (https://keybase.io/ulve) on keybase.
  • I have a public key whose fingerprint is 2DDB C99B 1110 AAB0 5FE7 23DD 9B9E 5784 633B 1F0A

To claim this, I am signing this object:

// @flow
import * as React from "react";
import * as Recompose from "recompose";
declare type HelloProps = {
compiler: string,
framework: string
};
const reducer = (state: ControllerState, action: Action): ControllerState => {
// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.
open FSharp.Data
open Microsoft.FSharp.Data.TypeProviders
open HttpFs.Client
open HttpFs
open Hopac
open Argu
open System
open System.Collections.Generic
@ulve
ulve / catamorph.ts
Last active January 24, 2020 13:36
Typescript catamorphism
interface Book {
kind: "book";
price: Number;
title: String;
}
interface Chocolate {
kind: "chocolate";
taste: String;
price: Number;