Skip to content

Instantly share code, notes, and snippets.

View thinmy's full-sized avatar
🎯
Focusing

Thinmy Patrick Alves thinmy

🎯
Focusing
View GitHub Profile
@thinmy
thinmy / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

docker-youtrack

Bitdeli Badge

Easy youtrack deployment using docker

These Dockerfiles allow you to easily build images to deploy your own youtrack instance. It's free for up to ten users.

Disclaimer

Besides that, as always, use these scripts with care.

@thinmy
thinmy / install-redis.sh
Created June 2, 2016 01:50 — forked from dstroot/install-redis.sh
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
# 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
@thinmy
thinmy / gist:f1618df687c906d83303e5309c82c483
Created September 19, 2016 19:17 — forked from perusio/gist:1724301
Workaround in PHP cURL for the 100-continue expectation
<?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/
@thinmy
thinmy / git-specify-ssh-key
Created February 25, 2018 20:51 — forked from gskielian/git-specify-ssh-key
Specifying SSH Key within Git Clone
#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'
# 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
@thinmy
thinmy / gist:3f9f048dacae031456de93a1389f1489
Created September 9, 2018 10:26
Docker Swarm Elasticsearch + Kibana with nginx-proxy
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.0
ports:
- 9200:9200
- 9300:9300
environment:
- "cluster.name=docker-cluster"
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
@thinmy
thinmy / websockets-server.js
Created October 9, 2018 10:50
Pure Node.js WebSockets server
/*
* 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');