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.

 

 

Delhi days ..

Its been almost over 15 days i left Delhi and moved to Pune 2 work for a startup.

One thing i realized during these days is never compare Delhi with any other City of India.

I remember my days of cribbing autowallas in Delhi, trust me they are better than the ones across India. 😛

So am not going to compare anything now as it always ends up me favoring 4 Delhi.

I miss the food, PVR and crazy bunch of my friends with whom i had most awesome days of my life.

Am sure of making a trip soon in January and spend time all around.

Curious case of Redmine Upgrade

Well i call it curious cos i been just told to upgrade Redmine without giving any other details.

some strange situation :–

[php]

$ dpkg -l rails [/php]

gave me nothing (omg my redmine instance running without Rails)

After some googling and #redmine irc channel i figured out like python easy_install and ubuntu/debian ruby uses gem.

So on typing

[php]

$ gem list –local

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
fastthread (1.0.7)
passenger (2.2.11)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rmagick (2.13.1)

[/php]

Told me these are the magical pkgs allready installed.

I also figured out with help of dpkg -l that i have mod_rails(http://www.modrails.com) and ruby 1.8 installed.

I had to spend some time to figure out what is current version of redmine installed on my server.there was a simple way to find that.

[php] $ elinks http://myredmine/admin/info[/php]

Redmine 0.9.6.stable (MySQL) <– this was my configuration.

Then i followed steps provided at http://www.redmine.org/wiki/redmine/RedmineUpgrade

And yes,

I took mysql backup and filebkp too along with changing directory location in my virtualhost.

My 1$ Advice, please install additional plugins one by one from the repo which has latest release of it rather upgrading and moving the plugin from older version of Redmine else you will end up going in lot of shit. Most of the older plugin are still not supported in 1.0.X version of Redmine.

Recovering the deleted JPG files.

Its been some time i posted here, my apology.
It was great last evening as me Achet and Tanya wer out 4 dinner and at same time we been clicking our photos.

Tanya unknowingly deleted all the photographs we had taken that evening and she was feeling way to bad. I knew there must be some way to recover the data and hence i was relaxed.

After googling and speaking with Shastry i figured out the way to recover all the deleted images with a FOSS software name “Foremost”

Installing the software was 2 easy easy like always on ubuntu.

Checking the man of foremost i got basic idea about it.

steps i followed:–

1. installing foremost

[php]$ sudo apt-get install foremost
[/php]

2. Figuring out the device name and mount point

[php]$ mount
[/php]

it told me my drive is /dev/sdb1

3.final execution

[php]$ sudo foremost -t jpg -i /dev/sdb1
[/php]

4.output

I got a directory with name “output” in my current working directory with a subdirectory name “jpg” and i could see all my deleted images there.

I slept at 4 am and woke up at 9 and felt like sharing it with all of you so i wrote about it right away.

Cheers!!

Curious case of denyhost and ssh.

I been using denyhost on my own server and many other boxes i been taking care of.

I was getting error whenever i tried connecting to my server
“ssh_exchange_identification: Connection closed by remote host”

After checking logfile i figured that its happening because of the denyhost. The documentation at the denyhost website explains how to remove the blacklisted Ip

Now i had to find real issue why is my legitimate IP getting blacklisted again and again?

My logfile gave me a Warning

Aug 25 16:39:34 vm27 sshd[13147]: reverse mapping checking getaddrinfo for server62.xyz.net.in [200.99.04.24] failed – POSSIBLE BREAK-IN ATTEMPT!

To get this error removed what i did was, I had to add UseDns no to /etc/ssh/ssd_config file.

This removed warning messages and also i was not getting anymore issue of getting IP blocked from denyhost.

Running your first Ruby on rails application (hello world), on Ubuntu Lucid.

1.Installing Ruby and Ruby on Rails.

$ sudo apt-get install ruby rails

2.Creating first application running on WEBrick server.

      $ rails test
      create  
      create  app/controllers
      create  app/helpers
      create  app/models
      create  app/views/layouts 
      create  config/environments
      create  config/initializers
      create  config/locales
      create  db
      create  doc
      create  lib
      create  lib/tasks
      create  log
      create  public/images
      create  public/javascripts
      create  public/stylesheets
      create  script/performance
      create  test/fixtures
      create  test/functional
      create  test/integration
      create  test/performance
      create  test/unit
      create  vendor
      create  vendor/plugins
      create  tmp/sessions
      create  tmp/sockets
      create  tmp/cache
      create  tmp/pids
      create  Rakefile
      create  README
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  config/database.yml
      create  config/routes.rb
      create  config/locales/en.yml
      create  db/seeds.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/new_rails_defaults.rb
      create  config/initializers/session_store.rb
      create  config/initializers/cookie_verification_secret.rb
      create  config/environment.rb
      create  config/boot.rb
      create  config/environments/production.rb
      create  config/environments/development.rb
      create  config/environments/test.rb
      create  script/about
      create  script/console
      create  script/dbconsole
      create  script/destroy
      create  script/generate
      create  script/runner
      create  script/server
      create  script/plugin
      create  script/performance/benchmarker
      create  script/performance/profiler
      create  test/test_helper.rb
      create  test/performance/browsing_test.rb
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/index.html
      create  public/favicon.ico
      create  public/robots.txt
      create  public/images/rails.png
      create  public/javascripts/prototype.js
      create  public/javascripts/effects.js
      create  public/javascripts/dragdrop.js
      create  public/javascripts/controls.js
      create  public/javascripts/application.js
      create  doc/README_FOR_APP
      create  log/server.log
      create  log/production.log
      create  log/development.log
      create  log/test.log

3.Configure WEBrick (Ruby’s server)

$cd test
$ ruby script/server

=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-08-02 12:40:40] INFO  WEBrick 1.3.1
[2010-08-02 12:40:40] INFO  ruby 1.8.7 (2010-01-10) [i486-linux]
[2010-08-02 12:40:45] INFO  WEBrick::HTTPServer#start: pid=27681 port=3000

