Skip to content

Instantly share code, notes, and snippets.

Avatar

Glenn Plas gplv2

View GitHub Profile
@gplv2
gplv2 / AlfrescoMysql2Postgresql.txt
Created Oct 14, 2020 — forked from loftux/AlfrescoMysql2Postgresql.txt
Alfresco Mysql to Postgresql migration. This is a simple outline on how to migrate Alfresco from mysql to postgresql.
View AlfrescoMysql2Postgresql.txt
Prerequisite
One instance of Alfresco on mysql, one postgresl of exactly the same version (schema version).
Step 1. Dump database
mysqldump --port 3306 -u alfresco --password=alfloftux -h 127.0.0.1 --databases alfresco --skip-comments --skip-extended-insert --no-create-db --hex-blob --default-character-set=utf8 --skip-triggers --compact --no-create-info --skip-quote-names > mydump.sql
Step 2. Dump local Postgres schema
You can install a clean version of Alfresco to use as for schema dump
(need to insert command for dump here)
@gplv2
gplv2 / ErrorHandler.js
Created Jan 15, 2019 — forked from deanrather/ErrorHandler.js
NodeJS Error Handler
View ErrorHandler.js
process.on
(
'uncaughtException',
function (err)
{
var stack = err.stack;
var timeout = 1;
// print note to logger
logger.log("SERVER CRASHED!");
@gplv2
gplv2 / psql_useful_stat_queries.sql
Last active Dec 4, 2018 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
View psql_useful_stat_queries.sql
------------
-- Locks --
------------
SELECT
blocked_locks.pid AS blocked_pid,
blocked_activity.usename AS blocked_user,
blocking_locks.pid AS blocking_pid,
blocking_activity.usename AS blocking_user,
blocked_activity.query AS blocked_statement,
blocking_activity.query AS current_statement_in_blocking_process
@gplv2
gplv2 / read-access.sql
Created Oct 3, 2018 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
View read-access.sql
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@gplv2
gplv2 / csv2DaimlerGPX.py
Created Jul 16, 2018 — forked from pperle/csv2DaimlerGPX.py
convert CSV to DaimlerGPX (for SCDB)
View csv2DaimlerGPX.py
import csv
import glob
import os
# gpx layout from https://www.gps-data-team.com/convert/
gpx_header = '<?xml version="1.0" encoding="ISO-8859-2" standalone="no" ?><gpx:gpx creator="csv2DaimlerGPX" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gpx="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" xmlns:gpxd="http://www.daimler.com/DaimlerGPXExtensions/V2.4">'
gpx_entry = '<gpx:wpt lat="{lat}" lon="{lon}"><gpx:name>{name}</gpx:name><gpx:extensions><gpxd:WptExtension><gpxd:WptIconId IconId="16"></gpxd:WptIconId><gpxd:POICategory Cat="Speed Cameras"></gpxd:POICategory><gpxd:Activity Active="true" Level="warning" Unit="second" Value="15"></gpxd:Activity><gpxd:Presentation ShowOnMap="true"></gpxd:Presentation><gpxd:Address ISO="" Country="" State="" City="" CityCenter="" Street="" Street2="" HouseNo="" ZIP=""></gpxd:Address><gpxd:Phone Default=""></gpxd:Phone></gpxd:WptExtension></gpx:extensions></gpx:wp
@gplv2
gplv2 / haproxy.cfg
Last active Jul 11, 2018 — forked from arkady-emelyanov/haproxy.cfg
haproxy check: postgresql is master
View haproxy.cfg
# haproxy postgresql master check
#
# haproxy listen: 5432
# pg, instance #1 listen: 5432 (master node)
# pg, instance #2 listen: 5432 (replica node)
# external failover, promoting replica to master in case of failure
# passwordless auth for user web
# template1 database is accessible by user web
#
# haproxy will pass connection to postgresql master node:
@gplv2
gplv2 / overpass.geojson
Created Feb 1, 2018 — forked from anonymous/overpass.geojson
data exported by overpass turbo
View overpass.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gplv2
gplv2 / postgres_queries_and_commands.sql
Last active Jul 3, 2018 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- performance tools
-- https://www.vividcortex.com/resources/network-analyzer-for-postgresql
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (post 9.2)
@gplv2
gplv2 / downgrade.sh
Last active Jul 13, 2017 — forked from jcowley/downgrade.sh
Downgrade Apache + PHP on Ubuntu 14.04
View downgrade.sh
cat <<EOF >> /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu precise main restricted universe
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
EOF
apt-get update
apt-get remove \
apache2 \
@gplv2
gplv2 / appserver.nginx.conf
Created May 1, 2017 — forked from drefined/appserver.nginx.conf
Basic Nginx Gateway / App setup. DO NOT SIMPLY COPY PASTE WITHOUT UNDERSTANDING THE CONTENTS.
View appserver.nginx.conf
server {
# Listen on internal ports only. Do not expose this server directly.
listen 127.0.0.1:80;
listen 10.0.0.1:80; # Secure internal IP
# Hosts
server_name www.wieni.be;
# Root
You can’t perform that action at this time.