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 DHT = require("@hyperswarm/dht"); | |
var pump = require("pump"); | |
var fs = require("fs"); | |
const crypto = require("hypercore-crypto"); | |
//const keyPair = crypto.keyPair(); | |
(async () => { | |
const node = new DHT(); | |
const keyPair = DHT.keyPair(); | |
await node.ready(); | |
const hash = crypto.data(Buffer.from("test", "utf-8")); |
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 DHT = require("@hyperswarm/dht"); | |
const crypto = require('hypercore-crypto') | |
const node = new DHT({}); | |
module.exports = (key='')=>{ | |
return { | |
serve: (command, cb)=>{ | |
const keyPair = crypto.keyPair(crypto.data(Buffer.from(key+command))); | |
const server = node.createServer(); | |
server.on("connection", function(socket) { |
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 peerInfo = require('./lib/peer-info') | |
const peerQueue = require('./lib/queue') | |
const { EventEmitter } = require('events') | |
const network = require('@hyperswarm/network') | |
const MAX_SERVER_SOCKETS = Infinity | |
const MAX_CLIENT_SOCKETS = Infinity | |
const MAX_PEERS = 24 |
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
git clone https://github.com/Yahweasel/craig.git | |
cd craig | |
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - | |
apt update | |
apt-get install -y ffmpeg vorbis-tools opus-tools libfdk-aac-dev zip unzip imagemagick php-imagick curl nodejs npm | |
cd cook | |
for i in *.c; do gcc -O3 -o ${i%.c} $i; done | |
for i in *.svg; do inkscape -e ${i%.svg}.png $i; done | |
npm install |
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
sudo docker build --force-rm=true --tag="root/cloud9-docker:latest" | |
docker run -it -d -p 7999:80 -p 7998:3000 --link mongodb -v /store/files:/store/files -v /home/lanmower/dev/:/meteor/ -v /home/lanmower/workspace:/workspace root/cloud9-docker | |
docker run -it -d -p 7997:80 -p 7996:3000 --link mongodb -v /home/lanmower/hh:/workspace root/cloud9-docker |
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
self.addEventListener('push', showNotification); | |
function showNotification(event) { | |
console.log('Received a push message', event); | |
event.waitUntil( | |
event.target.registration.pushManager.getSubscription().then(function(subscription) { | |
console.log(subscription); | |
subscription.subscriptionId = subscription.endpoint.split('https://android.googleapis.com/gcm/send/')[1]; |
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 | |
set -x | |
PATH="$HOME/bin:$PATH" | |
apt-get update && apt-get -y upgrade | |
apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \ | |
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev \ | |
libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libmp3lame-dev wget checkinstall -y |
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 | |
APPNAME=<%= appName %> | |
APP_PATH=/opt/$APPNAME | |
BUNDLE_PATH=$APP_PATH/current | |
ENV_FILE=$APP_PATH/config/env.list | |
PORT=<%= port %> | |
# Remove previous version of the app, if exists | |
docker rm -f $APPNAME |
NewerOlder