atul jha

koolhead17

Menu Close

Month: March 2011

Python Local Enviornment setup on Ubutnu

I have never coded in my life so its time to learn and do sumthing !!
In my previous Job where i was supposed to code in Python and i was not quick enough to do that, i came to know about this Virtualenv funda.

We need a virtual environment so that we can install certain Python software which we need for specific application, like Python Django framework which has its on deps and which might break other current apps which uses older version of it.

sudo apt-get install python-virtualenv

Suppose you want to create a directory name “pywrk” and this to work on your python virtual environment simply map this directory to virtualenv

$pwd
/home/atul/pywrk
$which python
/usr/bin/python

Lets setup virtualenv now for this directory
$ virtualenv ~atul/pythonwrk/
$ source ~atul/pythonwrk/bin/activate

So we have our own python local environment setup. We can install modify add all packages inside this directory and it will be served for our local environment.

spellchecker in (OO) open-office on ubuntu !!

After 2 hrs of brain storming on weekend in my office finally got spell checker working for my open office 3.2 on ubuntu 10.04. i had to take expert help from Hobbes, nigleb and lastly Indranil dada and it worked.

sudo apt-get install hunspell  myspell-en-us openoffice.org-help-en-us

Once this is installed  open a open office document and TOOLS -> OPTIONS –> LANGUAGES

 

Once this is done check WRITING AIDS and do as screen shot does.

Restart your open-office and you will have spell checker working.

Setting up Monit (On Ubuntu) ..

Apart from playing with the Source Code Open Source Software has given us.

Installing Monit :–

 

sudo apt-get install monit

This command will install Monit on Ubuntu.

In order to Start the Monit we need to edit file  “/etc/default/monit” and set the  “startup= 1”

This will start the Monit, but we need to do the real work inside the “/etc/monit/monirc”  file, and mention what all services we want to be monitored.

I have simply added a script for monitoring my Nginx Server

check process nginx with pidfile /var/run/nginx.pid
start program = “/etc/init.d/nginx start”
stop program  = “/etc/init.d/nginx stop”
group www-data

But before that we need to enable few other services as well like:–

set daemon  20           # check services at 2-minute intervals

set logfile syslog facility log_daemon    #for log analysis

set httpd port 2812 and
use address localhost  # only accept connection from localhost
allow localhost        # allow localhost to connect to the server and
allow admin:monit      # require user ‘admin’ with password ‘monit’
#     allow @monit           # allow users of group ‘monit’ to connect (rw)
#     allow @users readonly  # allow users of group ‘users’ to connect readonly

 

Once am done with this i will restart monit and see the status on localhost:2812 , we will see the status saying nginx is running.

let kill or stop Nginx and see the same url, you will see a message saying Nginx is stopped.

 

As we have asked the monit to check and restart the service at 2 minutes, you will see the process up and running again.

 

 

© 2017 atul jha. All rights reserved.

Theme by Anders Norén.