Skip to content

Instantly share code, notes, and snippets.

@lcamilo15
lcamilo15 / .env.DEV.enc
Created February 26, 2024 05:11 — forked from psenger/.env.DEV.enc
[OpenSSL Encrypted Environment Variables] #OpenSSL #TravisCi #CodeShip #AWS #Docker #Swarm
U2FsdGVkX18bL0goCbiTjHFGnkwWagZSYjhvkaU1hXA=
@lcamilo15
lcamilo15 / gist:2cf68ce349ce24f9951aee9b69086af8
Created June 4, 2019 18:16 — forked from deviantony/gist:ddb93425dc6f011c4d8b
SH entrypoint for docker-compose to manage dependency startup.
#!/usr/bin/env sh
# Wait for a HTTP service to be OK (return code 200) before trying to start another service.
echo "Stalling for SERVICE"
while true; do
status=$(curl --write-out %{http_code} --silent --output /dev/null http://service.domain/endpoint)
echo "Status: ${status}"
if [ "${status}" == "200" ]; then
break
else
@lcamilo15
lcamilo15 / android-sonar.gradle
Created March 29, 2018 17:57 — forked from mjdetullio/android-sonar.gradle
Configuring Android project for SonarQube
import com.android.build.gradle.AppPlugin
task consolidateJunitXml {
description 'Copies JUnit XML reports into a single directory so SonarQube can import them all'
doLast {
def dest = file("${buildDir}/allJunit")
delete dest
copy {
from "${buildDir}/test-results/debug"
into dest
@lcamilo15
lcamilo15 / docker-compose.yml
Created March 21, 2018 17:44 — forked from huksley/docker-compose.yml
Launches fully configured Graylog 2.3.1 instance
#
# Launches configured Graylog 2.3.1 instance
#
# - Docker-compose 1.16 required
# - Please configure following according to your network:
# * gelf-address URL (for each container)
# * GRAYLOG_WEB_ENDPOINT_URI
# - After launch define GELF tcp and GELF udp inputs in graylog web ui
# - Containers send logging to the graylog itself
# - By default tuned to 30 days retention
@lcamilo15
lcamilo15 / HttpsFilter.java
Created February 27, 2018 02:13 — forked from qerub/HttpsFilter.java
Servlet filter for forcing HTTPS when behind a SSL termination proxy that sends X-Forwarded-Proto
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import static java.lang.String.format;
public class HttpsFilter implements Filter {
@lcamilo15
lcamilo15 / disable_vim_auto_visual_on_mouse.txt
Created January 5, 2018 01:50 — forked from u0d7i/disable_vim_auto_visual_on_mouse.txt
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
@lcamilo15
lcamilo15 / agnoster.zsh-theme
Created October 4, 2017 02:32
zsh Theme update for showing git group: themes/agnoster.zsh-theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@lcamilo15
lcamilo15 / fix_network.sh
Created October 3, 2017 16:39
docker-error-response-from-daemon-service-endpoint-with-name
declare -a NODE_NAMES=("node_01", "node_02");
declare -a CONTAINER_NAMES=("container_a", "container_b");
declare -a NETWORK_NAMES=("network_1", "network_2");
for x in "${NODE_NAMES[@]}"; do;
docker-machine env $x;
eval $(docker-machine env $x)
for CONTAINER_NAME in "${CONTAINER_NAMES[@]}"; do;
for NETWORK_NAME in "${NETWORK_NAMES[@]}"; do;
echo "Disconnecting $CONTAINER_NAME from $NETWORK_NAME"
@lcamilo15
lcamilo15 / install-comodo-ssl-cert-for-nginx.rst
Created September 27, 2017 01:33 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@lcamilo15
lcamilo15 / gist:0ca9e9757f16cf275ecf3e1bdf2ca715
Created August 31, 2017 06:55 — forked from briandealwis/gist:782862
One-liner to turn jar with Main-Class into executable shell script
# turn a jar with a Main-Class into a stand alone executable
(echo '#!/usr/bin/env java -jar'; cat blahblah.jar) > blah
# turn a jar with a particular main clas into a stand alone executable
(echo '#!/usr/bin/env java -jar package.MainClass'; cat blahblah.jar) > blah