Skip to content

Instantly share code, notes, and snippets.

syafiqfaiz /
Last active Jan 26, 2023
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
cderv / 00-New
Last active Jan 24, 2023
New computer setup
View 00-New
# installed by winget
winget install PowerShell-Preview
winget install git
git config --global "Christophe Dervieux"
git config --global
winget install rstudio
winget install vscode
winget install -e R
winget install Github.GithubDesktop
krishchow / controllerconfig.yaml
Last active Dec 15, 2022
Openshift Crossplane SecurityContext
View controllerconfig.yaml
kind: ControllerConfig
name: openshift-config
namespace: crossplane-system
securityContext: {}
podSecurityContext: {}
View btrfs-undelete
# btrfs-undelete
# Copyright (C) 2013 Jörg Walter <>
# This program is free software; you can redistribute it and/or modify it under
# the term of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or any later version.
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2