Skip to content

Instantly share code, notes, and snippets.

View mapcentia's full-sized avatar

Martin Høgh mapcentia

View GitHub Profile
# systemd script for starting and stopping GC2 Docker containers.
# The start.sh script stays in the foreground and will exit if a container stops.
# If start.sh exits systemd will run the start.sh again and keep containers running.
# How to install
# Edit and put this content in /etc/systemd/system/gc2.service
# systemctl enable gc2
# GC2 containers can be started/stopped by these cmds
# service gc2 start
module.exports = {
backend: "gc2",
gc2: {
host: "http://cowi.mapcentia.com"
},
print: {
templates: {
"print": {
A4: {
l: {
<?php
ini_set("display_errors", "On");
header("Content-type: text/plain");
require_once('/var/www/geocloud2/app/libs/vendor/autoload.php');
use Postmark\PostmarkClient;
use Postmark\Models\PostmarkException;
try {
$client = new PostmarkClient("<my token>");
sudo su
apt-get update
apt-get install ppp usb-modeswitch wvdial
# Sæt modemet i usb porten
lsusb
# Du skal se:
# 12d1:14fe Huawei Technologies Co., Ltd.
# 14fe betyder at den er i storing mode, dvs. at den fungerer som en usb memory-stick
@mapcentia
mapcentia / gist:36c56b6a91c19214aeb3
Created March 20, 2016 18:58
A MapCache grid file
<grid name="25832">
<metadata>
<title>Dansk UMT</title>
</metadata>
<extent>120000 5900000 1000000 6500000</extent>
<srs>EPSG:25832</srs>
<srsalias>EPSG:25832</srsalias>
<units>m</units>
<size>256 256</size>
<resolutions>1638.4 819.2 409.6 204.8 102.4 51.2 25.6 12.8 6.4 3.2 1.6 0.8 0.4 0.2 0.1</resolutions>
@mapcentia
mapcentia / gist:3c753a0068bb013b908a
Created March 11, 2016 12:32
Python script for shipping Kismet logs to GC2
import sys, re, urllib, urllib2
args =sys.argv
filesource = args[1]
apikey = args[2]
list = [];
networks = {};
try:
f = open('count','r+')
except:
w = open('count','w')
@mapcentia
mapcentia / gist:1f2d8a6b4369beb1c930
Last active August 6, 2021 06:15
Install Ubertooth and Kismet on Raspbian
#!/bin/bash
#Install build tools and dependencies
apt-get -y update
apt-get -y install cmake libusb-1.0-0-dev make gcc g++ libbluetooth-dev libncurses5-dev libnl-dev \
pkg-config libpcap-dev python-numpy python-pyside python-qt4
#Get and build libbtbb
cd ~
wget https://github.com/greatscottgadgets/libbtbb/archive/2015-10-R1.tar.gz -O libbtbb-2015-10-R1.tar.gz
@mapcentia
mapcentia / gist:baca0ff9461b064b963a
Last active April 19, 2016 12:27
GC2 Docker, all
Moved to https://github.com/mapcentia/geocloud2/wiki/Install-GC2
@mapcentia
mapcentia / gist:d4a3893649e12100549f
Last active October 19, 2018 10:23
Example of settings in /var/www/geocloud2/app/conf/elasticsearch_settings.json
{
"settings": {
"number_of_shards": 5,
"number_of_replicas": 0,
"analysis": {
"analyzer": {
"auto_complete_search_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": ["lowercase"]
# Start med at installere Docker
sudo wget -qO- https://get.docker.com/ | sh
# Stop den Elasticsearch, som kører på Vm'et
sudo service elasticsearch stop
# Kør Docker containeren (det tager lige nogle sekunder før alle services er oppe)
sudo docker run -it --rm -p 9200:9200 -p 5601:5601 -v /var/log:/logs gc2logstash
# Kald nogle sider i GC2 og tjek om loggen bliver indekseret.