To test your ROR configure paste http://0.0.0.0:3000 on your browser.

4.Creating a Controller, I call it hello.

$ ruby script/generate controller hello
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/hello
      exists  test/functional/
      create  test/unit/helpers/
      create  app/controllers/hello_controller.rb
      create  test/functional/hello_controller_test.rb
      create  app/helpers/hello_helper.rb
      create  test/unit/helpers/hello_helper_test.rb

5.Creating an action, I call it hi.

In the file app/controllers/hello_controller.rb, i have added action “hi”


class HelloController < ApplicationController

  def hi
  end

end

6.Creating view for the action "hi"

 $ vim app/views/hello/hi.html.erb


 Hello World!!


Lets test our page again.( Am sure the WEBrick server still running)

on browser paste this --> http://0.0.0.0:3000/hello/hi and you can see your first ROR application in front of you.

Auctex mode in Emacs on Ubuntu(Jaunty)


sudo apt-get install auctex, preview-latex-style

#Once installed add the below mentioned part in your ".emacs" file.

;; Math mode for LaTex (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)

;;mouse scrolling (mouse-wheel-mode t)

;; spellcheck in LaTex mode (add-hook `latex-mode-hook `flyspell-mode) (add-hook `tex-mode-hook `flyspell-mode) (add-hook `bibtex-mode-hook `flyspell-mode)

;; Show line-number and column-number in the mode line (line-number-mode 1) (column-number-mode 1)

;; highlight current line (global-hl-line-mode 1)

Restart Emacs and you have Auctex enabled. 😀

Setting Up Local Ubuntu(Jaunty) Repository via Apt-Mirror.

The article mentions the method to deploy APT-MIRROR so that you can use a local repository in your intranet insted going to internet again.
I will use the local repository IP to 192.100.100.40

Packages required:–
1.Apt-Mirror
2.Apache Webserver (to distribute to whole intranet)
Steps :—

