Skip to content

Instantly share code, notes, and snippets.

@porjo
porjo / fedora21_wayland.md
Created November 5, 2014 09:27
Testing Wayland on Fedora 21 Live CD

Wayland on Fedora21 Live CD

Gnome does not use Wayland by default when the Live CD boots up. To use Wayland, do the following:

  • set a password on the user account e.g. open terminal and issue passwd
  • log out of Gnome
  • below the login prompt should be a small cog icon, click that and select Gnome on Wayland from the dropdown menu
  • login
@porjo
porjo / Postgres_Centos_Dockerfile
Last active August 29, 2015 14:09
Postgresql 9.3 on Centos7, Dockerfile
FROM centos:centos7
RUN yum update -y
RUN yum install -y http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm http://fedora.mirror.serversaustralia.com.au/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
RUN yum install -y postgresql93-server postgis2_93 sudo
RUN /usr/pgsql-9.3/bin/postgresql93-setup initdb
# Adjust PostgreSQL configuration so that remote connections to the
# database are possible.
RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/pgsql/9.3/data/pg_hba.conf
@porjo
porjo / jenkins_build.md
Last active August 29, 2015 14:11
jenkins build

Root user

    1  iptables -nvxL
    3  systemctl stop firewalld
    4  systemctl disable firewalld
    8  yum install iptables-services.x86_64
    9  systemctl enable iptables.service
   11  systemctl start iptables.service
   13  yum install -y http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
@porjo
porjo / pdnscontrol_Dockerfile
Last active August 29, 2015 14:12
pdnscontrol Dockerfile
FROM centos:centos7
RUN yum makecache
RUN yum update -y
RUN yum install -y git gcc postgresql-devel python-devel python-virtualenv openssl-devel
# We need newer mariadb-devel package due to this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1166603
RUN yum install -y http://mirror.aarnet.edu.au/pub/MariaDB/mariadb-5.5.41/yum/centos7-amd64/rpms/MariaDB-5.5.41-centos7_0-x86_64-devel.rpm http://mirror.aarnet.edu.au/pub/MariaDB/mariadb-5.5.41/yum/centos7-amd64/rpms/MariaDB-5.5.41-centos7_0-x86_64-common.rpm
@porjo
porjo / docker_ipv6.md
Last active August 29, 2015 14:22
Docker IPv6

Docker IPv6

The scenario is where the ISP assigns a /104 IPv6 network 'on link' (i.e. not routed): xxxx:yyyy:1::9c3:0:0/104

Configure Linux host

Add the following to /etc/sysctl.conf:

# Accept Router Advertisements even if forwarding is enabled.
net.ipv6.conf.eth0.accept_ra = 2
@porjo
porjo / overpass.sh
Created June 20, 2014 04:05
osm overpass api - command line usage
# The following outputs .osm format suitable for JOSM (note 'out meta')
wget "http://www.overpass-api.de/api/interpreter?data=[out:xml];(way[name~\"[rR]ememberance\"];node[name~\"[rR]ememberance\"];relation[name~\"[rR]ememberance\"];);(._;>;);out meta;" -O remember.osm
@porjo
porjo / tasks.go
Last active December 23, 2015 14:29
Launch tasks and wait for finish
//
// Example thanks to DMorsing on #go-nuts Freenode channel
// http://play.golang.org/p/dmUfGKnbZ3
//
package main
import "fmt"
import "time"
import "math/rand"
import "sync"
@porjo
porjo / ec2_list.sh
Created April 7, 2016 05:19
One liner to generate a list of EC2 instance names + instance type. Uses AWS CLI tools + jq
aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | [(.Tags[] | select(.Key=="Name") | .Value), .InstanceType] | @csv'
@porjo
porjo / tc.sh
Created November 5, 2015 11:18
Traffic control script for OpenWRT. Works on 15.05
#!/bin/sh
# Source: https://github.com/klacke/tc-shaper/blob/master/tc-shaper.sh
set -x
TC=$(which tc)
DEV=pppoe-wan
RATEUP=700
# Clear
@porjo
porjo / Dockerfile
Last active July 17, 2016 22:47
Tilemill Dockerfile
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install nodejs-legacy npm git libgtk2.0-dev libwebkitgtk-dev protobuf-compiler libprotobuf-dev libprotobuf-lite9v5
RUN git clone https://github.com/mapbox/tilemill.git
WORKDIR /tilemill
RUN npm install
RUN echo '{"server":true,"listenHost": "0.0.0.0"}' > /etc/tilemillconfig.json