I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
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
/* | |
Replace "your_schema" with whatever schema is appropriate in your environment. | |
It is possible to use "public"... but you shouldn't! | |
*/ | |
/* | |
Function to stamp a "modified" timestamp. Adjust the name to suit your environment, | |
but that name is hard-coded so it is assumed that you only use _one_ such name. |
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 | |
####################################################################### | |
# This is a helper script that keeps snapraid parity info in sync with | |
# your data and optionally verifies the parity info. Here's how it works: | |
# 1) It first calls diff to figure out if the parity info is out of sync. | |
# 2) If parity info is out of sync, AND the number of deleted files exceed | |
# X (configurable), it triggers an alert email and stops. (In case of | |
# accidental deletions, you have the opportunity to recover them from | |
# the existing parity info) | |
# 3) If partiy info is out of sync, AND the number of deleted files exceed X |