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
sudo ln /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc /usr/local/bin/jsc
@parvez
parvez / console_colors.sh
Created March 29, 2012 11:19
Console Colors
LF="\n"; CR="\r"
INVT="\033[7m"; NORM="\033[0m"; BOLD="\033[1m"; BLINK="\033[5m"
#UNDR="\033[2m\033[4m"; EOL="\033[0K"; EOD="\033[0J"
UNDR="\033[4m"; EOL="\033[0K"; EOD="\033[0J"
SOD="\033[1;1f"; CUR_UP="\033[1A"; CUR_DN="\033[1B"; CUR_LEFT="\033[1D"
CUR_RIGHT="\033[1C"
#-- ANSI code
SCR_HOME="\033[0;0H" #-- Home of the display
@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
--- 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"
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