- Don't run as root.
- For sessions, set
httpOnly(andsecuretotrueif running over SSL) when setting cookies. - Use the Helmet for secure headers: https://github.com/evilpacket/helmet
- Enable
csrffor preventing Cross-Site Request Forgery: http://expressjs.com/api.html#csrf - Don't use the deprecated
bodyParser()and only use multipart explicitly. To avoid multiparts vulnerability to 'temp file' bloat, use thedeferproperty andpipe()the multipart upload stream to the intended destination.
| var sys = require('sys'), | |
| YUI = require("yui3").YUI; | |
| YUI({ | |
| filter: 'debug', | |
| _logExclude: { | |
| 'attribute': true, | |
| 'base': true, | |
| 'get': true, | |
| 'loader': true, |
| #!/bin/sh | |
| IN=LVDS-0; | |
| setoff() { | |
| for display in `xrandr | awk '/ disconnected/ {print $1}'`; do | |
| echo "maybe disabling $display"; | |
| xrandr --output $display --off; | |
| done; | |
| } |
| #!/usr/bin/env bash | |
| # | |
| # This is sp, the command-line Spotify controller. It talks to a running | |
| # instance of the Spotify Linux client over dbus, providing an interface not | |
| # unlike mpc. | |
| # | |
| # Put differently, it allows you to control Spotify without leaving the comfort | |
| # of your command line, and without a custom client or Premium subscription. | |
| # |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/cznic/kv" | |
| "io" | |
| "os" | |
| ) | |
| func getBuf(n int) []byte { |
| 1. Copy ssh public key to rsync.net server: | |
| [jim@mb hbdev]$ scp ~/.ssh/id_rsa.pub [email protected]:.ssh/authorized_keys | |
| Password: | |
| id_rsa.pub | |
| 100% 392 0.4KB/s 00:00 | |
| 2. Create a local HashBackup backup directory: |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft,elem.offsetTop,elem.offsetWidth,elem.offsetHeight,elem.offsetParent
Prerequisites : the letsencrypt CLI tool
This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.
You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge.
Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.
I redirect all HTTP requests on HTTPS, so my nginx config looks like :
server {