Skip to content

Instantly share code, notes, and snippets.

#!/usr/local/bin/bash
############################### FOLDER ICONS ###################################
folder="$(pwd)"
# Construct the path for the folder icon
FOLDER_ICON_PATH="$folder/.icon"
if [ -f $FOLDER_ICON_PATH ]; then
@jaywhy13
jaywhy13 / Docker compose
Created September 21, 2018 12:49
A docker-compose file for ElasticSearch and Kibana
version: '3'
services:
es:
container_name: sandbox_elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.3
ports:
- "9200:9200"
container_name: es
environment:
ELASTIC_USER: elastic
@jaywhy13
jaywhy13 / gist:bd25421821327f25a74c7634b6244882
Created September 18, 2018 03:17
Jamaican Restaurants for ElasticSearch
POST /restaurants/_doc?refresh
{
"name": "Gloria's",
"name_suggest": "Gloria's",
"city": "Port Royal"
}
POST /restaurants/_doc?refresh
{
"name": "Morgan's Harbour",
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaywhy13
jaywhy13 / watchdocs.py
Last active April 27, 2016 11:40
Python script to compile Sphinx documentation
import sys
import time
import logging
import os
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver
from watchdog.events import PatternMatchingEventHandler
import subprocess
class DocsCompiler(PatternMatchingEventHandler):
@jaywhy13
jaywhy13 / install_rabbit.sh
Last active March 14, 2016 18:20
Install RabbitMQ Server 3.6 on Ubuntu 12.04
#!/bin/bash
echo "deb http://www.rabbitmq.com/debian/ testing main" | tee -a /etc/apt/sources.lst
echo "deb http://packages.erlang-solutions.com/ubuntu precise contrib" | tee -a /etc/apt/sources.lst
# Upgrade Erlang
wget http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
@jaywhy13
jaywhy13 / install_virtualenv.sh
Last active January 14, 2016 00:03
Setup Vagrant with Virtualenvwrapper
#!/bin/bash
# Install virtualenvwrapper library
sudo pip install virtualenvwrapper
# Configure .bashrc
echo "export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=/vagrant
source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
@jaywhy13
jaywhy13 / customize_byobu_keybindings.sh
Last active January 14, 2016 01:00
Customize Byobu keybindings in Vagrant
#!/bin/bash
# We need to invoke Byobu just so that it'll create the ~/.byobu directory
byobu-tmux new-session -d
byobu kill-server
echo "bind-key -n F1 new-window
bind-key -n F2 previous-window
bind-key -n F3 next-window" > ~/.byobu/keybindings.tmux