This gist summarises a way to simulate point-in-time recovery (PITR) using WAL-G. Most of the material is adapted from Creston's tutorial.
First we initialize a database cluster
pg_ctl init -D cluster
from bs4 import BeautifulSoup | |
import requests | |
import datetime | |
import logging | |
import csv | |
def setLogger(): | |
logging.basicConfig(level=logging.INFO, | |
format='%(asctime)s - %(levelname)s - %(message)s', | |
filename='logs_file', |
import numpy as np | |
import pandas as pd | |
#### creating dataframes, adding and dropping columns | |
df = pd.DataFrame(np.arange(1,10).reshape(3,3),['A','B','C'],['w','x','y']) | |
df.columns = ['W','X','Y'] # change column names | |
df['Z']=df['X']+df['Y'] # new column with values X+Y | |
df['XX']=df.apply(lambda row: row['X']*2, axis=1) # new column with values twice of column X | |
df['YY']=1 # new column of ones |
#!/bin/bash | |
for filename in *.xlsm; do | |
cp "$filename" "backup/$(basename "$filename" .xlsm) $(date +'%Y%m%d%H%M%S').xlsm" | |
done |
// this is a file that puts together all redigo examples for convenience | |
// (see https://godoc.org/github.com/gomodule/redigo/redis#pkg-examples) | |
// | |
// start by ensuring that redis is running on port 6379 (`redis-server`) | |
// uncomment the main method as needed, and run the script (`go run main.go`) | |
package main | |
import ( | |
"fmt" | |
"github.com/gomodule/redigo/redis" |
class TreeNode: | |
def __init__(self, val): | |
self.val = val | |
self.left = None | |
self.right = None | |
def buildTree(arr): | |
nodes = [TreeNode(val) for val in arr] | |
for i in range(len(nodes)): | |
left, right = (i+1)*2-1, (i+1)*2 |
package join | |
import ( | |
"fmt" | |
"strings" | |
"testing" | |
) | |
var ( | |
testData = []string{"a", "b", "c", "d", "e"} |
This gist summarises a way to simulate point-in-time recovery (PITR) using WAL-G. Most of the material is adapted from Creston's tutorial.
First we initialize a database cluster
pg_ctl init -D cluster
This gist summarises a way to create corrupted databases. Most of the material is adapted from Luca's Article.
Create and start the server with data checksums enabled
initdb -k -D cluster
This is a sample program that tests output on a panicking go program based on different GOTRACEBACK
settings. There are several levels that control the amount of output generated - none
, single
, all
, system
- each with it's own aliases. More information can be found at https://golang.org/pkg/runtime/.
env GOTRACEBACK=none go run main.go
This should give the same output as env GOTRACEBACK=0 go run main.go
panic: f3
exit status 2