Thursday, 9 August 2012

Adding Django-catalog

Django-catalog
This application was created to organize the objects in a tree structure.

Installation
A. Download

At present, a stable release Django-catalog there, but you can download the development version from the repository on github

pip install django-catalog


Two. Connect the application

To connect the installed Django-catalog, add in your project settings.py configuration file the following contents

INSTALLED_APPS = (
    'Catalog',
    'Catalog.contrib.defaults',

)
Three. Connect URLs applications

Add the URL of the application in the Django-catalog of your project urls.py

To use the scheme to access items on the tree slug

urlpatterns  = patterns ('',
    (r '^ catalog /', include ('catalog.urls.by_slug')),
)

To use the scheme to access elements of a tree on their id

urlpatterns  = patterns ('',
    (r '^ catalog /', include ('catalog.urls.by_id')),
)

4. Creating models

In order to use the directory to create for him a model. Previously, we hooked INSTALLED_APPS application directory implements the basic models and methods of work with them. At this stage, to ensure the health directory, we have enough. Start the synchronization of the database to create a catalog of standard models

python manage.py syncdb

Five. The administrative interface

To fill the catalog of categories and products go to the Django administration interface and select the Manage catalog.

6. The use of templates

Django-catalog is supplied with ready-made templates for the work, which should be enough to start using the directory.

Friday, 3 August 2012

Matrix on terminal

First of all, install cmatrix using the following command:

$ sudo apt-get install cmatrix

After cmatrix is installed, run the followinf command with different options such as, -a, -b, -B, etc

$ cmatrix -b

and what you get is the output. :-)

Terminal music player

For the past two months i have been using terminal(mplayer) to play my
songs, I found it quite interesting to use terminal to play music than
using some other applications. I learnt how to use mplayer and run
songs on it, everytime I had to select a song, then play it and run
the command

mplayer abc.mp3

Then came the issue of playing multiple songs, used

mplayer *.mp3

Then I wanted the songs to play in a random pattern(shuffle). For that
I created a playlist in the directory containing the .mp3 files and
ran command

 find -type f -iname \*.mp3 > demon.txt

and hence a playlist named demon.txt is created, I would run it using
the command

mplayer -shuffle -playlist demon.txt

this would play songs in shuffle pattern. I created a script to play
songs in shuffle. But there was a problem that the script would run
only if the Drive containing .mp3 files and the playlist was mounted,
and if the drive was unmounted it would show error. I then learnt to
Mount drive using terminal commands and making small changes, and made
a script that would play when the drive was unmounted. One can learn
how to mount a drive from terminal from
https://help.ubuntu.com/community/Mount/USB

Now i have finally made a script, that checks whether the .mp3
containing drive is mounted or not, if the drive is mounted it simply
plays song from the playlist demon.txt.
and if the drive is not mounted, the script would fetch another script
in my folders that would unmount the drive and then run the playlist
demon.txt.

Here is the script i use, kept in my home folder
http://202.164.53.122/~daman/scripts/hi.sh

And the other script I use to Mount
http://202.164.53.122/~daman/scripts/demon.sh


I am really happy, removed banshee and rhythm box from my system :D.

Wednesday, 13 June 2012

ways to see text using terminal commands

Following are some ways to display data in different applications using following commands:

To see text in Gedit
demon@demon-pc:~/ gedit text.txt

To see text in vim
demon@demon-pc:~/ vim text.txt

To see text in office(Libre Office)
demon@demon-pc:~/ soffice text.txt

We can use the same for GEANY.

Friday, 8 June 2012

The meeting day

The day started with a little worry about getting less participants .
But as it's said "the show must go on".The meeting started sharp at 12:30.
We had 7-8 new faces among us,the GD members.Most here to get answers about their querries, doubts and some here to learn and experience  something new.
The meeting began with , registration form made by Rimpy ,which attracted students even before the meeting started.
The meeting began with me compering,I began with something the freshers could feel comfortable with.My own experience with windows and linux was the point i started my interaction with, trying to give them a simple idea about LINUX and it being equivalant to windows,and why it should be preferred.
Next was Sandeep's turn to motivate and enlighten them about the vast world of LINUX, they were to peep into.She gave them knowledge about the FOSS(Free and Open Source Softwares), the value of getting softwares free of cost, along with licnec to explore them.
Pesentations made by GD members on their projects like ,BRL-CAD by Devinder and Harman was the element of surprise for Mechanical students present, as they had no idea of a free software that could compete with Autocad .
Jaspreet's persentation was the one that excited students. Sagemath presentation by Priyanka was something I liked.Few good words of advice from a GD hacker,Gagan, with his awesome example comparing Microsoft and Linux, is something not easy to forget and yes it was funny :D
Last came the moment awaited by everyone, HS Rai ,sir giving his speech to the newbies.I have heard so many motivational talks, but the passion he had and his ideology was remarkable.His examples left me speechless,the story of a captain and boat, still makes me remember the day i backed out,and installed windows.:/
The meeting even without much crowd was a big success, the new students liked the presentations and motivated by sir's talks , showed their interest in opensource programming. Some even asked for Ubuntu. :D



Uploading and Downloading from server using terminal

#Uploading something on the server:-

$ scp /home/demon/Desktop/FileName Name@ServerAddress:~/destination/folder/

example:

$ scp /home/demon/Desktop/aa.jpg daman@exp:~/public_html/



#Downloading something from the server:-

$scp Name@ServerAddress:~/public_html/FileName /home/demon/Desktop/

example:

$ scp daman@exp:~/public_html/aa.jpg /home/demon/Desktop/

Friday, 1 June 2012

terminal speaks

Run the following command in the terminal:

$espeak "hello"

the terminal speaks :D

replace the words in "" to get desired speech.