This file contains 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/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 |
This file contains 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 | |
## | |
## Commit configuration files. | |
## | |
if [ ! -d /etc/.git ]; then | |
cd /etc | |
git init | |
git config user.name "Server Administrator" | |
git config user.email "root@localhost" |
This file contains 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 | |
# | |
# Copyright (C) 2010 Brady Miller <[email protected]> | |
# | |
# 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. | |
# | |
# |
This file contains 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
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 |
This file contains 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
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 \ |
This file contains 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
-- 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) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# 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: |
This file contains 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
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 |
This file contains 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
-- 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; |
OlderNewer