This file contains 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 fs = require('fs'); | |
const urls = fs.readFileSync('./resources.workable.com.csv').toString().split('\n'); | |
console.log('urls', urls) | |
const scrapeIt = require("scrape-it") | |
const out = []; | |
const loop = async( ) => { | |
for (let i=0; i<10;i++) { |
This file contains 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/bash | |
USER=manjeshpv | |
HOSTNAME=drive.manjeshpv.com | |
# using root user | |
apt update | |
apt upgrade | |
yum install nginx php7.0 php7.0-cli php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip-y |
This file contains 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 "Changing SELinux Settings" | |
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config | |
echo "Enabling SELinux Disabled config" | |
sestatus && chmod +x init.sh && ./init.sh |
This file contains 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
diff --git a/lib/models/links.js b/lib/models/links.js | |
index e7ce559..aabc9ab 100644 | |
--- a/lib/models/links.js | |
+++ b/lib/models/links.js | |
@@ -277,7 +277,7 @@ module.exports.updateLinks = (campaign, list, subscription, serviceUrl, message, | |
if (!campaign.openTrackingDisabled) { | |
let inserted = false; | |
let imgUrl = urllib.resolve(serviceUrl, util.format('/links/%s/%s/%s', campaign.cid, list.cid, encodeURIComponent(subscription.cid))); | |
- let img = '<img src="' + imgUrl + '" width="1" height="1" alt="mt">'; | |
+ let img = '<img src="' + imgUrl + '" width="1" height="1" alt="">'; |
This file contains 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 json2csv = (list, headers) => [headers] | |
.concat(list) | |
.map(row => Object | |
.values(row) | |
.join(',')) | |
.join('\n'); |
This file contains 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
{ | |
"name": "api", | |
"version": "0.0.1", | |
"main": "server/app.js", | |
"dependencies": { | |
}, | |
"devDependencies": { | |
"precommit-hook": "^3.0.0" | |
}, |
This file contains 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
// express.js | |
app.use((req, res, next) => { | |
req.v2 = req.get('version') === '2' | |
return next(); | |
}) | |
app.get('/securedapi', (req, res) => { | |
if(req.v2) | |
//new logic |
This file contains 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
/*** | |
* types | |
* - csv http stream -> db | pros: no space or memory usage but user need to wait and high db load on more concurrency | |
* - http csv stream -> temp file -> read stream -> db | cons: high db load on high concurrency | |
* - http csv stream -> temp file -> queue(read stream -> db) | highly robust | |
*/ | |
var http = require('http'), | |
path = require('path'), | |
os = require('os'), |
This file contains 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 | |
/sbin/modprobe nf_conntrack_ftp 2>&1 >/dev/null | |
IPTABLES='/sbin/iptables' | |
# policy | |
$IPTABLES -P INPUT DROP | |
$IPTABLES -P OUTPUT DROP | |
$IPTABLES -P FORWARD ACCEPT | |
$IPTABLES -F | |
$IPTABLES -X | |
$IPTABLES -Z |
This file contains 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 crypto = require('crypto'); | |
const hashedPass = crypto | |
.createHash('md5') | |
.update('manjesh') | |
.digest('hex'); | |
console.log(hashedPass); |