Posts Tagged ‘Ubuntu’

Access MSSQL with Python!!!

April 24th, 2010

I started using Python a while ago and one of the things I need to do is to be able to connect to Microsoft SQL server from Linux servers… Its suprising that only a few projects are alive for it… One of them is the commercial MxODBC from eGenix, while the other is called pymssql… I gave pymssql a try and it worked almost at once on my Ubuntu machine…

First I installed the prerequisites: freetds and the python headers:

aptitude install python2.5-dev freetds-dev

There might be some other packages that are needed but that was the only ones I needed to install…. Then I decompressed the latest release from pymssql at sourceforge and installed:

NOTE : for me the latest package did not work so I used pymssql-0.8.0

tar -xvzf pymssql-0.8.0.tar.gz
cd pymssql-0.8.0
python setup.py install

Now you can test it out by creating your own test script and it is as follows :

import pymssql
conn = pymssql.connect(host='<hostname>', user='<username>', password='<passwd>', database='<dbname>')
cur = conn.cursor()
cur.execute('SELECT * FROM tbABCD')
row = cur.fetchone()
while row:
 print "ID=%s, Name=%s, Address=%s" % (row[0], row[1], row[2])
 row = cur.fetchone()
conn.close()

The script ran perfectly…
For more information on pymssql you can view its documentation here

Tags: , , , , ,
Posted in Techi Gyaan | Comments (0)

Generate Hardware Information on Linux!!!

February 8th, 2010

You can generate a nice report (HTML or XML format) of your laptop/desktop hardware information by executing this command:

lshw -html > sysinfo.html

You may need to install it first… For Debian and Ubuntu users installation is simple..

sudo aptitude install lshw

You can find the detailed information about lshw from the following page: http://www.ezix.org/project/wiki/HardwareLiSter

Tags: , , ,
Posted in Techi Gyaan | Comments (0)

Howto : Twitter from Command Line…

January 25th, 2010

This is a tutorial explaining how to post to Twitter using command-line in Linux, without needing to even open up your web browser….

First, install the curl package:

sudo apt-get install curl

Next, create a script anywhere in your $PATH, for example tweet.sh inside ~/bin, where ~ is your home directory (make sure ~/bin is included in your $PATH variable, in case echo $PATH doesn’t return it, edit ~/.bashrc and add a line like this: export PATH=/home/USER/bin/:$PATH)…

The script tweet.sh should contain the following: Read the rest of this entry »

Tags: , , , , , ,
Posted in Techi Gyaan | Comments (0)

Finally Google Chrome for Mac & Linux!!!

December 9th, 2009

Google released its Chrome Browser for Mac and Linux yesterday… Chrome for Mac/Linux beta doesn’t have all of the features available to Chrome on Windows, and if you’ve been using the dev builds of Chrome before this, you probably won’t notice any significant changes.

Got a chance to play around with it on Ubuntu yesterday night… It is not as noticeably faster than Firefox…. But it is significantly better at managing large amounts (20+) of tabs than Firefox.. Chrome is the first mainstream Webkit Browser for Linux.  Most people won’t have used Konqueror as Firefox is the most popular browser on Linux. Overall, it is a great foundation for an excellent browser future.  It is in my top 3 with Safari and Firefox.

Chrome for Mac/Linux beta is a free download, works with Intel Macs running Leopard or Snow Leopard or Linux PCs.

Google Chrome for Mac
Google Chrome for Linux

Tags: , , , ,
Posted in Techi Gyaan | Comments (0)

Ubuntu 9.10 vs. Mac OS X Snow Leopard vs. Windows 7!!!

November 3rd, 2009

Ubuntu - Apple - Windows
Close
Ubuntu - Apple - Windows

Apple let Snow Leopard out of its cage earlier this autumn, and Canonical will release another beast this week: Karmic Koala, otherwise known as the open-source operating system Ubuntu 9.10. This comes on the heels of Microsoft’s launch of Windows 7, a major update of Vista. So, there are a lot of reasons for us to be excited.

