-i - ignore errors
-c - continue
-t - use video title as file name
--extract-audio - extract audio track
| # This is just a cheat sheet: | |
| # On production | |
| sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
| # On local | |
| scp -C production:~/database.sql.gz | |
| dropdb database && createdb database | |
| gunzip < database.sql.gz | psql database |
| #!/bin/bash | |
| # Copyright © 2017 Google Inc. | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |
| # | |
| # Wide-open CORS config for nginx | |
| # | |
| location / { | |
| if ($request_method = 'OPTIONS') { | |
| add_header 'Access-Control-Allow-Origin' '*'; | |
| # |
| # Dump | |
| #!/usr/bin/env bash | |
| container=`docker ps | awk '/database/ { print $1 }'` | |
| echo "Dumping data from ${container}" | |
| sudo docker exec -t -u postgres "${container}" pg_dumpall -c -U postgres -l databasename | gzip > dump_`date +%d-%m-%Y"_"%H_%M_%S`.tar.gz | |
| echo "Done!" | |
| # Restore | |
| #!/usr/bin/env bash |
| DUMP | |
| // pod-name name of the postgres pod | |
| // postgres-user database user that is able to access the database | |
| // database-name name of the database | |
| kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql | |
| RESTORE | |
| // pod-name name of the postgres pod | |
| // postgres-user database user that is able to access the database | |
| // database-name name of the database |
Command Flags
| Flag | Options | Description |
|---|---|---|
-codec:a |
libfaac, libfdk_aac, libvorbis | Audio Codec |
-quality |
best, good, realtime | Video Quality |
-b:a |
128k, 192k, 256k, 320k | Audio Bitrate |
-codec:v |
mpeg4, libx264, libvpx-vp9 | Video Codec |
| docker rmi $(docker images -q -f dangling=true) |
| psql -U user -d database_name -f sql_dump.sql |
| pg_dump -U user --column-inserts --data-only --table=table_name > table_name.sql |