Instantly share code, notes, and snippets.

View update.20181121.log
This file has been truncated, but you can view the full file.
23:19:37 stopping lamassu-server
lamassu-server: stopped
lamassu-admin-server: stopped
23:19:37 archiving old lamassu-server installation located in /usr/lib/node_modules/lamassu-server
tar: Removing leading `/' from member names
removed '/usr/lib/node_modules/lamassu-server/todo.txt'
removed '/usr/lib/node_modules/lamassu-server/.jshintrc'
removed '/usr/lib/node_modules/lamassu-server/currencies.json'
removed '/usr/lib/node_modules/lamassu-server/data-notes.txt'
View update.20181121.log
04:11:06 stopping lamassu-server
lamassu-server: ERROR (not running)
lamassu-admin-server: ERROR (not running)
04:11:06 unlinking old /usr/local/bin/lamassu* executables
04:11:06 updating node
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
+ n@2.1.12
updated 1 package in 0.336s
04:11:08 version installed v10.13.0
04:11:08 updating lamassu-server#master
View install.log
02:50:15 Enabling swap file for install only...
Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)
no label, UUID=6d85a17f-26ae-4535-8444-ed542394032c
02:50:15 Updating system...
## Installing the NodeSource Node.js 8.x LTS Carbon repo...
## Populating apt-get cache...
View install.log
03:50:44 Enabling swap file for install only...
Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)
no label, UUID=b156c57e-8121-4823-b969-314343283932
03:50:44 Updating system...
## Installing the NodeSource Node.js 8.x LTS Carbon repo...
## Populating apt-get cache...
View README.md

Nginx + PHPfpm timeout test

Test the connection timeout by tweaking those parameters: fastcgi_read_timeout, request_terminate_timeout, set_time_limit.

  • If hitting the fastcgi_read_timeout setting, Nginx will terminate the HTTP connection with a HTTP 504
  • If hitting the request_terminate_timeout setting, PHPfpm will terminate the HTTP connection with a HTTP 502
  • If hitting the set_time_limit setting, PHP itself will terminate the HTTP connection with a HTTP 200
View kill_zombies.sh
kill $(ps -A -ostat,ppid | awk '/[zZ]/{print $2}')
View crawl_website.sh
# Simple as is
wget --recursive --page-requisites --convert-links www.libero.it
View ifexit.sh
# exit if a command fails
set -e
View send_email_with_attachment.sh
# Setup
apt-get install -y sharutils
# How to
f=image0001.png
uuencode $f `basename $f` | mail -s "see the attachment" root@example.com
View nginx_ssl_proxy.conf
#
# Nginx SSL Proxy
# @link https://gist.github.com/lidio601/aa97397f8cdb5f405ce770dde2fe3c2b
# @link https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins
#
# Redirect all HTTP requests to SSL
server {