Skip to content

Instantly share code, notes, and snippets.

@cyberalexca
cyberalexca / nginx.conf
Created May 15, 2019 13:20 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
#!/bin/bash
apt update
apt -y upgrade
apt -y autoremove
apt install -y git
curl https://releases.rancher.com/install-docker/17.12.sh | sh
curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
@cyberalexca
cyberalexca / enum-access.js
Created January 11, 2016 21:27 — forked from bnoguchi/enum-access.js
How to access enumValues in mongoose from a Model or Document
var mongoose = require('./index')
, TempSchema = new mongoose.Schema({
salutation: {type: String, enum: ['Mr.', 'Mrs.', 'Ms.']}
});
var Temp = mongoose.model('Temp', TempSchema);
console.log(Temp.schema.path('salutation').enumValues);
var temp = new Temp();
console.log(temp.schema.path('salutation').enumValues);
gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
gpg -a --export CD2EFD2A | apt-key add -
wget http://www.dotdeb.org/dotdeb.gpg -O- |apt-key add -
gpg --keyserver hkp://keys.gnupg.net --recv-keys ABF5BD827BD9BF62
gpg -a --export 7BD9BF62 | apt-key add -
@cyberalexca
cyberalexca / install_nodejs.sh
Created June 13, 2012 19:17
Node.j sfrom sources
#!/usr/bin/env bash
apt-get update
apt-get install git-core curl build-essential openssl libssl-dev
git clone https://github.com/joyent/node.git
cd node
git checkout v0.7.10
./configure
make
make install
node -v
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/usr/local
make
make install