Aside

———- Forwarded message ———-
From: Arulalan T <arulalant@gmail.com>
Date: Tue, Sep 13, 2011 at 5:04 PM
Subject: [kanchilug] SFD’11 Stalls Suggestions
To: KanchiLug <kanchilug@freelists.org>
- Hide quoted text -
Dear All,I hope the SFD 2011 preparation is going on.Here I narrated the list of stalls which will be helpful to the public and students.If you are newbie to sfd and have interest to put stalls,
then the following list may gives you an idea about it.

There are two ways to put stall. 1. Easy way, 2. Medium way.Easy way not even takes more than one hour to prepare to make stall.
How it means, if you know some thing / already used some tools means,
you can make stall by showing slide show / live demo.Medium way means, it needs 2 or 3 people to be combined, need to spend few days
to execution it and need some more hardware resources.Easy Way :
========
SFD goal is reach the foss to the public and students.
So first of all showcase them about what they already know in their M$ os for daily usage.

  1. What is FOSS/ GNU License,
  2. OO / Libre Office Word, Spread Sheet, Presentation, Drawing
  3. GIMP
  4. Inkscape
  5. Languages Introductions (including installation steps in the slides)
    1. Gcc, G++
    2. Ruby, JRuby
    3. Python, Jython, Cython
    4. Php,
    5. Perl,
    6. Bash,
    7. Java (Explain about how to setup/install java. Most of newbies dont know about this)
    8. more
  6. Language Frameworks Introductions
    1. RoR,
    2. Django,
    3. Catelist,
    4. more
  7. Data Bases with GUIs and Shell
    1.  MySql,
    2.  Postgres,
    3.  Sqlite3
    4.  Mongo DB
    5.  DBase
  8. DB Connections from languages
    1. phpMyadmin (GUI)
    2. DB connections Python, Ruby, Perl, Php scripts
  9. CMS (Content Management Systems)
    1. Drupal
    2. Joomla
    3. WordPress
  10. Editors
    1. gedit with its plugins for developers
      1. Auto word completion
      2. Showing in side panel of Python Syntax Error and disobeying PEP8 rules (from ubuntu 11.04)
      3. Snippet
      4. Other languages advantages in gedit
      5. more
    2. VIM
      1. Intro
      2. Its advantage over languages
    3. emacs
      1. Intro
  11. Version Controls (both gui & commands)
    1. Subversion (bleeding edge)
    2. Git
    3. Bazzar
    4. Mercurial
    5. more (show demos by make live changes in images (gimp), audio/video partial edited files and make changes in text files)
  12. Audio Players
    1. MPlayer,
    2. VLC,
    3. Amarok
  13. Video Players
  14. Audio & Video editing tools
    1. Audacity
    2. Pitivi
  15. 3D Compiz effects live demo and its videos
  16. OS Distributions (ubuntu, fedora, centOs, debian, BSD, etc)
  17. KDE environments and its tools
  18. Gnome environments and its tools
  19. Live CD
  20. Live Installation (or slide)
  21. Famous FOSS Tools Like
    1. K3b (Dvd/cd writer) and more
  22. Games
    1. 2D games for kids
    2. 3D games like
      1. Open Arena
      2. Alien Arena
      3. more [1]
  23. Education Tools
    1. Physics & Electronics Simulations
      1. gnusim8085
      2. circuits connections simulation (search in net)
      3. more
    2. Chemistry Simulations (search in net)
    3. Biology
    4. more (Last time Jaya College students showed demo of all these edu tools)
  24. FireFox Addons Demo (If wifi/Internet dongle available)
    1. FireBug
    2. Download Helpers
    3. Live download by firefox addons (in simple way)
    4. Twitter connections/post from firefox
    5. WordPress posts from firefox
    6. more
  25. Tamil in ubuntu / fedora
    1. Full ubuntu environment in tamil
    2. Tamil Key board layouts (both tamil unicode and symphony[english to tamil] type writer)
  26. more

All the above are very basics only. Where ever I mentioned “more”, you can get it more ideas by searching in Internet.
and if you want to know about available specific tools means (for eg education tools, physics, chemistry, etc) I suggest
you to open the Ubuntu Software Centre or synaptic package manager.

You will get more detailed info about available packages/software tools.

[1] http://www.online-game-walkthrough.com/2007/12/top-10-free-linux-3d-games.html

Medium Way :
==========

  1. Multiple Desktops (Single CPU, multi monitors, multi keyboards, multi mouse)
  2. Thin Client Demo
  3. Heart Beats Demo
    1. MySql heart beat
    2. more
  4. Big Blue Button (Lan audio/video/text chat & remote presentation)
  5. VLC (Video Lan Connection demo by making lan video streaming)
  6. Arduino Robotics Demo
  7. Blender (3D animation maker)
  8. more

