Skip to content

Instantly share code, notes, and snippets.

eliangcs / ssh-config
Created Apr 10, 2014
Auto select SSH key
View ssh-config
# ~/.ssh/config
Host *
IdentityFile ~/.ssh/us-east-1.pem
Host *
IdentityFile ~/.ssh/ap-northeast-1.pem
eliangcs /
Last active Aug 29, 2015
Scrapy dependencies on Ubuntu
sudo apt-get install -y gcc python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev build-essential
#!/usr/bin/env python
# -*- coding: utf-8 -*-
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
eliangcs /
Last active Aug 29, 2015
My Vim cheatsheet


  • a: after cursor
  • i: before cursor
  • A: after line
  • I: before line
  • o: add a new line below
  • O: add a new line above


eliangcs /
Created Dec 1, 2014
Common imports for IPython startup
# ~/.ipython/profile_default/startup/
import base64
import codecs
import cPickle as pickle
import cStringIO as StringIO
import csv
import hashlib
import importlib
import json
import math
eliangcs / arrow2.zsh-theme
Last active Aug 29, 2015
My oh-my-zsh theme
View arrow2.zsh-theme
# Forked from
git_describe() {
echo $(git describe --tag 2> /dev/null)
my_git_prompt_info() {
if [ ! -z "$prompt" ]; then
echo "$(git_describe) ($(git_prompt_info))"
eliangcs / export_import_vertica.sql
Last active Aug 29, 2015
Export/import data from Vertica
View export_import_vertica.sql
-- Export
\a -- Disable alignment
\t -- Disable column header
\o output.txt -- Set output filename
SELECT * FROM table; -- Select the data to export
-- Import
COPY table FROM '/path/to/output.txt' DELIMITER '|';
View vsql_commands.txt
See the Vertica Programmer's Guide for information on available commands.
\c[onnect] [DBNAME|- [USER]]
connect to new database (currently "localdev")
\cd [DIR] change the current working directory
\q quit vsql
\set [NAME [VALUE]]
set internal variable, or list all if no parameters
\timing toggle timing of commands (currently off)
eliangcs / gist:1341253
Created Nov 5, 2011
Creating a Triangle Mesh with 3ds Max SDK
View gist:1341253
TriObject *createTriangleMesh(const std::vector<Point3> &points,
const std::vector<Point3> &normals,
const std::vector<Point2> &uvs,
const std::vector<int> &triangleVertIndices)
TriObject *triobj = CreateNewTriObject();
if (triobj == NULL)
return NULL;
assert(points.size() == normals.size() && normals.size() == uvs.size());
eliangcs / gist:6682975
Created Sep 24, 2013
phpmyadmin on Nginx
View gist:6682975
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;