<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eclectic Security</title>
	<atom:link href="http://bailey.st/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://bailey.st/blog</link>
	<description>Useful bits of information in  an uncertain world.</description>
	<lastBuildDate>Wed, 02 May 2012 15:41:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Ubuntu, Django, Postgresql and Nginx, a rock solid web stack.</title>
		<link>http://bailey.st/blog/2012/05/02/ubuntu-django-postgresql-and-nginx-a-rock-solid-web-stack/</link>
		<comments>http://bailey.st/blog/2012/05/02/ubuntu-django-postgresql-and-nginx-a-rock-solid-web-stack/#comments</comments>
		<pubDate>Wed, 02 May 2012 09:28:44 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[web applications]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1122</guid>
		<description><![CDATA[Lately I&#8217;ve been working on developing a web application project,   I guess everyone involved in such process had to make the uneasy decision to choose the right Web Stack to run the application.  Multiple factors usually drive the final decision,total cost of ownership (TCO), scalability, stability and performances. The TCO factor can be easy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bailey.st/blog/wp-content/uploads/2012/05/djangostack.jpg"><img class="alignnone  wp-image-1123" title="djangostack" src="http://bailey.st/blog/wp-content/uploads/2012/05/djangostack.jpg" alt="" width="499" height="231" /></a></p>
<p style="text-align: justify;">Lately I&#8217;ve been working on developing a web application project,   I guess everyone involved in such process had to make the uneasy decision to choose the right Web Stack to run the application.  Multiple factors usually drive the final decision,total cost of ownership (TCO), scalability, stability and performances. The TCO factor can be easy overcome with FLOSS (Free and open source software), scalability is a very broad term and concept  that doesn&#8217;t have any clear answer. Stability can be achieved with software that is  widely used and widely reviewed and tested for a long time, never pick something new just because it&#8217;s cool. Doesn&#8217;t matter if the website serve millions of users or just a few hundred, slow or bad performances can make the user experience a nightmare. Performance enhancement can be  achieved with, Memory caching system, Low memory footprint web servers, good and slim database design, query optimization to work under heavy loads. Please  be aware that applications, services and workloads differ from case to case, you might need more write capacity rather than read, serving multimedia files or whatever else, don&#8217;t blame me if you have troubles with your production application after following this how-to. For me and some other, this setup works quite well, I hope the same for you <img src='http://bailey.st/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  .</p>
<p style="text-align: justify;">This tutorial covers the set up a free, full-featured web development framework based on Ubuntu Server 12.04(LTS), Django 1.4 stable, Postgresql database V. 9.1, Nginx web server V.1.1.19 and Gunicorn.</p>
<p><strong>Ubuntu Server</strong><br />
Linux for high-volume server workloads<br />
<a href="http://www.ubuntu.com/business/server/overview">http://www.ubuntu.com/business/server/overview</a></p>
<p><strong>Django</strong><br />
The web framework for perfectionists with deadlines<br />
<a href="www.djangoproject.com">www.djangoproject.com</a></p>
<p><strong>Postgresql</strong><br />
A powerful, open source object-relational database system.<br />
<a href="http://www.postgresql.org">http://www.postgresql.org</a></p>
<p><strong>Nginx</strong><br />
A web server with a strong focus on high concurrency, performance and low memory usage.<br />
<a href="http://wiki.nginx.org/Main">http://wiki.nginx.org/Main</a></p>
<p><strong>Gunicorg</strong><br />
A WSGI HTTP Server, the link between Django an Nginx.<br />
<a href="http://gunicorn.org/">http://gunicorn.org/</a></p>
<p><strong><span style="color: #ff0000;">Postgresql installation and setup</span></strong></p>
<pre class="brush: bash; title: ; notranslate">

apt-get install postgresql python-psycopg2

sudo -u postgres psql template1

ALTER USER postgres with encrypted password 'a_strong_password';

template1=# CREATE DATABASE test;

template1=# CREATE USER test WITH PASSWORD 'test';

template1=# GRANT ALL PRIVILEGES ON DATABASE test to test;
</pre>
<p>In /etc/postgresql/9.1/main/pg_hba.conf</p>
<p>Change</p>
<pre class="brush: bash; title: ; notranslate">
local   all             postgres                                peer

To

local   all             postgres                                md5

local   all             all                                     peer

to

local   all             all                                     md5
</pre>
<p>Restart Postgresql server with<em></em>:</p>
<p>/etc/init.d/postgresql restart</p>
<p>To thest the local connection to the database please use:</p>
<p>psql -d postgres -U postgres</p>
<p>and</p>
<p>psql -d test -U test</p>
<p>Django installation and setup.</p>
<pre class="brush: bash; title: ; notranslate">
apt-get install aria2c

aria2c http://www.djangoproject.com/download/1.4/tarball/

tar xvfz Django-1.4.tar.gz

python setup.py install

mkdir /var/djangoweb/

django-admin.py  startproject myproject

django-admin.py  startproject myproject

cd myproject/

mkdir /var/djangoweb/myproject/static

ln -s /usr/local/lib/python2.7/dist-packages/django/contrib/admin /var/djangoweb/myproject/static/
</pre>
<p>in myproject/settings.py</p>
<p>Add</p>
<pre class="brush: bash; title: ; notranslate">
import os.path
PROJECT_DIR = os.path.dirname(__file__)
</pre>
<p>Database setup in django</p>
<pre class="brush: bash; title: ; notranslate">
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'test',                      # Or path to database file if using sqlite3.
        'USER': 'test',                      # Not used with sqlite3.
        'PASSWORD': 'test',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}
</pre>
<p>Then go to the INSTALLED_APPS section and uncomment<br />
django.contrib.admin line.</p>
<pre class="brush: bash; title: ; notranslate">
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    # 'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)
</pre>
<p>and # &#8216;django.contrib.admin&#8217;,</p>
<pre class="brush: bash; title: ; notranslate">
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)
</pre>
<p>in myproject/urls.py uncomment the following lines.</p>
<pre class="brush: bash; title: ; notranslate">

from django.contrib import admin
admin.autodiscover()

url(r'^admin/', include(admin.site.urls)),
</pre>
<p>The  urls.py  file have to look like this.</p>
<pre class="brush: bash; title: ; notranslate">
from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'myproject.views.home', name='home'),
    #url(r'^myproject/', include('myproject.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)
