Skip to content

Instantly share code, notes, and snippets.

View bernardbr's full-sized avatar
🤓
I may be slow to respond.

Bernardo Esbérard bernardbr

🤓
I may be slow to respond.
View GitHub Profile
@bernardbr
bernardbr / update-all.ps1
Created November 14, 2023 19:29
Update all folders as a git repository
$rootFolder = "."
function GitPullSubfolders($folderPath) {
Get-ChildItem -Path $folderPath -Directory | ForEach-Object {
$subfolderPath = $_.FullName
$gitFolderPath = Join-Path -Path $subfolderPath -ChildPath ".git"
if (Test-Path $gitFolderPath) {
Write-Host "Executing 'git pull' in $subfolderPath"
Set-Location -Path $subfolderPath
& git pull
@bernardbr
bernardbr / how-to-restore-mongo-database-gz.md
Last active August 8, 2021 16:49
Backup & Restore MongoDb

Restore from gz file

mongorestore --gzip --archive=<filename>.gz --db "<database_name>" --host=localhost:27017 --username=<user_name> --password=<password> --authenticationDatabase=admin

Backup into gz file

mongodump --gzip --archive=.gz --db "" --host=localhost:27017 --username= --password= --authenticationDatabase=admin