/etc/security/limits.conf
elasticsearch hard memlock 100000
/etc/default/elasticsearch
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| # Relevant example from our monitrc file. | |
| check process couchdb with pidfile /usr/local/var/run/couchdb/couchdb.pid | |
| start program = "/etc/init.d/couchdb start" | |
| stop program = "/etc/init.d/couchdb stop" | |
| if cpu > 60% for 2 cycles then alert | |
| if cpu > 80% for 5 cycles then restart | |
| if memory usage > 70% MB for 5 cycles then restart |
| //PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012 | |
| //UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler" | |
| //the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist | |
| (function(host) { | |
| function Crawler() { | |
| this.visitedURLs = {}; | |
| }; | |
| # | |
| # Sources: | |
| # http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites | |
| # http://codex.wordpress.org/Output_Compression | |
| # http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086 | |
| # http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/ | |
| # http://gtmetrix.com/configure-entity-tags-etags.html | |
| # http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014 | |
| # http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress | |
| # |
| @media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ } | |
| @media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ } | |
| @media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ } | |
| @media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ } | |
| @media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ } | |
| @media (min-width:1281px) { /* hi-res laptops and desktops */ } | |
| /* ----------- iPhone 4 and 4S ----------- */ | |
| /* Portrait and Landscape */ |
| # Plain Ol' Node | |
| node --max-old-space-size=1024 app.js # increase to 1gb | |
| node --max-old-space-size=2048 app.js # increase to 2gb | |
| node --max-old-space-size=3072 app.js # increase to 3gb | |
| node --max-old-space-size=4096 app.js # increase to 4gb | |
| node --max-old-space-size=5120 app.js # increase to 5gb | |
| node --max-old-space-size=6144 app.js # increase to 6gb | |
| # For pm2 | |
| pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb |
| var brwsr_guid = function() { | |
| var nav = window.navigator; | |
| var screen = window.screen; | |
| var guid = nav.mimeTypes.length; | |
| guid += nav.userAgent.replace(/\D+/g, ''); | |
| guid += nav.plugins.length; | |
| guid += screen.height || ''; | |
| guid += screen.width || ''; | |
| guid += screen.pixelDepth || ''; |
| #!/usr/bin/env bash | |
| set -e | |
| unset GIT_WORK_TREE | |
| export GIT_WORK_TREE="/var/www/example.com" | |
| export NODE_VERSION="8.9.3" | |
| export NODE_ENV=production | |
| # export NODE_PATH=/home/motif/bin/node |
| #!/bin/sh | |
| # https://martin.elwin.com/blog/2008/05/backups-with-squashfs-and-luks/ | |
| set -e | |
| SQUASHFS_IMG="$1" | |
| LUKS_IMG="$2" | |
| CRYPTNAME=mkcrypt-$RANDOM | |
| CRYPTDEV="/dev/mapper/$CRYPTNAME" |