Skip to content

Instantly share code, notes, and snippets.

@pvnick
pvnick / zabbix-timescaledb-migration.sql
Last active September 13, 2023 12:19
Alternative method to migrate Zabbix history/trend tables to TimescaleDB with zero downtime.
/*
Migrate Zabbix history/trend tables to TimescaleDB with zero downtime.
Method: Create two new tables - a temp one which uses a trigger to duplicate new data coming in, and then a new table that
we bulk insert existing data into in compressed chunks. Once the bulk inserts are finished, we append the incoming data
that was received onto the new table and atomically swap the final result with the existing table.
This script only targets the history_uint table since it is usually the largest; however, this same code can be extended
to other history and trend tables.
*/
@pvnick
pvnick / gist:5753943
Created June 11, 2013 01:33
Gainesville Restore the Fourth description
The recent revelations regarding mass surveillance of American citizens have shocked the nation (http://www.guardian.co.uk/world/2013/jun/09/edward-snowden-nsa-whistleblower-surveillance). I for one cannot stand by idly as a bunch of faceless bureaucrats rip our Constitution and Bill of Rights to shreds.
This July 4th, outraged citizens across America will gather en masse to protest these unacceptable encroachments on our privacy (http://www.reddit.com/r/restorethefourth/comments/1fzr0e/list_of_all_restore_the_fourth_rallies_by_state/). Let's make sure Gainesville is duly represented!
Details
-------
For those who can make it, we will be meeting at 8:00 AM at westside park to organize and prepare our signs and wall painting. I will provide doughnuts and coffee for the early arrivers.
Throughout the early afternoon, starting at about noon, we will gather along the 34th Street Wall holding signs, banners, flags, etc. Behind us will be a large entry on the wall, "Restore The Fourth" (referring to our fourth