You can bring your project (if that has done by foss ) and you make stall.
If you want to make stall in sfd means, please mail to list or the MIT students to allot stall for you.

Previous years SFD links :
==================

SFD by ILUGC

http://www.ilugc.in/search/node/sfd
http://www.ilugc.in/content/sfd-2009-ilugc-recap
http://www.ilugc.in/content/sfd-2009-topics-and-volunteers
http://www.ilugc.in/content/software-freedom-day-ilugc
http://www.ilugc.in/content/sfd-2009-photos
http://www.ilugc.in/content/announcing-sofware-freedom-day-celebrations-ilugc
http://www.ilugc.in/content/call-volunteers-demo-stalls-software-freedom-day-2011
http://wiki.ilugc.in/index.php?title=Sfd2011

SFD by Jaya Engg College :
http://www.ilugc.in/content/software-freedom-day-celebraions-jaya-engg-college

SFD by Kanchilug :

http://kanchilug.wordpress.com/2009/09/21/software-freedom-day-2009/
http://kanchilug.wordpress.com/2010/09/21/software-freedom-day/
http://kanchilug.wordpress.com/?s=sfd

From the above links, you can collect the details like,
how to prepare for SFD stalls and how to organize it.

I hope this helps you to make stalls in SFD ’11.
If you have any ideas to make SFD’11 as grand event, you are welcome to share it.

Thanks.

Regards,

Arulalan.T
Project Associate
Centre for Atmospheric Sciences
Indian Institute of Technology Delhi

My Experiments In Gnu/Linux !  : http://tuxcoder.wordpress.com

Kanchi Linux User Group Rocks ! : http://kanchilug.wordpress.com

Reset your MYSQL Password


Hi friends,

After long time, today i thought of use my MYSQL db, But the thing is i’ve forget my password :(  Then i asked to my friend mani, “pls help me mani, i ve to reset my MYSQL password urgently. He gave the simple solution”. :)

Here the i’m posting the simple steps to reset the mysql root password.

Open your terminal and type the following commands.

First we’ve to stop the mysql service,

  $ sudo service mysqld stop
 $ sudo mysqld_safe --skip-grant-tables

( It runs the mysql in safe mode and the “skip-grant-tables ” skips the table which ‘ve the MYQSL  user passwords )

The above command ‘ll start mysql server, now open a another tab in ur terminal and type this command.

$  mysql --user=root mysql  ( It 'll login as root without password)

Now type the below query in myqsl prompt.

Note: change “new-password” to your new password.  :)

> update user set Password=PASSWORD('new-password') WHERE User='root';

That’s all     ve fun :)

Interchange characters in Ruby string


Hi friends,

In ruby we can interchange characters in a string easily by using “.tr” methods this is a good useful method to perform some replace actions on strings.

Returns a copy of str with the characters in from_str replaced by the corresponding characters in to_str.

Here are few examples on this method:

This is the Example for Exchange the strings..tr ‘aeiou’, ‘_
=> “Th_s _s th_ Ex_mpl_ f_r Exch_ng_ th_ str_ngs.
‘This is the Example for Exchange the strings.’.tr ‘a-k’, ‘*’
=> “T**s *s t** Ex*mpl* *or Ex***n** t** str*n*s.”

‘This is the Example for Exchange the strings.’.tr ‘a-z’, ‘s’
=> “Tsss ss sss Essssss sss Esssssss sss sssssss.”

‘This is the Example for Exchange the strings.’.tr ‘aeiou’, ’5′
=> “Th5s 5s th5 Ex5mpl5 f5r Exch5ng5 th5 str5ngs.”

தமிழ்நாடு அரசு வழங்கும் இலவச கணினியில் லினக்ஸ் (அ) விண்டாஸ்? அரசு இதை கவனிக்குமா???


வணக்கம்,

பள்ளி மற்றும் கல்லூரி மாணவர்களுக்கு தமிழ்நாடு அரசு இலவசம் மடிக்கணினி வழங்கவிருப்பது பெரும் மகிழ்ச்சி அளிக்கும் செய்தி. அரசின் இந்த திட்டத்தின் மூலம் மாணவர்கள் தகவல் தொழில்நுட்பம் மற்றும் அதன் சம்பத்தப்பட்ட வளர்ந்துவரும் புது தொழில்நுட்பங்களை கற்றுத்தேற எதுவாக இருக்கும். அதே சமயம் இது கணிணி அறிவை மாணவர்கள் மூலம் மக்களுக்கும் ஏற்படுத்தும் என்பது மேலும் போற்ற கூடிய ஒன்றாகும்.

Read more >>

Find Web browser user agent using rails 3


Hi friends,

In rails 3 there is a easy way to Detect the web browser user agent . :)

