Skip to content

Instantly share code, notes, and snippets.

@nuxero
nuxero / customAmiBeanstalkUserParams
Created February 13, 2017 17:11
Custom parameters that have to be added to user parameters for beanstalk custom ami
#cloud-config
repo_releasever: repository version number
repo_upgrade: none
files:
"/tmp/45_nginx_https_rw.sh":
owner: root
group: root
mode: "000644"
content: |
#! /bin/bash
CONFIGURED=`grep -c "return 301 https" /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf`
@nuxero
nuxero / pagespeed_proxy_cache.config
Last active November 4, 2022 15:24
ebextension config file for pagespeed and proxy cache on nginx
files:
"/etc/nginx/pagespeed.conf":
owner: root
group: root
mode: "000644"
content: |
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
@nuxero
nuxero / pagespeed_varnish_cache.config
Last active February 24, 2017 16:37
ebextension for varnish cache + mod_pagespeed
files:
"/etc/nginx/pagespeed.conf":
owner: root
group: root
mode: "000644"
content: |
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
var AES = require('crypto-js/aes');
const password = process.env.PASSWORD;
function toHex(encrypted) {
var hex = "";
for (var i = 0; i < encrypted.length; i++) {
hex += encrypted.charCodeAt(i).toString(16)
}
return hex;
@nuxero
nuxero / bookmarklet
Last active September 25, 2017 16:47 — forked from haridsv/bookmarklet
Paste Enabler, remove attributes from form text fields that restrict copy and paste operations. Tested to be working on many financial websites, though on some it causes duplication (workaround: undo).
javascript:s=document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='https://goo.gl/ZKgsbZ';void(0);
@nuxero
nuxero / README.md
Created August 7, 2017 17:07 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@nuxero
nuxero / self-signed.sh
Last active June 5, 2020 17:03
A script for generate self signed certs
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
@nuxero
nuxero / node-ubuntu-upstart-service.md
Created November 4, 2017 13:29 — forked from willrstern/node-ubuntu-upstart-service.md
Run Node.js App as Ubuntu Upstart Service

###The Issue With Forever Forever is great for running node services, with a minor setback: the word "forever" doesn't apply to system reboots.

###The solution, run node apps as a system service logged in as root

vim /etc/init/node-app.conf

Contents for node-app.conf

@nuxero
nuxero / gist:914658220977f8e5279b1de912b4184a
Created November 28, 2017 17:29 — forked from Maarten-Wijnants/gist:ec4a3e9e65504e7e67a0873dca353871
Ubuntu 14.04 Asterisk server installation
https://www.odoo.com/apps/modules/8.0/crm_voip/
# Install asterisk server on Ubuntu 14.04
# 1. Install dependencies
sudo apt-get update
sudo apt-get install wget
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install ncurses-dev