GÜNGÖR BUDAK

Bioinformatics Analyst at Seven Bridges & PhD Student at METU

Blog

Bioinformatics, web programming, coding in general

Setting Up Mezzanine Projects in AWS

Go to EC2 management console, Security groups and add a Custom TCP inbound rule with port 8000. Select “Anywhere” from the list.

Then follow this to install Mezzanine

Above tutorial is also explains setting up a site record. Mezzanine default site record is 127.0.0.1:8000 which should be 0.0.0.0:8000 in our case. So, enter 0.0.0.0:8000 when you’re asked to enter a site record when you ru

python manage.py createdb

Also, you might still need to provide this site record while running the development server:

python manage.py runserver 0.0.0.0:8000

Next, visit following URL:

http://http://ec2-XX-XX-XX-XX.us-west-2.compute.amazonaws.com:8000

You’ll see the server running in this URL.

Note: The URL is your public DNS given in the instance page.

Getting Started with Your AWS Instance and Installing and Setting Up an Apache Server

Update and upgrade packages:

sudo apt-get update
sudo apt-get upgrade

Install Apache server:

sudo apt-get install apache2

Set up a root folder in home folder and create an index file for testing:

mkdir ~/www
echo ‘Hello, World!’ > ~/www/index.html

Set up your virtual host:

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-www.conf
sudo nano /etc/apache2/sites-available/000-www.conf

Modify DocumentRoot to point your “www” folder in home folder (e.g. /home/ubuntu/www)

And add following lines after DocumentRoot line:

<Directory "/home/ubuntu/www">
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

Enable ”www” site and restart Apache:

sudo a2ensite 000-www
sudo service apache2 restart

Finally, go to your public DNS, something like:

http://ec2-XX-XX-XXX-XX.us-west-2.compute.amazonaws.com/

Sources: SO, DO Community

AWS Start an Instance and Connect to it

Go to EC2 management console

Create a new key-pair if necessary and download it

Launch an instance

Add HTTP security group for web applications over HTTP

Get public DNS

Change permissions on key-pair file:

chmod 400 path/to/your/file.pem

Connect:

ssh -i path/to/your/file.pem ubuntu@PUBLIC_DNS

Note: ubuntu is for connecting an Ubuntu 64 bit instance. It’s different for others

How to Install Mezzanine on Ubuntu/Linux Mint [Complete Guide]

Mezzanine is a CMS application built on Django web framework. The installation steps are easy but your environment may not just suitable enough for it work without a problem. So, here I’m going to describe complete installation from scratch on a virtual environment.

First of all, install virtualenv:

$ sudo apt-get install python-virtualenv

Then, create a virtual environment:

$ virtualenv testenv

And, activate it: $ cd testenv $ source bin/activate

Now, we have our environment set and it only has python and pip installed. Next, we are going to install some necessary packages:

(testenv)$ sudo apt-get install python-pip python-dev python-setuptools python-imaging build-essential

Finally, we can install Mezzanine:

(testenv)$ pip install mezzanine

To start your first Mezzanine project: (testenv)$ mezzanine-project mytest

And create DB and run:

(testenv)$ cd mytest
(testenv)$ python manage.py createdb
(testenv)$ python manage.py runserver

Note that you’ll be asked to create a super user when you’re creating DB, do that.

After you ran your project, go to: http://127.0.0.1:8000/. You’ll visit your first Mezzanine project on your favorite browser. 

How to Clear (or Drop) DB Table of A Django App

Let’s say you created a Django app and ran python manage.py syncdb and created its table. Everytime you make a change in the table, you’ll need to drop that table and run python manage.py syncdb again to update. And how you drop a table of a Django app:

$ python manage.py sqlclear app_name | python manage.py dbshell

Drop tables of an app with migrations (Django >= 1.8):

$ python manage.py migrate appname zero

Recreate all the tables:

$ python manage.py syncdb

Easy!

Taken from SO

Geany Color Schemes Ubuntu

There is a collection of color schemes for Geany as well.

Download it on GitHub and follow the instructions.

You’ll need to extract and copy all the files in colorschemes directory to ~/.config/geany/colorschemes/

Then, restart Geany and go to View -> Editor -> Color Schemes and choose your style.

I’m using Tango.

Source

Install Geany 1.23 on Ubuntu

Geany is a really nice text editor for Ubuntu. I would recommend it with TreeBrowser and some interface coding are color schemes.

But you’ll need the latest version which is 1.23 for now.

To install this version you need to add PPA, also this will keep it updated when you update your system.

Execute following lines one by one:

sudo add-apt-repository ppa:geany-dev/ppa
sudo apt-get update
sudo apt-get install geany

Then, when you start Geany you’ll see “This is Geany 1.23” in status bar.

Source

Install Apache2, PHP5, MySQL & phpMyAdmin on Ubuntu 12.04

First, install apache2:

sudo apt-get install apache2

Then, for it to work: sudo service apache2 restart

For custom www folder:

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/www
gksudo gedit /etc/apache2/sites-available/www

Change DocumentRoot and Directory directive to point to new location. For example, /home/user/www/

Save and see (link here clean URLs not working Laravel 4)

Make www default and disable default:

sudo a2dissite default && sudo a2ensite www
sudo service apache2 restart

Create new file in www

echo "<b>Hello! It is working!</b>" > /home/user/www/index.html

Go to http://localhost/

If you get 403 Forbidden error:

chmod -R 755 /home/user/www/

Next, install php5:

sudo apt-get install libapache2-mod-php5

Enable:

sudo a2enmod php5

Restart apache2:

sudo service apache2 restart

Check if it works:

mkdir ~/www/test
gedit /home/gungor/www/test/index.php

Enter:

<?php echo "It's working"; ?>

Save

Go to http://localhost/test/

Next, install mysql:

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

Set a password 

Finally, install phpmyadmin:

sudo apt-get install phpmyadmin

Select apache2 and then “Yes”, enter your password

Open following and add the line Include /etc/phpmyadmin/apache.conf:

gksudo gedit /etc/apache2/apache2.conf

Restart apache2:

sudo service apache2 restart

Navigate to http://localhost/phpmyadmin/

After all these steps, you should be able to run PHP files on your Apache server and also use MySQL with phpMyAdmin

More on Ubuntu Help