Since I use Mac OS X (dual boot with Xubuntu) on Macbook Pro, Ubuntu on my main workstation, and Windows XP on some of our computers used for our family business, I’m looking forward to these consecutive “big-time” updates. However, I still haven’t made up my mind if I’ll immediately upgrade to the new versions. But I did a little research and collected some important information so that I could somehow find out early on if the upgrades will be worth it.

For all of you, I’m going to highlight the main features of Ubuntu 9.10, Mac OS X Snow Leopard, and Windows 7. I will also share my quick observation later on.

Read the complete story

Tags: , , , , ,
Posted in Assorted Gyaan | Comments (0)

Ubuntu 9.10 “Karmic Koala” (Review)!!!

November 2nd, 2009

A a new Ubuntu release definitely requires a post! Ubuntu 9.10 “Karmic Koala” has been released. There have been some significant changes since that release in April, so read on to find out what they are and why you might want to consider upgrading to Ubuntu Linux 9.10. Read the rest of this entry »

Tags: , ,
Posted in Assorted Gyaan | Comments (0)

How Does Ubuntu 9.04 Measure Up to Mac OS X???

July 24th, 2009

Publication: Linux Magazine

Bucking the historical trend of comparing desktop Linux with Windows, Ubuntu founder Mark Shuttleworth recently told journalist Bruce Byfield that he was looking to Mac OS X as the operating system to beat for future Ubuntu releases — particularly in the areas of usability and user experience.  Now that Ubuntu 9.04 is out, how does it compare to Apple’s latest offering?

The “overall usability” of an operating system is hard to assess because it is so nebulous, but by breaking down the subject into a handful of distinct areas, we can measure Ubuntu’s present status in more meaningful terms.

Read Full Story from here

Tags: , ,
Posted in Assorted Gyaan | Comments (0)

Voice Chat on Ubuntu – Empathy!!!

July 24th, 2009

Empathy consists of a rich set of reusable instant messaging widgets, and a GNOME client using those widgets. It uses Telepathy and Nokia’s Mission Control, and reuses Gossip’s UI. The main goal is to permit desktop integration by providing libempathy and libempathy-gtk libraries. libempathy-gtk is a set of powerful widgets that can be embeded into any GNOME application.

Installation Read the rest of this entry »

Tags: , ,
Posted in Techi Gyaan | Comments (0)

How to Install and Configure Apache Tomcat on Ubuntu!!!

July 17th, 2009

Apache Tomcat is a servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a “pure JavaHTTP web server environment for Java code to run.

Installing and configuring Tomcat on Ubuntu is very easy.

Before starting you need the Java Development Kit (JDK) and not Java Runtime Environment (JRE). Download it from http://java.sun.com as a .bin file and install it on your system or use the command line:

sudo apt-get install sun-java6-jdk

1. Download and install the Tomcat packages (run in terminal):

sudo apt-get install libapache2-mod-jk libservlet2.4-java libtomcat5.5-java tomcat5.5 tomcat5.5-admin tomcat5.5-webapps

2. Open the .bashrc file (run in terminal):

sudo gedit ~/.bashrc

3. Add the following line in the opened file:

export JAVA_HOME=/usr/lib/jvm/java-6-sun

save and close the file.

4. Now make the Logs directory writeable (run in terminal):

sudo chmod -R 777 /var/lib/tomcat5.5/logs

5. To make Tomcat automatically start when we boot up the computer, you can add a script to make it auto-start and shutdown.

sudo gedit /etc/init.d/tomcat

Now paste in the following:

# Tomcat auto-start
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid

export JAVA_HOME=/usr/lib/jvm/java-6-sun

