Skip to content

Instantly share code, notes, and snippets.

View lmduc's full-sized avatar

Duc Le lmduc

View GitHub Profile
@lmduc
lmduc / Preferences.sublime-settings
Created August 22, 2013 03:01
medpats: standard settings for sublime
// While you can edit this file, it's best to put your changes in
// "User/Preferences.sublime-settings", which overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overriden in the platform
@lmduc
lmduc / Front-end
Created July 17, 2014 03:53
Good articles about front-end
CSS http://cssslider.com
@lmduc
lmduc / .vimrc
Last active January 9, 2017 02:04
set nocompatible
filetype off
let mapleader=" "
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
@lmduc
lmduc / .tmux.conf
Last active March 2, 2016 07:58
brew install tmux
set -g default-terminal "screen-256color"
# Scroll History
set -g history-limit 30000
set -g prefix C-a
unbind C-b
bind a copy-mode
bind r source-file ~/.tmux.conf
@lmduc
lmduc / autoserver.txt
Last active June 28, 2016 07:07
Setup Sinatra server running on Thin using the default Ruby 1.9.3
echo 'INSTALL NEEDED LIBS FOR THE OS'
sudo apt-get update
sudo apt-get install -y git make g++ git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev ruby-dev libpq-dev yui-compressor
echo 'INSTALL nodejs'
(curl -sL https://deb.nodesource.com/setup_6.x | sudo sh) && sudo apt-get install -y nodejs
echo 'INSTALL rbenv'
cd && git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
@lmduc
lmduc / temp_deregister.txt
Created June 3, 2016 07:22
temp_deregister
#!/bin/bash
deregister_service() {
export CONTAINER_ID=$(cat /proc/self/cgroup | grep "pids:/" | sed 's/\([0-9]\):pids:\/docker\///g')
echo "\nDeregistering $CONTAINER_ID with consul server $CONSUL_SERVER\n"
curl -XPUT "$CONSUL_SERVER/v1/agent/service/deregister/$CONTAINER_ID"
}
main() {
deregister_service
#!/bin/bash
trap 'excode=$?; cleanup; echo $excode; exit' EXIT HUP INT QUIT PIPE TERM
cleanup() {
# TODO: kill web
echo "inside cleanup for $1"
deregister_service
}
echo "==================UPDATE\n"
sudo apt-get update
echo "==================INSTALL DOCKER\n"
curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker $(whoami)
echo "==================INSTALL LIBS\n"
sudo apt-get install -y python-pip python-dev build-essential
echo "==================INSTALL PIP\n"
#!/bin/sh
echo "sudo apt-get update\n"
sudo apt-get update
echo "curl -sSL https://get.docker.com/ | sh\n"
curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker $(whoami)
echo "sudo service docker stop\n"
@lmduc
lmduc / install_rbenv.sh
Created June 27, 2016 08:39
Install rbenv
#!/usr/bin/env bash
# Verify Git is installed:
if [ ! $(which git) ]; then
echo "Git is not installed, can't continue."
exit 1
fi
if [ -z "${RBENV_ROOT}" ]; then
RBENV_ROOT="$HOME/.rbenv"