Skip to content

Instantly share code, notes, and snippets.

@pofider
pofider / nginx.conf
Created June 7, 2016 11:11
running jsreport on subpath behind nginx proxy
upstream jsreport {
# change port 8080 with the port you are running jsreport on
server 127.0.0.1:8080;
keepalive 15;
}
server {
listen 80;
# change my-domain.net with the host you run nginx on
@pofider
pofider / electron-script.js
Last active August 4, 2016 08:05
node js and electron IPC doesn't work on linux
process.send('I am ok')
process.exit(0);
@pofider
pofider / jsreport-script-sending-email.js
Created April 10, 2015 12:36
Send email notification using jsreport script
function afterRender(done) {
var SendGrid = require('sendgrid');
var sendgrid = new SendGrid('xxx', 'xxx');
sendgrid.send({
to: request.data.email, from: 'jan.blaha@hotmail.com', subject: request.template.name,
html: new Buffer(response.content).toString()
}, function(err, message) {
if (err)
done(err);
@pofider
pofider / 01-ebs.config
Created September 10, 2015 15:14
Attach EBS volume to amazon elastic beanstalk
# .ebextensions/01-ebs.config
commands:
01clear-if-unmounted:
command: if ! mount | grep /media/ebs_volume > /dev/nul; then rm -rf /media/ebs_volume; fi
02attach-volume:
command: aws ec2 attach-volume --region eu-central-1 --volume-id vol-ddb08e34 --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --device /dev/sdh
ignoreErrors: true
03wait:
command: sleep 10
04trymount: