Skip to content

Instantly share code, notes, and snippets.

@eliangcs
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
eliangcs / secure-django-admin.rst
Last active Jun 8, 2021
Secure Django admin with self-signed SSL client certificate in Nginx.
View secure-django-admin.rst
@eliangcs
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;
View sublime-prefs.js
// Sublime Text
{
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"font_face": "DejaVu Sans Mono",
"font_size": 10,
"ignored_packages":
[
"Vintage"
],
"translate_tabs_to_spaces": true,
@eliangcs
eliangcs / ssh-config
Created Apr 10, 2014
Auto select SSH key
View ssh-config
# ~/.ssh/config
Host *.compute-1.amazonaws.com
IdentityFile ~/.ssh/us-east-1.pem
Host *.ap-northeast-1.compute.amazonaws.com
IdentityFile ~/.ssh/ap-northeast-1.pem
@eliangcs
eliangcs / postgres9.3-install.sh
Last active May 28, 2018
Install PostgreSQL 9.3 on Ubuntu 12.04 LTS
View postgres9.3-install.sh
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
# sudo apt-get install postgresql-9.3
# sudo apt-get install postgresql-client-9.3
@eliangcs
eliangcs / install_scrapy_dep.sh
Last active Aug 29, 2015
Scrapy dependencies on Ubuntu
View install_scrapy_dep.sh
sudo apt-get install -y gcc python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev build-essential
View sleekxmpp_client.py
#!/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
eliangcs / linode-security.md
Last active Jul 23, 2021
Basic security setup for a brand new Linode
View linode-security.md

Basic Security Setup for a Brand New Linode

Why

When you start a clean Linode, it isn't secured in the following aspects:

  • Allows root SSH login
  • Uses password authentication on SSH
  • Doesn't have a firewall
@eliangcs
eliangcs / pyenv+virtualenv.md
Last active Sep 15, 2021
Cheatsheet: pyenv, virtualenvwrapper, and pip
View pyenv+virtualenv.md

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv