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
FROM node:latest | |
WORKDIR /app | |
COPY ./index.js ./ | |
COPY ./package*.json ./ | |
RUN npm ci | |
EXPOSE 8080 | |
CMD ["npm", "start"] |
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
module.exports = function(pwd, extra) { | |
var forge = require("node-forge"); | |
forge.options.usePureJavaScript = true; | |
var EC = require('elliptic').ec; | |
return new Promise((resolve, reject) => { | |
var ec_p256 = new EC('p256'); | |
if (!pwd) |
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
FROM ubuntu:20.04 | |
ENV DEBIAN_FRONTEND=noninteractive | |
WORKDIR / | |
RUN apt update | |
RUN apt -y upgrade | |
RUN apt-get update |
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
if( tokenInHash ){ | |
// User has just been authenticated! | |
m.route( body, '/profile', routes.authenticated ) | |
} | |
else if( localToken ){ | |
// We already have a token, could still be valid | |
m.route( body, '/login', routes.waiting ) | |
validate( localToken ).then( | |
success => m.route( body, '/profile', routes.authenticated ), |
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
#!/usr/bin/env python | |
# WS server example that synchronizes state across clients | |
import asyncio | |
import json | |
import logging | |
import websockets | |
logging.basicConfig() |
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
# Zope Component Utilities are perfect for injecting up-to-date state/config from far away regions of your app | |
# To do so just don't __call__() the utility when you register it - register it as a method only but call it from your template | |
# Make sure to pass in your interface and utility function (zope.component.getUtility) to jinja - then profit! | |
'mytld.com':{ | |
'config':{ | |
'tld':'mytld.com', | |
'iface':IFWUtils, | |
'utilfunc':getUtility | |
} |
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
import mitogen.master | |
import mitogen.utils | |
import logging | |
broker = mitogen.master.Broker() | |
router = mitogen.master.Router(broker) | |
def my_first_function(): | |
try: | |
import socket |
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
- hosts: 127.0.0.1 | |
user: root | |
vars_files: | |
- vars.yml | |
tasks: | |
- name: Install required system packages. | |
apt: pkg={{item}} state=present update-cache=yes | |
with_items: system_packages | |
environment: | |
http_proxy: http://192.168.4.10:8080 |
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
{ | |
"builders":[{ | |
"type": "docker", | |
"image": "77fa34a8068f", | |
"pull": false, | |
"export_path": "image.tar" | |
}], | |
"provisioners":[ | |
{ | |
"type": "ansible-local", |
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
{ | |
"builders":[{ | |
"type": "docker", | |
"image": "ubuntu:14.04", | |
"export_path": "image.tar" | |
}], | |
"provisioners":[ | |
{ | |
"type": "shell", | |
"environment_vars": [ |
NewerOlder