This implementation was made using Debian 8.
-
Install packages:
aptitude install nginx supervisor
| from os.path import splitext | |
| from django.core.exceptions import ValidationError | |
| from django.utils.translation import ugettext_lazy as _ | |
| from django.template.defaultfilters import filesizeformat | |
| class FileValidator(object): | |
| """ | |
| Validator for files, checking the size, extension and mimetype. |
| # @brief | |
| # Performs file upload validation for django. The original version implemented | |
| # by dokterbob had some problems with determining the correct mimetype and | |
| # determining the size of the file uploaded (at least within my Django application | |
| # that is). | |
| # @author dokterbob | |
| # @author jrosebr1 | |
| import mimetypes |
| 1. Download a version of XAMPP: | |
| - latest version: https://www.apachefriends.org/pt_br/index.html | |
| - older version: http://sourceforge.net/projects/xampp/files/ | |
| Consult the best version 4u: http://code.stephenmorley.org/articles/xampp-version-history-apache-mysql-php/ | |
| 2. Install xampp: | |
| - To older versions: | |
| Use the following command and extract the downloaded distribution into /opt/xampp directory: | |
| sudo tar xvfz xampp-linux-x.x.x.tar.gz -C /opt |
| /* =========================================================== | |
| * bootstrap-tooltip.js v2.2.2 | |
| * http://twitter.github.com/bootstrap/javascript.html#tooltips | |
| * Inspired by the original jQuery.tipsy by Jason Frame | |
| * =========================================================== | |
| * Copyright 2012 Twitter, Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at |
| /* =========================================================== | |
| * bootstrap-popover.js v2.0.1 | |
| * http://twitter.github.com/bootstrap/javascript.html#popovers | |
| * =========================================================== | |
| * Copyright 2012 Twitter, Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * |
| <?php | |
| /* | |
| * Solution to list with hierarchy using self-relation | |
| * Found here: http://stackoverflow.com/questions/7730889/hierarchy-commenting-system-php | |
| * */ | |
| // getting the comments from mysql, I'm obviously not bothering | |
| // to check the return value, but in your code you should do it | |
| $result = mysqli_query("SELECT id, parent FROM comments WHERE thread_id = 123"); |
| #!/bin/bash | |
| ############################################################################################ | |
| ##### Script created by Romulo Grandini with my changes #################################### | |
| ##### (read the orginal script in 'backup_files_original.sh' file) ######################### | |
| ##### Publication: http://www.vivaolinux.com.br/script/Backup-em-HD-Externa-com-Rsync ##### | |
| ############################################################################################ | |
| # USE | |
| # ./backup_files.sh SRC DEST |
| import os, sys, site | |
| # Add the site-packages of the chosen virtualenv to work with | |
| site.addsitedir('PATH_TO_YOUR_PROJECT/venv/local/lib/python2.7/site-packages') | |
| sys.path.append('PATH_TO_YOUR_PROJECT') | |
| os.environ['DJANGO_SETTINGS_MODULE'] = 'PROJECT_NAME.settings' | |
| os.environ['PYTHON_EGG_CACHE'] = 'PATH_TO_YOUR_PROJECT/.python-egg' |
| #!/bin/bash | |
| # script by http://www.emidioleite.com.br/um-simples-script-para-backup-de-bases-postgres-sql-usando-linux/ | |
| # thanks! | |
| # Location to place backups. | |
| backup_dir="$1" | |
| #String to append to the name of the backup files | |
| backup_date=`date +%Y-%m-%d` |