Skip to content

Instantly share code, notes, and snippets.

@OliverZ
OliverZ / index.js
Created March 26, 2019 21:56 — forked from graphicbeacon/index.js
How to handle the POST request body without using a framework
const http = require('http');
const { parse } = require('querystring');
const server = http.createServer((req, res) => {
if (req.method === 'POST') {
collectRequestData(req, result => {
console.log(result);
res.end(`Parsed data belonging to ${result.fname}`);
});
}
@OliverZ
OliverZ / mbuffer.sh
Created March 26, 2014 18:46
install mbuffer from source under smartos
pkgin in gcc47
pkgin in gmake
wget http://www.maier-komor.de/software/mbuffer/mbuffer-20140310.tgz
gtar -xzvf mbuffer-20140310.tgz
cd mbuffer-20140310
./configure --prefix=/usr/local --disable-debug CFLAGS="-O -m64"
MAKE=gmake
gmake && gmake install
@OliverZ
OliverZ / cmd-command.js
Created July 11, 2013 14:15
execute command on cmd from nodejs
var exec = require('child_process').exec;
var child;
var cmdCommand = "dir";
child = exec(cmdCommand, function (error, stdout, stderr) {
console.log('stdout:\n' + stdout);
console.error('stderr:\n' + stderr);
if (error !== null) {
console.error('exec error: ' + error);
}
@OliverZ
OliverZ / chefserver
Created May 6, 2013 10:45
Install chefserver behind firewall
npm install -g lactate
@OliverZ
OliverZ / AddPublicKey.sh
Created March 29, 2013 15:12
writes the public key in authorized_keys for login to SmartOS Globalzone put in: /opt/AddPublicKey.sh execute with: sh AddPublicKey.sh
#!/bin/bash
mkdir /root/.ssh
touch /root/.ssh/authorized_keys
echo <public key> >> /root/.ssh/authorized_keys
@OliverZ
OliverZ / gitlab-installer.sh
Last active December 15, 2015 13:18 — forked from blind-coder/gist:4948038
under construction from line 156
# Install necessary packages
pkgin up
pkgin -y install \
bash \
coreutils \
curl \
gcc47 \
# gcc47-runtime \
gmake \
icu \