Skip to content

Instantly share code, notes, and snippets.

View mandeepbal's full-sized avatar
🔥
🔥

Mandeep Bal mandeepbal

🔥
🔥
View GitHub Profile
@mandeepbal
mandeepbal / how-to-restore.md
Created May 24, 2022 05:03 — forked from AmazingTurtle/how-to-restore.md
restore access to unifi controller

Restore access to a unifi controller

When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.

Warning

Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.

Steps

dash_id=xxxx
api_key=xxx
app_key=xxx
# 1. export
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json
# 2. edit dash.json
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level
@mandeepbal
mandeepbal / gist:d0c0a23e4707d2da9a75
Last active August 31, 2015 03:55 — forked from garnaat/gist:5154370
Configure a internet-connected VPC from scratch
import boto.vpc
import time
REGION_NAME = 'us-west-2'
AMI_ID = 'ami-8e27adbe' # Amazon Linux AMI
conn = boto.vpc.connect_to_region(REGION_NAME)
# Create a VPC
vpc = conn.create_vpc('10.0.0.0/16')