Skip to content

Instantly share code, notes, and snippets.

View gplv2's full-sized avatar
😁

Glenn Plas gplv2

😁
View GitHub Profile
@gplv2
gplv2 / mysql2sqlite.sh
Created March 26, 2012 10:03 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@gplv2
gplv2 / httpd.conf_spiders
Created March 27, 2012 00:57
Apache bot control system, filter out spiders good and bad crawlers/ webspiders when they hit your server hard, like googlebot , bingbot. Block all them for specific places marked in the robots.txt to not visit (yet they do sometimes).
# To relieve servers
##Imagine a robots.txt file like this (Google understands this format):
#User-agent: *
#Disallow: /detailed
#Disallow: /?action=detailed
#Disallow: /*/detailed
#Crawl-delay: 20
##
@gplv2
gplv2 / .bash_logout
Created March 28, 2012 15:58 — forked from predominant/.bash_logout
Automatic operations on logout from a server
#!/bin/bash
##
## Commit configuration files.
##
if [ ! -d /etc/.git ]; then
cd /etc
git init
git config user.name "Server Administrator"
git config user.email "root@localhost"
@gplv2
gplv2 / mirrorOpenEMR_sf_git
Created April 24, 2012 14:50 — forked from bradymiller/mirrorOpenEMR_sf_git
Script to mirror the SF git repo to github, gitorious, bitbucket, assembla and google code
#!/bin/bash
#
# Copyright (C) 2010 Brady Miller <brady@sparmy.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
#
@gplv2
gplv2 / parkings.mapcss
Last active December 12, 2015 12:29
A more suitable complete version of the new parking features mapcss including parking aisles etc for JOSM
meta {
title: "new parking features";
description: 'Display the new parking features from "Proposed_features/parking" (see link).';
version: "1.0_2013-02-12";
author: "Glenn Plas";
link: "http://wiki.openstreetmap.org/wiki/Proposed_features/parking";
}
meta[lang=en] {
title: "New parking features";
@gplv2
gplv2 / appserver.nginx.conf
Created May 1, 2017 20:01 — forked from drefined/appserver.nginx.conf
Basic Nginx Gateway / App setup. DO NOT SIMPLY COPY PASTE WITHOUT UNDERSTANDING THE CONTENTS.
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
@gplv2
gplv2 / downgrade.sh
Last active July 13, 2017 16:46 — forked from jcowley/downgrade.sh
Downgrade Apache + PHP on Ubuntu 14.04
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 / postgres_queries_and_commands.sql
Last active July 3, 2018 11:44 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- 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 / overpass.geojson
Created February 1, 2018 11:00 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gplv2
gplv2 / haproxy.cfg
Last active July 11, 2018 21:44 — forked from arkady-emelyanov/haproxy.cfg
haproxy check: postgresql is master
# 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: