Skip to content

Instantly share code, notes, and snippets.

View tsolar's full-sized avatar

Tomás Solar Castro tsolar

  • Santiago, Chile
View GitHub Profile

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

  • virtualenv
  • Django
  • nginx
  • uwsgi
@tsolar
tsolar / fonts.conf
Last active December 20, 2015 01:09
my fontconfig, fixes monaco <= 9px
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font" >
<edit mode="assign" name="rgba" >
<const>rgb</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="lcdfilter">
@tsolar
tsolar / phpmyadmin
Created September 3, 2013 21:00
phpmyadmin nginx config
server {
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
@tsolar
tsolar / .bashrc
Last active January 11, 2017 17:42
.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
server {
listen 80;
server_name www.example.com;
root /var/www/vhosts/example.com/public/;
location /
{
index index.php index.html index.htm;
}
@tsolar
tsolar / install_mongo_php.sh
Last active January 3, 2016 06:59
install mongo extension for PHP
apt-get install php5-dev php-pear make mongodb
pecl install mongo
echo 'extension=mongo.so' > /etc/php5/mods-available/mongodb.ini
cat /etc/php5/mods-available/mongodb.ini
ln -s /etc/php5/mods-available/mongodb.ini /etc/php5/fpm/conf.d/20-mongodb.ini
service php5-fpm restart
@tsolar
tsolar / whitespace-fix.php
Last active August 29, 2015 14:03
Whitespace fix for php
<?php
/**
* this is a fix mainly for wordpress, to prevent xml error
*
* this solution is from http://www.vichaunter.com/desarrollo-web/solucion-para-error-line-2-column-6-xml-declaration-allowed-start-document-wordpress
*
*/
function ___wejns_wp_whitespace_fix($input) {
/* valid content-type? */
@tsolar
tsolar / laravel-subdirectory.conf
Last active February 27, 2024 03:36
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;
@tsolar
tsolar / BaseModel.php
Last active August 29, 2015 14:06
Base Model for Laravel 4
<?php
use LaravelBook\Ardent\Ardent; // it can be Eloquent too
class BaseModel extends Ardent {
protected $_name;
public static function optionList($attribute = 'name') {
$model = static::getModel();
/etc/hosts
/var/lib/mysql/
/etc/nginx/sites-available
/etc/nginx/nginx.conf # maybe?