By adding the one line in the controller page, we can get the UA.(@user_agent = request.env['HTTP_USER_AGENT'])

In /app/controllers/users_controller.rb

def index
 @users = User.all
  @user_agent = request.env['HTTP_USER_AGENT']

In /app/views/users/index.html.erb

<%= @user_agent %>

That’s All !!!  :) :) :)

GitHub Link: https://github.com/thasuresh/find_user_agent

Live Example On Heroku: http://findua.heroku.com/

Ex snaps for various Web browsers:

This slideshow requires JavaScript.

Multiple File uploading in Rails3 Application using “Papercilp”


Hi friends,

Lets see how to upload multiple files in a rails 3 application.

First create a new rails project and go inside of the project directory.

$ rails new fileuploading
$ cd fileuploading

Add the Gms in  following “Gemfile”

gem ‘nifty-generators’
gem ‘paperclip’


source 'http://rubygems.org'

gem 'rails', '3.0.3'
gem 'nifty-generators'
gem 'paperclip'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'.....

And  bundle install it.

Now we have to create a scaffold. Do a following commands.

 $ rails g nifty:scaffold Post title:string
 $ rails g nifty:layout

It asks a Permission to Overwrite the layout file. just press “y”.  It shoes like,
Overwrite /home/suresh/deal_projects/paperclip-test/app/views/layouts/application.html.erb? (enter “h” for help) [Ynaqdh]

Again migrate with db.

 $ rake db:migrate
 $ rm public/index.html
Then, Add the following line in  your /config/routes.rb , root :to => “posts#index”
Then, create a model called “Asset”
$ rails g model Asset asset_file_name:string asset_content_type:string asset_file_size:integer asset_upload_at:datetime post_id:integer
$ rake db:migrate

Now in model folder, there is a file called “asset.rb”. Add the following lines into this file.

class Asset < ActiveRecord::Base
belongs_to  :post
has_attached_file  :asset, :styles => {  :large => "640*480",  :medium => "300*300>",  :thumb => "100*100>" }

end

And add the following lines into “posts.rb” file

class Post < ActiveRecord::Base
attr_accessible :title, :content,  :assets_attributes
has_many  :assets
accepts_nested_attributes_for  :assets,  :allow_destroy  => true
end

Edit app/controller/posts_controller.rb (Note the new and edit part)


def new
@post = Post.new
5.times { @post.assets.build }

end

def edit
@post = Post.find(params[:id])
5.times { @post.assets.build }
end

Edit and add the following lines in your app/view/post/_form.html.erb

<%= form_for @post, :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>

<% f.fields_for :assets do |asset_fields| %>

<% if asset_fields.object.new_record? %>
<p>
<%= asset_fields.file_field :asset %>
</p>

<% end %>
<% end %>

<% f.fields_for :assets do |asset_fields| %>
<%unless asset_fields.object.new_record? %>

<p>

<%= link_to image_tag(asset_fields.object.asset.url(:thumb)), asset_fields.object.asset.url(:original) %>

<%= asset_fields.check_box :_destroy %>
</p>

<% end %>
<% end %>

<p><%= f.submit %></p>
<% end %>

That’s All .

In tour terminal run ” rails s” command and open the “http://localhost:3000” in your browser. :)

Selecting the files

Uploaded into project :)

GitHub Link:  https://github.com/thasuresh/fileuploading
 
My hearty thanks to: http://www.emersonlackey.com/article/paperclip-with-rails-3
 
 
Aside

Hi friends,

At 1991, Linus Torvalds, released his Kernel as open source. After that, the Linux Revolution happened.

To celebrate the 20 years of Linux, The Linux Foundation, is doing various activities.
Explore it here. http://www.linuxfoundation.org/20th
It released an animation video.

My Brother T.Shrinivasan wanted to translate the video in tamil. So he asked his friend to transcribe the audio as English text. He then also asked me to  convert the English text into Tamil text.

Here the original English version video:

http://www.youtube.com/watch?v=5ocq6_3-nEw

Here the tamil version of the above video:
http://www.youtube.com/watch?v=gZKI0u18iLQ

More info: http://goinggnu.wordpress.com/2011/05/14/celebrating-20-years-of-linux-a-tamil-video/

:) :) :)

Google maps in Rails3 Application — Sample Application


Hi friends,

(New update: For new version(0.9.1) check Jay’s comment below)

(Update: this tutorial works only on gem version 0.7.7 and won’t work on latest gem version 0.8.7)

Using a gmaps4rails gem to display a map in our application

create a rails application using,

$ rails new gmaps

$ cd gmaps

Add this Gem in your Gemfile

gem ‘gmaps4rails’, ’0.7.7′

Now bundle it ($ bundle install )and migrate with db ( $ rake db:migrate)

