This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script set ownership for all table, sequence and views for a given database | |
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\conf; | |
class App | |
{ | |
static $param = array( | |
// The hostname of the server | |
"host" => "", | |
// The hostname of the user module. Normally this is the same as the host above |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fork geocloud2 | |
Make a new file in /public/js/i18n/ named the locale code in the form "es_ES.js". | |
Copy the content from en_US.js to the new file. | |
Translate the right side. Don't touch the left side! | |
Give me a pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, csv | |
args =sys.argv | |
filesource = args[1] | |
with open(filesource, 'rb') as f: | |
reader = csv.reader(f, delimiter=';', quotechar='"') | |
for row in reader: | |
statement = "INSERT INTO " + args[2] + " " + \ | |
"(" +\ | |
"id," + \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dette API kald bliver lavet til trackanalyzer applikationen: | |
http://trackanalyzer.safetrack.dk/api/v1/unitsummary? | |
DateFrom=2014-01-01& | |
DateTo=2014-02-01& | |
Category=31014& | |
Client=& | |
Group=& | |
u=username& | |
token=123456 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avgRunOnAdmin og avgRunOnZone | |
Når http://trackanalyzer.safetrack.dk/api/v1/unitsummary kaldes laves en middeltidig table med dette schema: | |
Column | Type | Modifiers | |
----------+----------------------+----------- | |
gid | integer | | |
unitid | integer | | |
run1 | integer | | |
date | date | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bemærk at ES index og type starter IKKE med '_', da dette ikke er tilladt. | |
// Delete indekset (pt kan der ikke slettes types gennem wrapperen) | |
curl -X DELETE "http://172.30.1.162/api/v1/elasticsearch/delete/ballerup/17_undervisning" -d "key=01bca06ea1544d266d27a635abd88354" | |
// PUT et map som opretter index '17_undervisning' og type '17_00_skoler'. Bemærk indekset kommer til at hedde ballerup_17_undervisning i ES | |
curl -X PUT "http://172.30.1.162/api/v1/elasticsearch/map/ballerup/17_undervisning" -d 'key=01bca06ea1544d266d27a635abd88354&map= | |
{ | |
"mappings": { | |
"17_00_skoler" : { | |
"properties" : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE 'http://eu1.mapcentia.com/api/v1/elasticsearch/delete/dk/aws4' -d 'key=260013f0dd79cead7d630ea93ba5bced' | |
curl -X POST "http://eu1.mapcentia.com/api/v1/elasticsearch/create/dk/aws4" -d 'key=260013f0dd79cead7d630ea93ba5bced&map={ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"str_search_analyzer": { | |
"type" : "custom", | |
"tokenizer": "whitespace", | |
"filter": [ | |
"lowercase" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"settings": { | |
"number_of_shards": 5, | |
"number_of_replicas": 0, | |
"analysis": { | |
"analyzer": { | |
"auto_complete_search_analyzer": { | |
"type": "custom", | |
"tokenizer": "whitespace", | |
"filter": ["lowercase"] |
OlderNewer