</pre>
<p style="text-align: justify;">Now the basic parameters are defined, we must perform the first database synchronization,<br />
go on top of the project root and issue the &#8220;python manage.py syncdb&#8221; command.</p>
<p style="text-align: justify;">You&#8217;ll see the creation of the first Django tables inside the database,  you also need to create<br />
the administrator user.</p>
<pre class="brush: bash; title: ; notranslate">
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): phillip
E-mail address: phillip@foo.com
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
</pre>
<p>At this point the Django interaction with the database looks working properly.</p>
<p>In order to get access to Django administration page you need to run the<br />
embedded python web server.</p>
<pre class="brush: bash; title: ; notranslate">

python manage.py runserver 0.0.0.0:80
Validating models...

0 errors found
Django version 1.4, using settings 'myproject.settings'
Development server is running at http://0.0.0.0:80/
Quit the server with CONTROL-C.
</pre>
<p>Point the browser to:</p>
<p>http://server_ipaddress/admin/</p>
<p><strong><span style="color: #ff0000;">Gunicorn installation and setup<br />
</span></strong></p>
<p>Install gunicorn</p>
<pre class="brush: bash; title: ; notranslate">

apt-get install git python-setuptools
git clone git://github.com/benoitc/gunicorn.git
cd gunicorn/
python setup.py install
</pre>
<p>inside the root project folder myproject</p>
<p>vim gunicorn.conf.py</p>
<pre class="brush: bash; title: ; notranslate">
bind = &quot;127.0.0.1:8888&quot;
workers = 2
#recommended (2 x $num_cores) + 1
</pre>
<p>To run gunicor go in the root project folder and run:</p>
<p>gunicorn_django -c gunicorn.conf.py</p>
<p>To Daemonize the Gunicorn process add -D</p>
<p>gunicorn_django -c gunicorn.conf.py -D</p>
<p>Yum must get:</p>
<pre class="brush: bash; title: ; notranslate">
gunicorn_django -c gunicorn.conf.py
2012-05-01 19:53:28 [6176] [INFO] Starting gunicorn 0.14.2
2012-05-01 19:53:28 [6176] [INFO] Listening at: http://127.0.0.1:8888 (6176)
2012-05-01 19:53:28 [6176] [INFO] Using worker: sync
2012-05-01 19:53:28 [6180] [INFO] Booting worker with pid: 6180
2012-05-01 19:53:28 [6181] [INFO] Booting worker with pid: 6181
</pre>
<p><strong><span style="color: #ff0000;">Nginx installation and configuration</span></strong></p>
<pre class="brush: bash; title: ; notranslate">

apt-get install nginx-full  openssl

rm /etc/nginx/sites-enabled/default

touch /etc/nginx/sites-available/django

ln -s /etc/nginx/sites-available/django  /etc/nginx/sites-enabled/django
</pre>
<p>In /etc/nginx/sites-enabled/django please add:</p>
<pre class="brush: bash; title: ; notranslate">

