Static Files is a Django app that helps with serving static content. This tutorial is meant as a short and quick guide on how to configure your Django project to serve static based content.To achieve this we will configure Django (via settings.py) and Apache. Our example will be based on serving static content from the … Read more
Issue When trying to access your Django site within CSRF configured you receive the following via a Forbidden (403) HTTP error message: CSRF verification failed. Request aborted.No CSRF or session cookie. Solution In my scenario I found that the order of settings.MIDDLEWARE_CLASSES was incorrect. Below shows you an example settings.py MIDDLEWARE_CLASSES = ( ‘django.middleware.csrf.CsrfViewMiddleware’, ‘django.middleware.common.CommonMiddleware’, … Read more
SSLReport provides the ability to scan a network and determine which hosts are running SSL/TLS based services and then query each of these servers/ports to determine which ciphers are supported. The output of this is then outputted within a CSV based format. Usage [root@william images]# bash sslreport.txt 10.1.1.0/23 home Checking for Binaries ….. *Successful execution … Read more
Within this tutorial, I will show you the necessary steps required to add a custom field named ‘Version’ to your Joomla site. This field will be displayed within both the administrator console and the published article. 1. Configure Database Within phpmyadmin run the following SQL command ALTER TABLE `jos_content` ADD `vers` VARCHAR( 255 ) NOT … Read more
Below is a python function that I created. The purpose of this function is to print correctly aligned columns using variable length items. The result is that you can pass the function a list (or list of lists), the same list is returned with each item padded to the maximum item length within the relating … Read more
To print the path of python module the command print [module].__file__. An example is shown below: [root@webserver1 ~]# pythonPython 2.4.3 (#1, Sep 21 2011, 19:55:41)[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2Type “help”, “copyright”, “credits” or “license” for more information.>>> import pexpect>>> print pexpect.__file__/usr/lib/python2.4/site-packages/pexpect.pyc
This bash script allows you to download an audio stream via ASX (Advanced Stream Redirector) for a defined time period. The downloaded file (wma) is then converted to mp3. This provides the ability to schedule and download your favourite radio shows for later listening. Requirements There are 2 main binaries that this script requires. They … Read more
Below is a small script to convert temperatures between celcuis and fahrenheit (and vice versa). This article / script is meant as reference point rather than a full tutorial. #!/usr/bin/python import sys def convert(t,fc): if t == “2f”: print (fc * 9) / 5 + 32,”Degress Fahrenheit” elif t == “2c”: print (fc – 32) … Read more
Within this article we will be configuring a basic php installation using Apache.Note : The steps are based upon the CentOS 5 distro. Install Apache / PHP First of all you will need to install Apache and php via yum. yum install httpd php Edit php.ini Within /etc/php.ini ensure the following settings are configured by … Read more
SoundCloud allows artists and producers to upload and promote music across the internet. This article provides a Linux based script which downloads all tracks for a given artist. SCRIPT #!/bin/bash if [ -z “$1” ]; then echo “Usage: `basename $0` [URL]”; echo echo “Example:” echo ” `basename $0` http://soundcloud.com/disco-dave”; exit fi page=`wget $1 -q –user-agent=’Mozilla/5.0′ … Read more
Below is a short script designed to output the addressable IP addresses within a given subnet. Note : This script requires the netaddr python library. #!/usr/bin/pythonimport sysfrom netaddr import IPNetworkIPADDRESS = raw_input(‘Enter Subnet:’)try: for ip in IPNetwork(IPADDRESS).iter_hosts(): print ‘%s’ % ipexcept: print “Usage: “,sys.argv[0],”[SUBNET ID]/[NETMASK]” print “Output addressable ip addresses within a given subnet.” … Read more
Below is a small example to show some of the various way in which print can be called within Python. quote = “A person who never made a mistake never tried anything new.”print(“ORIGINAL”)print(quote)print(“\nUPPERCASE”)print(quote.upper())print(“\nLOWERCASE”)print(quote.lower())print(“\nTITLE”)print(quote.title())print(“\nREPLACE”)print(quote.replace(“person”, “banana”)) Output [root@linux]# python print_example.py ORIGINALA person who never made a mistake never tried anything new.UPPERCASEA PERSON WHO NEVER MADE A MISTAKE … Read more
This python script will connect to a designated FTP server. Obtain a list of all files, then sort all files with a .jpa extension and then download the latest one. In order to do this regular expressions are used to build a list of files only containing .jpa file extensions. This list is then sorted … Read more
In this article we will be adding a custom module position to the RocketTheme Afterburner template. The syntax used here will be specfic to the Afterburner template but you should be able to adjust and use as nessecary within your own template. Add the following code to the following files within /templates/rt_afterburner_j15/ index.php <div id=”nav”> … Read more
In order to remove the Title Filter and Display # from the Category list remove the following code from the file \templates\[your-template]\html\com_content\category\default-items.php {codecitation class=”brush:php”} <?php if ($this->params->get(‘filter’) || $this->params->get(‘show_pagination_limit’)) : ?> <tr> <td colspan=”5″> <table> <tr> <td align=”left” width=”60%” nowrap=”nowrap”> <input type=”text” name=”filter” value=”” class=”inputbox” onchange=”document.adminForm.submit();” /> </td> <td align=”right” width=”40%” nowrap=”nowrap”> <?php echo ‘ ‘.JText::_(‘Display … Read more
Issue When trying to access certain URLs within your Joomla site you may receive the error below. Redirect Loop: Firefox has detected that the server is redirecting the request for this address in a way that will never complete Solution In most cases this issue will be down to the SEF settings for your Joomla … Read more
Issue When using Fireboard and Community Builder. You may find that when you try to access your Fireboard forum from your website (frontend) after logging in you receive the following error : Serious db problem:Unknown column ‘fbviewtype’ in ‘field list’ SQL=select fbviewtype from jos_comprofiler where user_id=’62’ Solution To resolve this goto “Fireboard Forum –> Fireboard … Read more
Below shows you how to redirect the Fireboard Login to your Community Builder Login. Create a copy of your CB Login Module. This will be used in the next step Create a Module Content Page for your Community Builder Login. Once done you will have created page which contains your CB Login and a URL … Read more
Scenerio In this scenerio we will require to create a page using only a module. In order to accomplish this we use a built in Joomla Plugin called “Content – Load Module“. This is enabled by installed and enabled by default upon Joomla Installation. Required Steps Below details the required steps for created a page … Read more