1.Setting up the apt-mirror

$sudo apt-get install apt-mirror
$sudo nano  /etc/apt/apt-mirror <---- (the configuration file of apt-cache)

---------------------------XXXXXXXXXXXXXXXXX--------------------
############# config ##################
#
#set base_path    /var/spool/apt-mirror
# if you change the base path you must create the directories below with
write privileges
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
set defaultarch  
set nthreads     20
set _tilde 0
#
############# end config ##############
deb-i386 http://archive.ubuntu.com/ubuntu jaunty main restricted
universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu jaunty-updates main restricted
universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu jaunty-backports main
restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu jaunty-security main
restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu jaunty-proposed main
restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu
-------------------------XXXXXXXXXXXXX----------------------------------------

I am creating local repo for Jaunty you can replace it with karmic or hardy incase you want a repo of that Disros. In above configuration file what i have done is my source file for
downloading whole package is /var/spool/apt-mirror. I wanted the repository for the 32 bit system so i mentioned deb-i386. You can replace/add deb-amd64 if you want only 32 bit repo or incase
you want repo for both architecture.

2.Dumping the packages in local repository.

$sudo apt-mirror

You will see something like this on your screen/terminal
-------------------------XXXXXXXXX---------------------------------------------
t143@t143-desktop:/var/log$ sudo apt-mirror
Downloading 90 index files using 20 threads...
Begin time: Thu Feb 11 16:32:14 2010
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]...
[11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]...
[1]... [0]...
End time: Thu Feb 11 16:32:18 2010
Proceed indexes: [PPPPPP]
28.0 GiB will be downloaded into archive.
Downloading 29319 archive files using 20 threads...
Begin time: Thu Feb 11 16:32:26 2010
[20]...
--------------------------XXXXXXXXXX--------------------------------

This will take some time as 30 GB downloading takes sometime

3.Clean Up The Local Repo

t143@t143-desktop:$ sudo /bin/bash /var/spool/apt-mirror/var/clean.sh
Removing 157 unnecessary files [13316096 bytes]...
[0%]................done.
Removing 18 unnecessary directories...
[0%]..................done.
3.Mirroring it for the intranet
In case you don not have apache installed
$sudo apt-get install apache2

4.Create A Daily Cron Job

t143@t143-desktop:/var/log$ /etc/cron.d/apt-mirror

#
# Regular cron jobs for the apt-mirror package
#
0 4     * * *   apt-mirror      /usr/bin/apt-mirror >
/var/spool/apt-mirror/var/cron.log

This will make apt-mirror run at 4.00 each day, and it will log to
/var/spool/apt-mirror/var/cron.log.

5. Local Mirrors Accessible Over HTTP

Once apache installed and running

$cd /var/www
$sudo ln -s /var/spool/apt-mirror ubuntu
Now my repo address over intranet will become :--
deb http://192.100.100.40/ubuntu jaunty main restricted universe
multiverse
deb http://192.100.100.40/ubuntu jaunty-updates main restricted universe
multiverse
deb http://192.100.100.40/ubuntu jaunty-backports main restricted
universe multiverse
deb http://192.100.100.40/ubuntu jaunty-security main restricted
universe multiverse
deb http://192.100.100.40/ubuntu jaunty-proposed main restricted
universe multiverse
6.Testing our local repository
lets add this to one of the host computer on intranet
$sudo nano /etc/apt/sources.list
Lets add our local repo address inside it

deb http://192.100.100.40/ubuntu jaunty main restricted universe
multiverse
deb http://192.100.100.40/ubuntu jaunty-updates main restricted universe
multiverse
deb http://192.100.100.40/ubuntu jaunty-backports main restricted
universe multiverse
deb http://192.100.100.40/ubuntu jaunty-security main restricted
universe multiverse
deb http://192.100.100.40/ubuntu jaunty-proposed main restricted
universe multiverse

$sudo apt-get update
here we go we have all the packages coming from our local repository.
cheers!!!