This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export SWAP_SIZE=2G | |
sudo fallocate -l $SWAP_SIZE /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo bash -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export NODE_VERSION=8.10.0 | |
export NODE_DOWNLOAD_URL=https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.gz | |
wget "$NODE_DOWNLOAD_URL" -O node.tar.gz | |
tar -zxvf node.tar.gz | |
cd node-v$NODE_VERSION | |
./configure | |
make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PYTHON_VERSION=3.6.5 | |
export PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz | |
sudo apt update | |
sudo apt install --no-install-recommends -y \ | |
software-properties-common build-essential \ | |
libssl-dev libreadline-dev libbz2-dev libsqlite3-dev zlib1g-dev \ | |
python-minimal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* node-ws - pure Javascript WebSockets server | |
* Copyright Bradley Wright <brad@intranation.com> | |
*/ | |
// Use strict compilation rules - we're not animals | |
'use strict'; | |
var net = require('net'), | |
crypto = require('crypto'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_header X-Content-Type-Options "nosniff"; | |
add_header X-Frame-Options "SAMEORIGIN"; | |
add_header X-Download-Options "noopen"; | |
add_header X-XSS-Protection "1; mode=block"; | |
add_header Expect-CT "enforce; max-age=3600"; | |
add_header Referrer-Policy "origin-when-cross-origin"; | |
add_header Strict-Transport-Security "max-age=2592000; includeSubDomains"; | |
add_header Content-Security-Policy "default-src 'self'; script-src *; style-src *; font-src *; img-src *; child-src 'self'; connect-src *; sandbox allow-same-origin allow-forms allow-scripts; object-src 'self'; form-action 'self'; frame-ancestors 'none';"; | |
# ABOUT PLUBIC KEY PINS https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.0 | |
ports: | |
- 9200:9200 | |
- 9300:9300 | |
environment: | |
- "cluster.name=docker-cluster" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Rancher supported Docker version with Kubernetes support | |
curl https://releases.rancher.com/install-docker/17.03.sh | sh | |
# Stop all containers: | |
docker kill $(docker ps -q) | |
# Remove all containers | |
docker rm $(docker ps -a -q) | |
# Remove all docker images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#how to specify an ssh key to use when cloning a repo in Mac | |
ssh-agent bash -c 'ssh-add /Users/UR_USERNAME/.ssh/UR_PRIVATE_KEY; git clone git@DAS_GIT_URL' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// cURL obeys the RFCs as it should. Meaning that for a HTTP/1.1 backend if the POST size is above 1024 bytes | |
// cURL sends a 'Expect: 100-continue' header. The server acknowledges and sends back the '100' status code. | |
// cuRL then sends the request body. This is proper behaviour. Nginx supports this header. | |
// This allows to work around servers that do not support that header. | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); | |
// We're emptying the 'Expect' header, saying to the server: please accept the body right now. | |
// Read here: http://pilif.github.com/2007/02/the-return-of-except-100-continue/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Login as root | |
root@homestead:~# sudo -s | |
# Update Aptitude | |
root@homestead:~# apt-get update | |
# Install Java | |
root@homestead:~# apt-get install openjdk-7-jre-headless -y | |
# Download and install Elasticsearch Public Signing Key |