case $1 in
start)
sh /usr/local/tomcat/bin/startup.sh
;;
stop)
sh /usr/local/tomcat/bin/shutdown.sh
;;
restart)
sh /usr/local/tomcat/bin/shutdown.sh
sh /usr/local/tomcat/bin/startup.sh
;;
esac
exit 0

You’ll need to make the script executable by running the chmod command:

sudo chmod 755 /etc/init.d/tomcat

The last step is actually linking this script to the startup folders with a symbolic link. Run the following commands and we are ready.

sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat

sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat

6. To start the tomcat, run the following command:

sh /usr/share/tomcat5.5/bin/startup.sh

7. You can test to see if it’s working, point your browser at:

http://localhost:8180/

A word of precaution: It’s better to avoid running Tomcat as root.
There are many other setting within Tomcat, I think the user should better try them out themselves. Some are:
1) Making Tomcat to run on port 80.
2) Turning off Directory Listings like Index Manager.
3) Check out the Tomcat configuration file and try out something of your own. Only precaution required is that you should not be logged in as root

Cheers :)

Tags: ,
Posted in Techi Gyaan | Comments (1)

Linux newbie guide to installation of LAMP on Ubuntu!!!

July 5th, 2009

The acronym LAMP refers to a set of free software programs commonly used together to run dynamic Web sites or servers Linux, the operating system; Apache, the Web server; MySQL, the database management system (or database server) and Perl, PHP, and/or Python, scripting languages. The LAMP stack is a very popular setup and many websites run on it. Best of all, all four of the tools in the stack are free and open source and really easy to get started with.

For this tutorial, I’m going to be showing you how to install LAMP on Ubuntu 9.04 (Jaunty Jackalope), but the process is very similar for other Linux distributions too.

All the stuff you need is pre-loaded into Ubuntu’s software repositories, and it’s really simple to install everything you need. If you’re doing a new install, you may want to take a look at the server edition of Ubuntu as it allows for a pre-configured profile that you can pick at install time.

You need to install the following packages:

Apache

Install Apache

sudo apt-get install apache2

Testing HTTP Server by open a web browser and enter http://localhost

PHP

Install PHP5

sudo apt-get install php5 libapache2-mod-php5

Stop/Restart Apache

sudo /etc/init.d/apache2 restart

Test the installation

sudo gedit /var/www/testphp.php

Insert this following line into testphp.php file.

<?php phpinfo(); ?>

Save this new file.
Open a web browser and enter http://localhost/testphp.php
Be sure to remove the file afterwards, as it may pose a security risk.

sudo rm /var/www/testphp.php

MySQL

Install MySQL Server

sudo apt-get install mysql-server

MySQL initially only allows connections from the localhost (127.0.0.1). We’ll need to remove that restriction if you wish to make it accessible to everyone on the internet. Open the file /etc/mysql/my.cnf

gksudo gedit /etc/mysql/my.cnf

Find the line bind-address = 127.0.0.1 and comment it out then save the file.
MySQL comes with no root password as default. This is a huge security risk. You’ll need to set one. So that the local computer gets root access as well, you’ll need to set a password for that too. The local-machine-name is the name of the computer you’re working on.

mysqladmin -u root password <newpassword>
mysqladmin -h root@local-machine-name -u root -p password <newpassword>
sudo /etc/init.d/mysql restart

MySQL Administrator

Install MySQL Administrator

sudo apt-get install mysql-admin

Refresh Gnome Panel

killall gnome-panel

Run MySQL Administrator
Applications -> System Tools -> MySQL Administrator

MySQL for Apache HTTP Server

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

To get PHP to work with MySQL, open the php.ini file

gksudo gedit /etc/php5/apache2/php.ini

You’ll need to uncomment the “;extension=mysql.so” line so that it looks like this

extension=mysql.so

Restart Apache

sudo /etc/init.d/apache2 restart

That’s pretty much all the configuration you need to do, so you can now grab any web applications you want and install them.

Cheers :)

Tags: , , ,
Posted in Techi Gyaan | Comments (2)