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 ruby | |
| # | |
| # to run this, you'll need two gems: | |
| # gem install sinatra httparty | |
| # | |
| # run like this: | |
| # ruby server.rb | |
| # | |
| # go to http://localhost:4567/ and then after authorizing, you should get back /v1/projects JSON response | |
| # |
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 ruby | |
| # | |
| # Script to montior WAL lag in bytes between master and slave. | |
| # This script should be run from the slave. | |
| # | |
| require 'socket' | |
| require 'rubygems' | |
| require 'graphite-api' | |
| # configurables |
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
| t his is a test |
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
| /* | |
| * For historical reasons, the 64-bit LSN value is stored as two 32-bit | |
| * values. | |
| */ | |
| typedef struct | |
| { | |
| uint32 xlogid; /* high bits */ | |
| uint32 xrecoff; /* low bits */ | |
| } PageXLogRecPtr; |
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
| postgres=# select * from pg_current_xlog_location(); | |
| pg_current_xlog_location | |
| -------------------------- | |
| 6F/E3C53568 | |
| (1 row) |
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
| library(ggplot2) | |
| mouse <- read.csv("~/R/mouse.csv", sep=" ") | |
| # create plot | |
| p <- ggplot(mouse, aes(x=x,y=y)) | |
| p <- p + geom_point(aes(color = actual)) | |
| p <- p + ggtitle("Mouse data set") | |
| p <- p + xlim(c(0,1)) + ylim(c(0,1)) | |
| # now render it |