Skip to content

Instantly share code, notes, and snippets.

View lucydjo's full-sized avatar
🎯
Focusing

LucyDjo lucydjo

🎯
Focusing
  • paris
View GitHub Profile
iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 27017 -j DROP
iptables -I INPUT -p tcp -s 127.0.0.1 --dport 27017 -j ACCEPT
iptables -I INPUT -p tcp -s <IP GOES HERE> --dport 27017 -j ACCEPT
iptables-save > /etc/iptables.conf # Save this changes to file
touch /etc/network/if-up.d/iptables # Create file to call conf from
echo "iptables-restore < /etc/iptables.conf" >> /etc/network/if-up.d/iptables # Add this line to this file
chmod +x /etc/network/if-up.d/iptables # Make the script executable
@lucydjo
lucydjo / index.js
Created October 14, 2019 14:39 — forked from ch0mper/index.js
const brain = require('brain.js');
let trainedNet;
function encode(arg) {
return arg.split('').map(x => (x.charCodeAt(0) / 255));
}
function processTrainingData(data) {
return data.map(d => {