Skip to content

Instantly share code, notes, and snippets.

View thanhleviet's full-sized avatar
🤗
Focusing

Thanh Lee thanhleviet

🤗
Focusing
View GitHub Profile
@thanhleviet
thanhleviet / server.R
Last active August 29, 2015 14:26 — forked from trestletech/server.R
A Shiny app combining the use of dplyr and SQLite. The goal is to demonstrate a full-fledged, database-backed user authorization framework in Shiny.
library(shiny)
library(dplyr)
library(lubridate)
# Load libraries and functions needed to create SQLite databases.
library(RSQLite)
library(RSQLite.extfuns)
saveSQLite <- function(data, name){
path <- dplyr:::db_location(filename=paste0(name, ".sqlite"))
  • TODO: need to check block device mapping flags

  • crank up an instance

      ec2-run-instances --key ec2-keypair ami-aa30c7c3 --instance-type=cg1.4xlarge \
      --block-device-mapping '/dev/sdb=ephemeral0' \
      --block-device-mapping '/dev/sdc=ephemeral1'
    
  • check for instance status and to get ip address for ssh

  • TODO: need to check block device mapping flags

  • crank up an instance

      ec2-run-instances --key ec2-keypair ami-aa30c7c3 --instance-type=cg1.4xlarge \
      --block-device-mapping '/dev/sdb=ephemeral0' \
      --block-device-mapping '/dev/sdc=ephemeral1'
    
  • check for instance status and to get ip address for ssh

import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'
@thanhleviet
thanhleviet / Gemfile
Created April 11, 2014 06:15 — forked from pilt/Gemfile
source "http://rubygems.org"
gem "jammit"
gem "closure-compiler"
# Simple ggplot2 heatmap
# with colorBrewer "spectral" palette
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "reshape2", "RColorBrewer")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Generate a random matrix
# This can be any type of numeric matrix,
@thanhleviet
thanhleviet / install postgis
Last active December 18, 2015 03:48 — forked from djq/gist:2846196
#!/bin/bash
#
# Install Postgres 9.1, PostGIS 2.0 and pgRouting on a clean Ubuntu 12.04 install (64 bit)
# updated to PostGIS 2.0.1
# basics
apt-get install python-software-properties
apt-add-repository ppa:sharpie/for-science # To get GEOS 3.3.3
# install the following pacakages
@thanhleviet
thanhleviet / Heatmap.R
Last active December 17, 2015 14:39 — forked from dsparks/Heatmap.R
# Simple ggplot2 heatmap
# with colorBrewer "spectral" palette
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "reshape2", "RColorBrewer")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Generate a random matrix
# This can be any type of numeric matrix,
.idea/*
*.pyc
import sys
from fabric.colors import green, yellow
from fabric.contrib.console import confirm
from fabric.context_managers import cd, prefix
from fabric.operations import prompt
from fabric.api import run, local, env, sudo
env.user = 'ubuntu'
env.hosts = ['0.0.0.0'] #ip do ec2
env.app_path = '/home/seu-usuario-do-ec2/bomgusto'