server {

listen   server_ipaddress:80;
#server_name *.site1;

access_log /var/log/nginx/djangosite1.access.log;
error_log /var/log/nginx/djangosite1.error.log;

location / {
        proxy_pass http://127.0.0.1:8888;

}

#location /static {
#         autoindex on;
#         root /root/blog/public_html/;
#    }

location /static/admin {
         autoindex on;
         root /var/djangoweb/myproject/static/admin;
    }

}
</pre>
<p>/etc/init.d/nginx restart</p>
<p><strong>Django admin web interface.</strong></p>
<p><img class="alignnone size-full wp-image-1135" title="djangoadmin2" src="http://bailey.st/blog/wp-content/uploads/2012/05/djangoadmin2.png" alt="" width="511" height="385" /></p>
<p style="text-align: justify;">Now you can point the browser to  http://server_ipaddress/admin/, be aware the myproject directory is just the schema container for the project, no applications are yet configured or installed. I strongly advise to follow &#8220;Writing your first Django app&#8221; how-to, do not copy paste the code.</p>
<p>If you want to find more about django development please take a look to:</p>
<p><a href="http://showmedo.com/videotutorials/series?name=PPN7NA155">Django From the Ground Up video series</a><br />
<a href="http://pyvideo.org/category/3/djangocon-2011">DjangoCon 2011</a><br />
<a href="http://www.djangobook.com/en/2.0/">The Django book</a></p>
<p>I hope this document will be useful for who is struggling with Django setup. Stay tuned.</p>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2012/05/02/ubuntu-django-postgresql-and-nginx-a-rock-solid-web-stack/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>April 2012 events &#8211; Nothing will happen (Belgrade) &#8211; Richard Stallman speech (Zagreb)</title>
		<link>http://bailey.st/blog/2012/04/16/april-2012-events-nothing-will-happen-belgrade-richard-stallman-speech-zagreb/</link>
		<comments>http://bailey.st/blog/2012/04/16/april-2012-events-nothing-will-happen-belgrade-richard-stallman-speech-zagreb/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 08:13:19 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[conferences]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1112</guid>
		<description><![CDATA[Nothing will happen in Belgrade 2012 In the next coming week a few events are taking place over Belgrade and Zagreb, as usual on the middle of april I will attend for nista neće dogoditi (Nothing will happen), an tech unconference for hackers from former Yugoslavian countries. This year the conference is hosted inside the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://oosm.org/content/lokacija"><img class="alignnone size-medium wp-image-1113" title="hacklabbelgrage" src="http://bailey.st/blog/wp-content/uploads/2012/04/hacklabbelgrage-300x199.jpg" alt="" width="300" height="199" /></a></p>
<p><strong>Nothing will happen in Belgrade 2012</strong></p>
<p style="text-align: justify;">In the next coming week a few events are taking place over Belgrade and Zagreb, as usual on the middle of april I will attend for <a href="http://www.nsnd.org/2012/04/10/nsnd-beograd-4-guzvanje-u-pink-kuhinji/">nista neće dogoditi (Nothing will happen)</a>, an tech unconference for hackers from former Yugoslavian countries. This year the conference is hosted inside the newborn &#8220;Hacklab Belgrade&#8221; on April 21 and 22, I&#8217;m really  eager to visit the hackerspace and to see on what the crew is up to. Nothing will happen is an unique event, no schedule, no plan, but all of sudden things come together, and that is the moment  where to prove your hacker attitude. Hope to see you in Belgrade.</p>
<p><strong>How to get to the Hacklab</strong>: <a href="http://oosm.org/content/lokacija">http://oosm.org/content/lokacija</a></p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2012/04/che-stallman-tshirt-show.jpg"><img class="alignnone size-medium wp-image-1114" title="che-stallman-tshirt-show" src="http://bailey.st/blog/wp-content/uploads/2012/04/che-stallman-tshirt-show-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p style="text-align: justify;"><strong> Richard Stallman: For a Free Digital Society</strong></p>
<p style="text-align: justify;">On Monday, 23th April 2012 18:00, at the Zagreb Museum of Contemporary Art, Richard Stallman will deliver a speech  on the subject &#8220;For a Free Digital Society&#8221;.</p>
<p style="text-align: justify;"><em>&#8220;Activities directed at &#8220;including&#8221; more people in the use of digital technology are predicated on the assumption that such inclusion is invariably a good thing.  It </em><em>appears so, when judged solely by immediate practical convenience.  However, if we also judge in terms of human rights, whether digital inclusion is good or bad depends on what kind of digital world we are to be included in.  If we wish to work towards digital inclusion as a goal, it behooves us to make sure it is the good kind.&#8221;</em></p>
<p>23th April 2012 18:00<br />
<strong>Richard Stallman &#8220;For a Free Digital Society&#8221;</strong><br />
Location:<br />
Museum of Contemporary Art<br />
Av. Dubrovnik 17, 10000 Zagreb, Croatia<br />
<a href="http://www.msu.hr/">www.msu.hr</a></p>
<p>Addmission: Free &#8211; No registration required.</p>
<p>Event coordinator: Tomislav Medak, tom@mi2.hr</p>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2012/04/16/april-2012-events-nothing-will-happen-belgrade-richard-stallman-speech-zagreb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dirt cheap USB Temperature Sensor with python SMS alerting system.</title>
		<link>http://bailey.st/blog/2012/04/12/dirt-cheap-usb-temperature-sensor-with-python-sms-alerting-system/</link>
		<comments>http://bailey.st/blog/2012/04/12/dirt-cheap-usb-temperature-sensor-with-python-sms-alerting-system/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 09:32:13 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1101</guid>
		<description><![CDATA[In the last few weeks I had to design an effective and cheap temperature monitoring system for the server room. After searching a bit on the web I found this USB Thermometer Temperature dongle on Ebay, only 10 bucks with free shipping. As soon the sensor arrived, I plugged it into one Ubuntu based server [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bailey.st/blog/wp-content/uploads/2012/04/sensor.png"><img class="alignnone  wp-image-1102" title="sensor" src="http://bailey.st/blog/wp-content/uploads/2012/04/sensor-150x150.png" alt="" width="182" height="182" /></a></p>
<pre></pre>
<p style="text-align: justify;">In the last few weeks I had to design an effective and cheap temperature monitoring system for the server room. After searching a bit on the web I found this <a href="http://www.ebay.com/itm/PC-Laptop-USB-Thermometer-Temperature-Sensor-C893-/150476229072?pt=LH_DefaultDomain_0&amp;hash=item23091509d0">USB Thermometer Temperature dongle on Ebay</a>, only 10 bucks with free shipping. As soon the sensor arrived, I plugged it into one Ubuntu based server and surprisingly worked immediately, below you can see the dmesg output.</p>
<pre class="brush: bash; title: ; notranslate">
[12737.064004] usb 2-1.3: new low speed USB device using ehci_hcd and address 6
[12737.161227] usb 2-1.3: configuration #1 chosen from 1 choice
[12737.164379] input: RDing TEMPer1V1.1 as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input6
</pre>
<p style="text-align: justify;">Along with monitoring the temperature I wanted to have an alarming system that sends alarm SMS message to mobile phones when the temperature has passed a certain threshold. So I subscribed to <a href="http://www.textmagic.com/">textmagic</a>, an SMS gateway provider. Textmagic has a good set of API, and of course they have the python API which I used to write my Pytemp2sms.py script.</p>
<p><strong>USB dongle software and settings.</strong></p>
<pre class="brush: bash; title: ; notranslate">
wget http://www.isp-sl.com/pcsensor-0.0.1.tgz
tar xvfz pcsensor-0.0.1.tgz
cd pcsensor-0.0.1
cp 99-tempsensor.rules /etc/udev/rules.d/
cp pcsensor /usr/local/bin/
</pre>
<p>Reboot the server.</p>
<p>To test the dongle run the pcsensor command .<br />
You must get this kind of output.</p>
<p>2012/04/11 14:30:50 Temperature 60.58F 15.88C</p>
<p><strong>SMS alarm.</strong></p>
<p>Textmagic python API installation.</p>
<p>https://code.google.com/p/textmagic-sms-api-python/wiki/UserManual</p>
<pre class="brush: bash; title: ; notranslate">

apt-get install python-setuptools
easy_install PyTextMagicSMS
</pre>
<p><strong>Pytemp2sms script.</strong></p>
<p>Script download: <a href="http://bailey.st/code/bitsofpy/Pytemp2sms/">http://bailey.st/code/bitsofpy/Pytemp2sms/</a></p>
<pre class="brush: bash; title: ; notranslate">

#!/usr/bin/python
import sys
import subprocess
import fileinput
import textmagic.client

#Temperature threshold in C
threshold = 5
#Balance threshold
credits = 100
#TextMagic account details, before using textmagic service
#you need to register and obtain an API password
#(different from your login password)
#
#https://www.textmagic.com/app/wt/account/api/cmd/password
username = &quot;yourusername&quot;
password = &quot;APIpassword&quot;
#Owner of the Textmagic sms account.This number will receive
#the credit balance .
owner = &quot;+44phonenumberoftheowneraccount&quot;

'''License: This software is distributed under
   the terms  and  conditions  of GPL  - GNU
   General  Public  License.'''

def usage():

    print &quot; ------------------------------------------&quot;
    print &quot;|              Pytemp2sms                  |&quot;
    print &quot;|                                          |&quot;
    print &quot;|Temperature Sensor with sms alert system. |&quot;
    print &quot;|                                          |&quot;
    print &quot;|www.bailey.st                             |&quot;
    print &quot;|phillip@bailey.st                         |&quot;
    print &quot; ------------------------------------------ &quot;

    print &quot;\n&quot;
    print &quot;Usage instructions:&quot;
    print &quot;\n&quot;
    print &quot;Pytemp2sms.py checktemp | checkbalance&quot;
    print &quot;\n&quot;

def checktemp():

    output = subprocess.Popen([&quot;/usr/local/bin/pcsensor&quot;], stdout=subprocess.PIPE).communicate()[0]
    output2 = output.split()[4]
    temp = output2[:2]

    if int(temp) &gt; threshold:

        for phonebook in fileinput.input(&quot;/usr/local/bin/phonebook.txt&quot;):

            client = textmagic.client.TextMagicClient(username, password)
            client.send(&quot;WARNING - Server room temperature above threshold!!! PLEASE CHECK!!!&quot;, phonebook)

    else:
        sys.exit()

def checkbalance():

    client = textmagic.client.TextMagicClient(username, password)
    balance = client.account()['balance']
    print balance

    if balance &lt; credits:
        client.send(&quot;WARNING - Textmagic credit balance below threshold, please top the account&quot;, owner)

    else:
            sys.exit()

if len(sys.argv) &lt; 2:
    usage()
    sys.exit()

if &quot;checktemp&quot; in sys.argv[1]:
        checktemp()

if &quot;checkbalance&quot; in sys.argv[1]:
        checkbalance()
</pre>
<p><strong>Phonebook file.</strong></p>
<p style="text-align: justify;">The file phonebook.txt must contain all the mobile numbers that need to receive the alarm sms. Please follow this syntax:</p>
<p>+44numberone<br />
+44numbertwo<br />
+44numberthree</p>
<p><strong>Crontabs.</strong></p>
<pre class="brush: bash; title: ; notranslate">

*/30 * * * * /usr/local/bin/Pytemp2sms.py checktemp &gt;/dev/null 2&gt;&amp;1
*/60 * * * * /usr/local/bin/Pytemp2sms.py checkbalance &gt;/dev/null 2&gt;&amp;1
</pre>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2012/04/12/dirt-cheap-usb-temperature-sensor-with-python-sms-alerting-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress and Nginx</title>
		<link>http://bailey.st/blog/2012/04/04/wordpress-and-nginx/</link>
		<comments>http://bailey.st/blog/2012/04/04/wordpress-and-nginx/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 11:31:56 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1088</guid>
		<description><![CDATA[Apache is like Microsoft Word, it has a million options but you only need six. Nginx does those six things, and it does five of them 50 times faster than Apache. Chris Lea on nginx and WordPress. Nginx is a lightweight Web server with a small memory footprint and exceptional flexibility, along with this features [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bailey.st/blog/wp-content/uploads/2012/04/nginx.png"><img class="alignnone size-full wp-image-1090" title="nginx" src="http://bailey.st/blog/wp-content/uploads/2012/04/nginx.png" alt="" width="365" height="109" /></a></p>
<p><em>Apache is like Microsoft Word, it has a million options but you only need six.</em> <em>Nginx does those six things, and it does five of them 50 times faster than Apache.</em></p>
<p><a href="http://maisonbisson.com/blog/post/12249/chris-lea-on-nginx-and-wordpress/"><em>Chris Lea on nginx and WordPress.</em></a></p>
<p style="text-align: justify;"><a href="http://nginx.org/">Nginx</a> is a lightweight Web server with a small memory footprint and exceptional flexibility, along with this features the Nginx design is focused to ensure the maximum security. The configuration may look non-intuitive and not so straightforward, but a strong <a href="http://wiki.nginx.org/Community">community</a> and an excellent <a href="http://wiki.nginx.org/Resources">documentation</a> will clear all your doubts. In this how-to I&#8217;m going to share my experience on moving a few WordPress blogs from Apache to Nginx, one of the blog is served inside the root directory and the other one is served as WordPress sub directory.</p>
<p style="text-align: justify;">Please note, this how to applies to <strong>Ubuntu 10.04 LTS.</strong></p>
<p style="text-align: justify;"><strong>php5-fpm installation and configuration.</strong></p>
<p style="text-align: justify;">In order to serve PHP dynamic content we need to install php5-fpm.</p>
<pre class="brush: bash; title: ; notranslate">

deb http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main
deb-src http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8D0DC64F
apt-get update
apt-get  install  php5-fpm
</pre>
<p>Once php5-fpm is installed we need to create a configuration file www.conf ,<br />
located into /etc/php5/fpm/pool.d/ . Please copy the following values into it.</p>
<pre class="brush: bash; title: ; notranslate">

[www]

user = www-data
group = www-data
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 10
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 6
chdir = /
</pre>
<p>Restart the php5-fpm service.</p>
<pre class="brush: bash; title: ; notranslate">
/etc/init.d/php5-fpm restart
</pre>
<p><strong>Nginx installation and configuration.</strong></p>
<pre class="brush: bash; title: ; notranslate">
apt-get  install nginx
</pre>
<p>It wise to disable the default site configuration.</p>
<p>unlink /etc/nginx/sites-enabled/default</p>
<p>Now, let&#8217;s begin to create our first site configuration, the one<br />
installed inside the root directory and served as www.example1.com .</p>
<p>In /etc/nginx/sites-available/example1.com paste, wich example1.com<br />
is your domain name.</p>
<p>Example NR.1</p>
<pre class="brush: bash; title: ; notranslate">

server {
        listen   80;
        server_name  example1.com;

        access_log  /var/log/nginx/example1.com.access.log;
        error_log  /var/log/nginx/example1.com.error.log;

        location / {
                root   /var/www/example1.com;
                index  index.php index.htm;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

}
</pre>
<p>To enable example1.com please create a soft link to:</p>
<pre class="brush: bash; title: ; notranslate">
sudo ln -s /etc/nginx/sites-available/example1.com /etc/nginx/sites-enabled/example1.com
</pre>
<p>Restart Nginx with # /etc/init.d/nginx restart and point the browser to your domain name.</p>
<p>Example NR.2, with wordpress served as www.example2.com/blog</p>
<p>In /etc/nginx/sites-available/example2.com paste, wich example2.com<br />
is your domain.</p>
<pre class="brush: bash; title: ; notranslate">

server {
    server_name     example2.com;
    index           index.php;
    root            /var/www/example2.com;

        access_log  /var/log/nginx/example2.com.access.log;
        error_log  /var/log/nginx/example2.com.error.log;

if (!-e $request_filename) {
rewrite ^.+/?(/ms-.*) $1 last;
rewrite ^/files/(.+) /wp-includes/ms-files.php?file=$1 last;
rewrite ^.+/?(/wp-.*) $1 last;
rewrite ^.+/?(/.*.php)$ $1 last;
rewrite ^(.+)$ /index.php?q=$1 last;
break;
}

    location ~ .php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
}
}
</pre>
<p>To enable example1.com please create a soft link to:</p>
<pre class="brush: bash; title: ; notranslate">
sudo ln -s /etc/nginx/sites-available/example2.com /etc/nginx/sites-enabled/example2.com
</pre>
<p style="text-align: justify;">Please restart the Nginx server and test your new blog # /etc/init.d/nginx and point the browser to www.example2.com/blog</p>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2012/04/04/wordpress-and-nginx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zenoss over SSL with Nginx reverse proxy.</title>
		<link>http://bailey.st/blog/2012/03/24/zenoss-over-ssl-with-nginx-reverse-proxy/</link>
		<comments>http://bailey.st/blog/2012/03/24/zenoss-over-ssl-with-nginx-reverse-proxy/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 15:58:19 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[zenoss]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1079</guid>
		<description><![CDATA[Zenoss is an enterprise infrastructure monitoring tool that can give in real time the big picture of networks, applications, hardware performances and issues running from a small business to a cloud service. While using it I found the lack of a decent SSL support running out off the box, in order to overcome this issue [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bailey.st/blog/wp-content/uploads/2012/03/Zenoss_Core_Dashboard.png"><img class="alignnone size-full wp-image-1081" title="Zenoss_Core_Dashboard" src="http://bailey.st/blog/wp-content/uploads/2012/03/Zenoss_Core_Dashboard.png" alt="" width="628" height="304" /></a></p>
<p style="text-align: justify;">Zenoss is an enterprise infrastructure monitoring tool that can give in real time the big picture of networks, applications, hardware performances and issues running from a small business to a cloud service. While using it I found the lack of a decent SSL support running out off the box, in order to overcome this issue I decided to use Nginx as reverse proxy server to handle and deliver Zenoss with the SSL support. For this example I&#8217;m using Zenoss a debian Native Stack installed on Ubuntu server 10.04</p>
<p>Zenoss download:</p>
<p>http://community.zenoss.org/docs/DOC-3240?noregister</p>
<p>Preparing zenoss:</p>
<p>You need to locate the file zope.conf, which in this case is locate into /usr/local/zenoss/zenoss/etc/zope.conf , and find the line that contains &#8220;# ip-address 127.0.0.1&#8243; and uncomment it as follows.</p>
<p># ip-address 127.0.0.1</p>
<p>to</p>
<p>ip-address 127.0.0.1</p>
<p style="text-align: justify;">After you are saved the zope.conf file you need to restart the Zope server as zenoss user.</p>
<p>su &#8211; zenoss</p>
<p>zopectl restart</p>
<p>Nginx</p>
<p style="text-align: justify;">You need to install Nginx and the openssl utilities, create an ssl directory to store the certificates and create the certificates.</p>
<pre class="brush: bash; title: ; notranslate">

apt-get install nginx openssl

mkdir /etc/nginx/ssl

cd /etc/nginx/ssl

openssl req -new -x509 -days 365 -nodes -out zenoss.pem -keyout zenoss.key
</pre>
<p>zenoss.key zenoss.pem</p>
<p>rm /etc/nginx/sites-enabled/default</p>
<p>touch /etc/nginx/sites-enabled/default</p>
<pre class="brush: bash; title: ; notranslate">

server {
    listen 443 default ssl;
    server_name myserver;

      ssl on;
      ssl_certificate      /etc/nginx/ssl/zenoss.pem;
      ssl_certificate_key  /etc/nginx/ssl/zenoss.key;

location / {
        rewrite ^(.*)$ /VirtualHostBase/https/serveripaddress:443$1 break;
        proxy_pass http://127.0.0.1:8080;
    }
}
</pre>
<p>Restart Nginx before the login.</p>
<p>/etc/init.d/nginx restart</p>
<p>Restarting nginx: nginx.</p>
<p style="text-align: justify;">At this point everything should work smoothly, now you can test your new Zenoss over SSL pointing the browser to https://serveripaddress</p>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2012/03/24/zenoss-over-ssl-with-nginx-reverse-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bits of  python: import a CSV file into a MySQL database.</title>
		<link>http://bailey.st/blog/2012/02/22/bits-of-python-import-a-csv-file-into-a-mysql-database/</link>
		<comments>http://bailey.st/blog/2012/02/22/bits-of-python-import-a-csv-file-into-a-mysql-database/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 23:32:45 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1068</guid>
		<description><![CDATA[This is my first blog post of the series &#8220;Bits of python&#8221;, a journey into the Python programming language done with simple examples. From time to time I&#8217;ll write about Python and Django and how they interact with Unix and Linux systems. All the scripts available are stripped versions of my daily work, mostly file [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bailey.st/blog/wp-content/uploads/2012/02/csvpython.png"><img class="alignnone  wp-image-1071" title="csvpython" src="http://bailey.st/blog/wp-content/uploads/2012/02/csvpython.png" alt="" width="645" height="383" /></a></p>
<p style="text-align: justify;">This is my first blog post of the series &#8220;Bits of python&#8221;, a journey into the <a href="http://python.org/">Python</a> programming language done with simple examples. From time to time I&#8217;ll write about Python and Django and how they interact with Unix and Linux systems. All the scripts available are stripped versions of my daily work, mostly file parsers, databases administration and reporting tools. This first example is about how to import a CSV (Comma-separated values) files into a MySQL database and can be very handy when you work with spreadsheets and databases.</p>
<p style="text-align: justify;">The python modules used in this example are, the <a href="http://docs.python.org/library/csv.html">CSV</a>  and the <a href="http://mysql-python.sourceforge.net/MySQLdb.html">python-mysqldb</a>, the first is already present into python and for the second one you can install it just with apt-get install python-mysqldb.</p>
<p style="text-align: justify;">The sample code consist in three files, presidents.csv, presidents.sql and importCSV.py, can be downloaded from <a href="http://bailey.st/code/bitsofpy/csvintomysql/csvintomysql.tar.gz">here</a>, once downloaded the archive can be unpacked with tar xvfz csvintomysql.tar.gz . Now it&#8217;s time to take a look to our file, let&#8217;s go into csvintomysql directory, cd csvintomysql.</p>
<p>The presidents.csv file is the list of all the presidents of the United States of America and it look like this (the list goes more long):</p>
<p>Presidency , President, Took office, Left office, Party, Home State</p>
<pre class="brush: bash; title: ; notranslate">
1,George Washington,1789-04-30,1797-03-04,Independent ,Virginia
2,John Adams,1797-03-04,1801-03-04,Federalist ,Massachusetts
3,Thomas Jefferson,1801-03-04,1809-03-04,Democratic-Republican ,Virginia
4,James Madison,1809-03-04,1817-03-04,Democratic-Republican ,Virginia
5,James Monroe,1817-03-04,1825-03-04,Democratic-Republican ,Virginia
</pre>
<p style="text-align: justify;">As you can see there are several fields delimited by a comma that need to be exported and inserted into the Mysql database using the python CSV module.</p>
<p style="text-align: justify;">The presidents.sql file is the series of MySQL instruction to create a database called csvdb and a table called presidents. In order to keep simple the creation of the database you need to log into MySQL as root and from the database prompt type:</p>
<pre class="brush: bash; title: ; notranslate">

mysql&gt; source presidents.sql
Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.02 sec)
</pre>
<p style="text-align: justify;">The importCSV.py is the Python script that parse and insert the CSV data into the database, the connection credential are already configured to connect to the database csvdb with csv as user and csv as password. Please note, if you want to modify the credential you need to change the settings in the first place, precisley in the presidents.sql file. Do not use this script in production environment!!!!! till you changed the Mysql login credential for the csv user.</p>
<pre class="brush: python; title: ; notranslate">
#!/usr/bin/python
#simple python csv parser that export Comma
#Separated Value data into a MySQL database.
#phillip@bailey.st
import csv
import MySQLdb
# open the connection to the MySQL server.
# using MySQLdb
mydb = MySQLdb.connect(host='localhost',
    user='csv',
    passwd='csv',
    db='csvdb')
cursor = mydb.cursor()
# read the presidents.csv file using the python
# csv module http://docs.python.org/library/csv.html
csv_data = csv.reader(file('presidents.csv'))
# execute the for clicle and insert the csv into the
# database.
for row in csv_data:

    cursor.execute('INSERT INTO PRESIDENTS(PRESIDENCY ,PRESIDENT \
            ,TOOKOFFICE ,LEFTOFFICE ,PARTY ,HOMESTATE)' \
            'VALUES(%s, %s, %s, %s, %s, %s)',  row)
#close the connection to the database.
cursor.close()
print &quot;Import to MySQL is over&quot;
</pre>
<p>Line 5 and 6 are the import module declaration.</p>
<p>Line 9 to 12 are the MySQL connection credential.</p>
<p>Line 13 prepare the cursor to handle the connection.</p>
<p>Line 16 the csv.reader will read and parse the presidents.csv file.</p>
<p>Line 19 a for loop will be performed.</p>
<p>Line 21 will execute the insert into PRESIDENTS table query.</p>
<p>Line 25 will close the database connection.</p>
<p>You can run the script with:</p>
<p>root@:# python importCSV.py<br />
Import to MySQL is over</p>
<p>After the</p>
<p>mysql&gt; use csvdb;</p>
<p>select * from PRESIDENTS;</p>
<pre class="brush: bash; title: ; notranslate">

+----+---------------------+------------+-----------------------------+------------+------------+-------------------------------------------+---------------+
| id | cur_timestamp       | PRESIDENCY | PRESIDENT                   | TOOKOFFICE | LEFTOFFICE | PARTY                                     | HOMESTATE     |
+----+---------------------+------------+-----------------------------+------------+------------+-------------------------------------------+---------------+
|  1 | 2012-02-22 23:45:05 | 1          | George Washington           | 1789-04-30 | 1797-03-04 | Independent                               | Virginia      |
|  2 | 2012-02-22 23:45:05 | 2          | John Adams                  | 1797-03-04 | 1801-03-04 | Federalist                                | Massachusetts |
|  3 | 2012-02-22 23:45:05 | 3          | Thomas Jefferson            | 1801-03-04 | 1809-03-04 | Democratic-Republican                     | Virginia      |
|  4 | 2012-02-22 23:45:05 | 4          | James Madison               | 1809-03-04 | 1817-03-04 | Democratic-Republican                     | Virginia      |
|  5 | 2012-02-22 23:45:05 | 5          | James Monroe                | 1817-03-04 | 1825-03-04 | Democratic-Republican
+----+---------------------+------------+-----------------------------+------------+------------+-------------------------------------------+---------------+
</pre>
<p style="text-align: justify;">I hope the example will be useful to understand how to work with spreadsheets and CSV data sets. If you have doubts or questions, please leave a comment on the post. All the code is freely available at <a href="http://bailey.st/code/bitsofpy/csvintomysql/"> http://bailey.st/code/bitsofpy/csvintomysql/</a></p>
<p>Best.</p>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2012/02/22/bits-of-python-import-a-csv-file-into-a-mysql-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GPA GNU Privacy Assistant on Xubuntu/Ubuntu 11.10 32 and 64 bits.</title>
		<link>http://bailey.st/blog/2012/02/15/gpa-gnu-privacy-assistant-on-xubuntuubuntu-11-10-32-and-64-bits/</link>
		<comments>http://bailey.st/blog/2012/02/15/gpa-gnu-privacy-assistant-on-xubuntuubuntu-11-10-32-and-64-bits/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 11:00:28 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[privacy]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1061</guid>
		<description><![CDATA[Recently I found some repositories where to get the GNU Privacy Assistant .deb packages suitable for Xubuntu/Ubuntu 11.10 32 and 64 bit. Maybe GPA is a bit outdate compared to Enigmail, but around there&#8217;s still people that like this GTK interface. Below you can find the steps to install it on a 64 or a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bailey.st/blog/wp-content/uploads/2012/02/gpa.png"><img class="alignnone  wp-image-1062" title="gpa" src="http://bailey.st/blog/wp-content/uploads/2012/02/gpa.png" alt="" width="424" height="266" /></a></p>
<p style="text-align: justify;">Recently I found some repositories where to get the<a href="http://www.gnupg.org/related_software/gpa/"> GNU Privacy Assistant</a> .deb packages suitable for Xubuntu/Ubuntu 11.10 32 and 64 bit. Maybe GPA is a bit outdate compared to <a href="http://enigmail.mozdev.org/home/index.php.html">Enigmail</a>, but around there&#8217;s still people that like this GTK interface. Below you can find the steps to install it on a 64 or a 32 bit Ubuntu like system.</p>
<p><strong>Xubuntu 64 bit</strong></p>
<pre class="brush: bash; title: ; notranslate">

https://launchpad.net/ubuntu/oneiric/amd64/gpa/0.9.0-1

wget http://launchpadlibrarian.net/37721679/gpa_0.9.0-1_amd64.deb

dpkg -i gpa_0.9.0-1_amd64.deb

apt-get -f install
</pre>
<p><strong>Xubuntu 32 bit</strong></p>
<pre class="brush: bash; title: ; notranslate">

https://launchpad.net/ubuntu/oneiric/i386/gpa/0.9.0-1

wget http://launchpadlibrarian.net/37717999/gpa_0.9.0-1_i386.deb

dpkg -i gpa_0.9.0-1_i386.deb

apt-get -f install
</pre>
<p>After the installation the GPA can be found in Applications Menu &gt; Accessories &gt; GNU Privacy Assistant.</p>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2012/02/15/gpa-gnu-privacy-assistant-on-xubuntuubuntu-11-10-32-and-64-bits/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Openwrt LuCI web interface SSL management on the WAN interface.</title>
		<link>http://bailey.st/blog/2012/02/08/openwrt-luci-web-interface-ssl-management-on-the-wan-interface/</link>
		<comments>http://bailey.st/blog/2012/02/08/openwrt-luci-web-interface-ssl-management-on-the-wan-interface/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 11:22:58 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1053</guid>
		<description><![CDATA[Openwrt is a Linux firmware that can transform your home wifi router in a powerful network device, with more than 2000 software packages you can have out of the box a firewall, a voip gateway, a VPN server along with many other functionalities. In this short post I&#8217;m going to explain how to enable the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://bailey.st/blog/wp-content/uploads/2012/02/wrt.png"><img class="alignnone  wp-image-1054" title="wrt" src="http://bailey.st/blog/wp-content/uploads/2012/02/wrt.png" alt="" width="561" height="310" /></a></p>
<p style="text-align: justify;">Openwrt is a Linux firmware that can transform your home wifi router in a powerful network device, with more than 2000 software packages you can have out of the box a firewall, a voip gateway, a VPN server along with many other functionalities. In this short post I&#8217;m going to explain how to enable the SSL and the SSH management on the WAN port with the latest OpenWRT firmware (Backfire 10.03.1-RC6).</p>
<p style="text-align: justify;">Assuming your OpenWRT box have a local ip address 192.168.1.1, you can ssh into it with ssh 192.168.1.1 -l root .</p>
<p style="text-align: justify;">Once you&#8217;ve logged in run the following commands to install the SSL support for the LuCI web interface.</p>
<p style="text-align: justify;">opkg update<br />
opkg install luci-ssl<br />
/etc/init.d/uhttpd restart</p>
<p style="text-align: justify;">In the /etc/firewall.user file add the following line</p>
<pre class="brush: bash; title: ; notranslate">
iptables --append input_wan --protocol tcp --dport 443 --jump ACCEPT
</pre>
<p style="text-align: justify;">Please restart the firewall, otherwise the new rule won&#8217;t take effect.</p>
<p style="text-align: justify;">/etc/init.d/firewall restart</p>
<p style="text-align: justify;">Now you are ready to log into your OpenWRT router using the htts://wanaddress .</p>
<p style="text-align: justify;">Enjoy.</p>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2012/02/08/openwrt-luci-web-interface-ssl-management-on-the-wan-interface/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Turnkey-Linux, get running your favourite web apps in minutes.</title>
		<link>http://bailey.st/blog/2011/12/04/turnkey-linux-get-running-your-favourite-web-apps-in-minutes/</link>
		<comments>http://bailey.st/blog/2011/12/04/turnkey-linux-get-running-your-favourite-web-apps-in-minutes/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 22:41:59 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1031</guid>
		<description><![CDATA[The Turnkey Linux is an amazing project of various ready-to-use web applications, 45+ virtual appliances are packaged in multiple build formats, from VMDK disk image with OVF support and an installable Live CD which can be installed on bare metal and virtual machines. The most common appliances provided by Turnkey are LAMP server, Joomla, Drupal, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The <a href="http://www.turnkeylinux.org/">Turnkey Linux</a> is an amazing project of various ready-to-use web applications, 45+ virtual appliances are packaged in multiple build formats, from VMDK disk image with OVF support and an installable Live CD which can be installed on bare metal and virtual machines. The most common appliances provided by Turnkey are LAMP server, Joomla, Drupal, WordPress, MySQL, MediaWiki, Domain controller, File server, Ruby on Rails, phpBB. Non official Turnkey Linux appliances are available on the web, such <a href="http://9while9.com/index.php?option=com_content&amp;view=section&amp;id=13&amp;Itemid=27">Sahana-Eden</a>, <a href="http://9while9.com/index.php?option=com_content&amp;view=category&amp;id=11&amp;Itemid=19">LimeSurvey</a>, <a href="http://9while9.com/index.php?option=com_content&amp;view=section&amp;id=7&amp;Itemid=21">Ampache</a> along with the two intrusion detection solutions <a href="http://snorby.org/">Insta-snorby</a> and <a href="http://bailey.st/blog/smooth-sec/">Smooth-Sec</a>. In this how to, I&#8217;m going to show how to install from scratch  the <a href="http://www.redmine.org/">Redmine</a> Turnkey Linux appliance on a Virtualbox headless Server within minutes. If wondering how to install a Headless Virtualbox server, please check my related blog post on &#8220;<a href="http://bailey.st/blog/2011/06/06/phpvirtualbox-manage-your-virtual-machines-from-anywhere/">phpvirtualbox, manage your virtual machines from anywhere.</a>&#8220;</p>
<p style="text-align: justify;">1) New Virtual Machine (choose a name)</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/1.Redmine.png"><img class="alignnone size-full wp-image-1033" title="1.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/1.Redmine.png" alt="" width="400" height="309" /><br />
</a></p>
<p>2) Allocate the VM memory (512 MB will be fine)</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/2.Redmine.png"><img class="alignnone size-full wp-image-1033" title="2.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/2.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>3) New virtual hard disk (Create a new disk)</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/3.Redmine.png"><img class="alignnone size-full wp-image-1033" title="3.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/3.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>4) Type of the virtual disk (select the VDI, virtualbox default)</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/4.Redmine.png"><img class="alignnone size-full wp-image-1033" title="4.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/4.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>5) Virtual disk allocation (dynamically will be fine in most of the cases)</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/5.Redmine.png"><img class="alignnone size-full wp-image-1033" title="5.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/5.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>6) Virtual disk size . (This is up to you)</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/6.Redmine.png"><img class="alignnone size-full wp-image-1033" title="6.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/6.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>7) Last chance to edit the disk settings.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/7.Redmine.png"><img class="alignnone size-full wp-image-1033" title="6.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/7.Redmine.png" alt="" width="400" height="309" /></a></p>
<p> <img src='http://bailey.st/blog/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Attach the Turnkey Iso appliance.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/8.Redmine.png"><img class="alignnone size-full wp-image-1033" title="6.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/8.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>9)  Start the VM and begin with the installation.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/9.Redmine.png"><img class="alignnone size-full wp-image-1033" title="6.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/9.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>10) Disk partitioning.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/10.Redmine.png"><img class="alignnone size-full wp-image-1033" title="10.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/10.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>11) Commit the disk changes.<br />
<a href="http://bailey.st/blog/wp-content/uploads/2011/12/11.Redmine.png"><img class="alignnone size-full wp-image-1033" title="11.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/11.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>12) Installation complete &#8211; Reboot the system.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/12.Redmine.png"><img class="alignnone size-full wp-image-1033" title="12.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/12.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>13) Enter the new root password.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/13.Redmine.png"><img class="alignnone size-full wp-image-1033" title="13.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/14.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>14) Enter the Mysql root password.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/14.Redmine.png"><img class="alignnone size-full wp-image-1033" title="14.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/14.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>15) Enter the redmine admin password.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/15.Redmine.png"><img class="alignnone size-full wp-image-1033" title="15.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/15.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>16) Enter the redmine admin email address.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/16.Redmine.png"><img class="alignnone size-full wp-image-1033" title="16.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/16.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>17) Once arrived at the confconsolle you can manage your appliance.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/17.Redmine.png"><img class="alignnone size-full wp-image-1033" title="17.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/17.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>18) Point the web browser to the appliance ip address and login with the credentials<br />
previously inserted.</p>
<p><a href="http://bailey.st/blog/wp-content/uploads/2011/12/18.Redmine.png"><img class="alignnone size-full wp-image-1033" title="18.Redmine" src="http://bailey.st/blog/wp-content/uploads/2011/12/18.Redmine.png" alt="" width="400" height="309" /></a></p>
<p>If want to experiment and try other appliances, please visit the <a href="http://www.turnkeylinux.org/">turnkeylinux.org</a> and get your appliance and don&#8217;t forget to give a shout-out to to <a href="https://twitter.com/#!/alonswartz">Alon Swartz</a> and <a href="https://twitter.com/#!/lirazsiri">Liraz Siri.</a></p>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2011/12/04/turnkey-linux-get-running-your-favourite-web-apps-in-minutes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smooth-Sec version 1.3 is out</title>
		<link>http://bailey.st/blog/2011/11/25/smooth-sec-version-1-3-is-out/</link>
		<comments>http://bailey.st/blog/2011/11/25/smooth-sec-version-1-3-is-out/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 08:21:21 +0000</pubDate>
		<dc:creator>pbailey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[smooth-sec]]></category>

		<guid isPermaLink="false">http://bailey.st/blog/?p=1026</guid>
		<description><![CDATA[Yesterday I&#8217;ve released a new version (1.3) of Smooth-Sec, major improvements are Snorby upgraded to version 2.3.11 and Suricata upgraded to version 1.1 stable, compiled with with NFQ support. Download here: https://sourceforge.net/projects/smoothsec/files/SmoothSec-1.3/ For a better communication I&#8217;ve set up a Smooth-Sec mailing list, where everyone can share tips/tricks, ideas and issues related to Smooth-Sec. https://lists.sourceforge.net/lists/listinfo/smoothsec-talk [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Yesterday I&#8217;ve released a new version (1.3) of Smooth-Sec, major improvements are <a href="http://snorby.org/">Snorby</a> upgraded to version 2.3.11 and<a href="http://www.openinfosecfoundation.org"> Suricata</a> upgraded to version 1.1 stable, compiled with with NFQ support.</p>
<p>Download here:<br />
<a href="https://sourceforge.net/projects/smoothsec/files/SmoothSec-1.3/">https://sourceforge.net/projects/smoothsec/files/SmoothSec-1.3/</a></p>
<p>For a better communication I&#8217;ve set up a Smooth-Sec mailing list, where everyone can share tips/tricks, ideas and issues related to Smooth-Sec.</p>
<p><a href="https://lists.sourceforge.net/lists/listinfo/smoothsec-talk">https://lists.sourceforge.net/lists/listinfo/smoothsec-talk</a></p>
<i>Scridb filter</i><!-- Scridb filter-->]]></content:encoded>
			<wfw:commentRss>http://bailey.st/blog/2011/11/25/smooth-sec-version-1-3-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

