Steps with explanations to set up a server using:
- virtualenv
- Django
- nginx
- uwsgi
<?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? */ |
<?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? |
<?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"> |
server { | |
listen 80; | |
server_name www.example.com; | |
root /var/www/vhosts/example.com/public/; | |
location / | |
{ | |
index index.php index.html index.htm; | |
} |
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 |
#!/bin/bash | |
pg_dump -i -h <hostname> -p 5432 -U <user> -F c -b -v -f /tmp/<filename>.sql <database_name> | |
pg_restore -i -h <local_hostname> -p 5432 -U <user> -d <database_name> -v /tmp/<filename>.sql |
<?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"> |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |