Skip to content

Instantly share code, notes, and snippets.

View parvez's full-sized avatar
🦊
🚫 Chrome ❤️ Firefox

Parvez parvez

🦊
🚫 Chrome ❤️ Firefox
View GitHub Profile
import os
from datetime import datetime
from ring_doorbell import Ring
scan_folder = '/ring/files/Ring/'
uploads_folder = '/path/to/nextcloud/data/ring/files/Ring/'
done_list_file = '/path/to/nextcloud/data/ring/files/Ring/done.txt'
info_file = '/path/to/nextcloud/data/ring/files/Ring/info.txt'
nc_info_file = '/ring/files/Ring/info.txt'
You can try netstat
netstat -vanp tcp | grep 3000
For macOS El Capitan and newer (or if your netstat doesn't support -p), use lsof
sudo lsof -i tcp:3000
@parvez
parvez / sniff.js
Created October 30, 2017 22:25
Sniff NodeJS
app.use((req, res, next) => {
try {
var sniff_data = {}
sniff_data.host = req.headers && req.headers.host
sniff_data.url = req.url
sniff_data.method = req.method
sniff_data.user_agent = req.headers && req.headers['user-agent']
sniff_data.ip_address = {}
if (req.connection && req.connection.socket && req.connection.socket.remoteAddress) {

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
db.dropAllUsers()
db.createUser( { user: "app_admin", pwd: "SECRET_PASSWORD", roles: [ { role: "userAdmin", db: "my_app" }, { role: "dbAdmin", db: "my_app" }, { role: "dbOwner", db: "my_app" } ] } )
db.createUser( { user: "app_reporting", pwd: "SECRET_PASSWORD", roles: [ { role: "read", db: "my_app" } ] } )
db.dropAllUsers()
db.createUser( { user: "root", pwd: "SECRET_PASSWORD", roles: [ "root", "userAdminAnyDatabase", "dbOwner" ] } )
# security Options
security:
authorization: enabled
--- init.d-mongod
+++ patched.init.d-mongod
@@ -11,22 +11,26 @@
# NOTE: if you change any OPTIONS here, you get what you pay for:
# this script assumes all options are in the config file.
-CONFIGFILE="/etc/mongod.conf"
-OPTIONS=" -f $CONFIGFILE"
+CONFIGFILE_AUTH="/etc/mongodb/auth.conf"
+CONFIGFILE_NOAUTH="/etc/mongodb/noauth.conf"

Keybase proof

I hereby claim:

  • I am parvez on github.
  • I am parvez (https://keybase.io/parvez) on keybase.
  • I have a public key whose fingerprint is 1E0D 8EEB 4C89 6D7E 22A8 DB4A 2434 6FE8 49D6 4BD8

To claim this, I am signing this object:

== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.