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
| 'use strict' | |
| global.state = { | |
| time: null, | |
| user: null, | |
| photo: null, | |
| book: null | |
| } | |
| const { getTime, getUser, getPhoto, getBook } = require('./promise_modules') |
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 http = require('http') | |
| let getData = (rand = 1) => { | |
| return new Promise((resolve, reject) => { | |
| try { | |
| let url = 'http://localhost:3000/db/products.count?v=' + rand |
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
| 'use strict' | |
| const assert = require('assert') | |
| module.exports = { | |
| getProductsCount: (req, res) => { | |
| return new Promise((resolve, reject) => { |
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 crypto = require('crypto'), https = require('https') | |
| // -------------------------------------------------------------------- | |
| let setString = (str = '') => { | |
| return new Promise((resolve, reject) => { | |
| let _name = str || 'John Doe'; |
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
| let getName = () => { | |
| return new Promise((resolve, reject) => { | |
| let name = "John Doe"; | |
| try { | |
| setTimeout (() => { | |
| resolve( name ) | |
| }, 1500) |
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/bash | |
| SENDGRID_API_KEY="" | |
| EMAIL_TO="" | |
| FROM_EMAIL="" | |
| FROM_NAME="" | |
| SUBJECT="" | |
| bodyHTML="<p>Email body goes here</p>" |
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/bash | |
| IPTABLES_CONF_FILE=/etc/rsyslog.d/iptables.conf | |
| echo ':msg, contains, ": IPTables Packet Dropped: " /var/log/iptables.log' > $IPTABLES_CONF_FILE | |
| echo ':msg, contains, ": IPTables Packet Dropped: " ~' >> $IPTABLES_CONF_FILE | |
| systemctl restart rsyslog | |
| # http://blog.stalkr.net/2009/10/logging-iptables-messages-with-rsyslog.html |
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/bash | |
| # http://serverfault.com/questions/410321/debian-ip6tables-rules-setup-for-ipv6/410327#410327 | |
| # http://ipset.netfilter.org/iptables.man.html | |
| # https://www.sixxs.net/wiki/IPv6_Firewalling | |
| # https://www.cyberciti.biz/faq/ip6tables-ipv6-firewall-for-linux/ | |
| # https://gist.github.com/thomasfr/9712418 | |
| # https://gist.github.com/SnakeDrak/f4150f6e517e5a1d525f | |
| # http://www.thegeekstuff.com/2011/06/iptables-rules-examples | |
| # http://www.thegeekstuff.com/scripts/iptables-rules |
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
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
| <launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> | |
| <listAttribute key="org.eclipse.debug.ui.favoriteGroups"> | |
| <listEntry value="org.eclipse.ui.externaltools.launchGroup"/> | |
| </listAttribute> | |
| <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> | |
| <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="D:\programs\nodejs\node.exe"/> | |
| <stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="${selected_resource_name}"/> | |
| <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${container_loc}"/> | |
| </launchConfiguration> |
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 https = require('https') | |
| const headers = { | |
| 'Authorization' : 'Basic YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhOmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==', | |
| 'Content-Type' : 'application/x-www-form-urlencoded' | |
| } | |
| const optionsget = { | |
| host : 'account.demandware.com', | |
| port : 443, |