Skip to content

Instantly share code, notes, and snippets.

server {
listen 80;
root /var/www/path-to-your-project;
index index.html index.htm;
server_name _ localhost;
location / {
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
@risyasin
risyasin / gist:11081243
Last active August 29, 2015 14:00
uncaughtException handling
process.on("uncaughtException", function (err) {
console.log(["uncaughtException", err]);
});
@risyasin
risyasin / gist:9a1b547d0db4cdf03420
Created July 26, 2014 09:59
Nginx php alongside nodejs
server {
listen 80;
root /var/www/path-to-your-project;
index index.html index.htm;
server_name _ localhost;
location / {
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
@risyasin
risyasin / homebrew.minidlna.plist
Last active August 29, 2015 14:16
homebrew minidlna launchctl
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.minidlna</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/minidlnad</string>
<string>-d</string>
@risyasin
risyasin / deluge.service
Last active August 29, 2015 14:16
Systemd Unit file as service for Deluge Web UI
[Unit]
Description=Deluge web if
[Service]
ExecStart=/usr/bin/deluge -u web
[Install]
WantedBy=multi-user.target
@risyasin
risyasin / deluged.service
Created March 7, 2015 01:20
Systemd Unit file as service for Deluge Daemon
[Unit]
Description=Deluge daemon
[Service]
Type=forking
ExecStart=/usr/bin/python /usr/bin/deluged --port=58846 --config=/root/.config/deluge
[Install]
WantedBy=multi-user.target
@risyasin
risyasin / sample-vhost.nginx
Last active August 29, 2015 14:16
Sample nginx vhost domain with php fw setup
server {
listen 80;
server_name {{@domain}};
root {{@root_path}};
location / {
error_page 404 /index.php;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php$is_args$query_string;
@risyasin
risyasin / Gulpfile.js
Created May 19, 2015 21:50
Gulp config with jshint, css/js minify, concat, livereload/browsersync, nodemon
"use strict";
var gulp = require('gulp'),
concat = require('gulp-concat'),
nodemon = require('gulp-nodemon'),
mincss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
jshint = require('gulp-jshint'),
head = require('gulp-header'),
bs = require('browser-sync').create(),
@risyasin
risyasin / nginx.conf
Last active August 29, 2015 14:22 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@risyasin
risyasin / gist:e9a88c2bd6e9bf45f161
Created June 11, 2015 09:28
sample domain-mail install
nano /etc/bind/named.conf.local
```
zone "evrima.net" {
type master;
file "/var/lib/bind/evrima.net.hosts";
allow-transfer {
127.0.0.1;