Skip to content

Instantly share code, notes, and snippets.

@eliangcs
eliangcs / postgres9.3-install.sh
Last active May 28, 2018 11:33
Install PostgreSQL 9.3 on Ubuntu 12.04 LTS
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 / ssh-config
Created April 10, 2014 02:12
Auto select SSH key
# ~/.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
// 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 / gist:6682975
Created September 24, 2013 10:32
phpmyadmin on Nginx
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;
@eliangcs
eliangcs / secure-django-admin.rst
Last active June 8, 2021 16:10
Secure Django admin with self-signed SSL client certificate in Nginx.
@eliangcs
eliangcs / gist:1341253
Created November 5, 2011 07:57
Creating a Triangle Mesh with 3ds Max SDK
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());