Create a scaffold using,

$ rails g scaffold Location name:string address:string longitude:float latitude:float

remove the longitude and latitude fields in _form.html.erb

After that, add this in app/view/layout

<%= yield :head %> (in your header) <%= yield :scripts %> (in your footer)

/app/views/layouts/application.html.erb

<html>
<head>
  <title>Googlemap</title>
  <%= stylesheet_link_tag :all %>
  <%= javascript_include_tag :defaults %>
  <%= csrf_meta_tag %>
  <%= yield :head %>
</head>
<body>
<%= yield %>
<%= yield :scripts %>
</body>
</html>

In model /app/models/location.rb to add

class Location < ActiveRecord::Base
 acts_as_gmappable
      def gmaps4rails_address
          address
      end
       def gmaps4rails_infowindow
         "<h4>#{name}</h4>" << "<h4>#{address}</h4>"
     end
end

add the line in controller /app/controllers/locations_controller.rb

def index
    @locations = Location.all
    @json = Location.all.to_gmaps4rails
    ..........

In your view app/views/locations/index.html.erb to add a last line as

<%= gmaps4rails(@json) %>

then start the server(http://localhost:3000/locations) to put the name and address, longitude and latitude as set automatically, then will be show the markers as corresponding address and click the marker icon.it will shows infowindow as name and address

That’s it!! If you have any questions please feel free to contact me. I will be happy to help where I can.  :)

Map View

My Sample Application:

http://gmaps4rails.heroku.com

GitHub:

https://github.com/thasuresh/gmaps_project

Ref Link:

http://www.youtube.com/user/TheApneadiving

Google Maps In Rails3 Application


Hi friends,
There is a Ruby Gem Called “gmaps4rails”.

Using a gmaps4rails gem to display a map in our application.

I’ll show  the procedure to integrate this into the rails application in my next article :)

Sending One Time Password via SMS Using Rails3 and SMSAPI


Hi friends,

My need was send one time password via e-mail/sms ,who registered with their E-mail/mobile no.

Lets see “How to send SMS using Rails3 application and smsAPI”

At first we need a smsapi to send SMS via Rails3 application. There is a site, which provides FREE API to send SMS via programming. So, here we need to register with your Domain and mail-id. They also provide codes for various languages :)

EX code for RUBY:

require 'net/http'
require 'uri'
Net::HTTP.get_print URI.parse('http://s1.freesmsapi.com/messages/send?skey=8c0185641435ac8a43cf10230a1417ac&message=YOUR_MESSAGE&senderid=YOUR_SENDERID&recipient=MOBILE_NUMBER')

We just modify the code, what ever our application needs,

require 'net/http'
require 'uri'
pass = "Hi+This+is+ur+one+time+passwd:" + rand(999999).to_s
mobile = ARGV.shift
url = "http://s1.freesmsapi.com/messages/send?skey=9600152989freesmsaPI&message=#{pass}&senderid=slash&recipient=#{mobile}"
Net::HTTP.get_print URI.parse(url)
Then create a new rails project using,
  $ rails new sms
Go to project directory using,
  $ cd sms
Create scoffold using,
  $ rails generate scaffold name:string phone:string
Now, we have to edit the user controller
  $ gedit /app/controller/users_controller.rb
# POST /users
# POST /users.xml
def create
@user = User.new(params[:user])

smspasswd

respond_to do |format|
if @user.save
format.html { redirect_to(@user, :notice => 'User was successfully created.') }
format.xml  { render :x ml => @user, :status => :created, :location => @user }
else
format.html { render :action => "new" }
format.xml  { render :x ml => @user.errors, :status => :unprocessable_entity }
end
end
end
Now, we have to write a small def function into that “usres_controller.rb” file
# POST /users
# POST /users.xml
def create
@user = User.new(params[:user])

smspasswd  #Note this Function

respond_to do |format|
if @user.save
format.html { redirect_to(@user, :notice => 'User was successfully created.') }
format.xml  { render :x ml => @user, :status => :created, :location => @user }
else
format.html { render :action => "new" }
format.xml  { render :x ml => @user.errors, :status => :unprocessable_entity }
end
end
end

def smspasswd
name = @user.name
pass = "Hi+#{name},+This+is+ur+one+time+passwd:" + rand(999999).to_s
phone = @user.phone
url = "http://s1.freesmsapi.com/messages/send?skey=8c0185641435ac8a43cf10230a1417ac&message=#{pass}&senderid=slash&recipient=#{phone}"
Net::HTTP.get_print URI.parse(url)

end
That’s all
Sample Application: http://send-sms.heroku.com
Download from GitHub link: https://github.com/thasuresh/sms
Note:
      But, This “freesmsapi” does not work with the numbers who activated DND support. :(