$ sudo install -o redis -g redis -d /var/lib/redis2
$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
| #!/bin/bash | |
| # compiled from https://docs.docker.com/engine/installation/linux/debian/#/debian-jessie-80-64-bit | |
| sudo apt-get update | |
| sudo apt-get dist-upgrade -y | |
| sudo apt-get install apt-transport-https ca-certificates -y | |
| sudo sh -c "echo deb https://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list" | |
| sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D |
| var child_process = require('child_process'); | |
| start(); | |
| function start(nodefile) { | |
| if (typeof start !== 'string') { | |
| console.log('Has none file. like this: start("app.js")'); | |
| } | |
| console.log('Master process is running.'); | |
| /* | |
| No jQuery necessary. | |
| Thanks to Dan's StackOverflow answer for this: | |
| http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport | |
| */ | |
| function isElementInViewport(el) { | |
| var rect = el.getBoundingClientRect(); | |
| return ( | |
| rect.top >= 0 && |
| source s_nginx_20 { pipe("/srv/logs/access.log" program_override("nginx-access-log")); }; | |
| source s_nginx_21 { pipe("/srv/logs/error.log" program_override("nginx-error-log")); }; | |
| filter f_nginx_20 { match("nginx-access-log" value("PROGRAM")); }; | |
| filter f_nginx_21 { match("nginx-error-log" value("PROGRAM")); }; | |
| destination d_remote { tcp("central.syslog", port(514)); }; | |
| log { source(s_nginx_20); filter(f_nginx_20); destination(d_messages); }; | |
| log { source(s_nginx_21); filter(f_nginx_21); destination(d_messages); }; |
| How to install and run Headless nightmare.js based scripts in Ubuntu. | |
| Steps: | |
| 1. Spin Ubuntu 16.04 x64 server | |
| 2. Run: apt-get update | |
| 3. Run: apt-get upgrade | |
| 4. Run: apt-get install -y libgtk2.0-0 libgconf-2-4 libasound2 libxtst6 libxss1 libnss3 xvfb | |
| 5. Install Node.js 6+. See: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions | |
| You can then run your script using this command: |
| import {Injectable,Inject,ElementRef, Renderer} from '@angular/core'; | |
| //import { DOCUMENT } from '@angular/platform/common_dom'; | |
| import {DOCUMENT} from '@angular/platform-browser'; | |
| @Injectable() | |
| export class SeoService { | |
| private _r: Renderer; | |
| private _el: ElementRef; | |
| private _document: any; | |
| /** |
| # update packages | |
| sudo apt-get update | |
| # install python and graphite dependencies | |
| sudo apt-get install -y python python-dev python-virtualenv libevent-dev python-pip python-cairo python-django-tagging python-twisted python-memcache python-pysqlite2 | |
| # install web server | |
| sudo apt-get install -y nginx uwsgi uwsgi-plugin-python | |
| # install postgresql and dependencies |
| Create sudo user with bash and homedir: | |
| useradd -m -d /home/testuser/ -s /bin/bash -G sudo testuser | |
| ######################################################### FILES | |
| Truncate file | |
| truncate -s 0 /var/log/syslog | |
| Find folders and set access for them: |
Easy to remember, easy to forget.
It's nice to be able to run subl in a terminal.