Search This Blog

Friday, May 25, 2012

Network icon disabled in ubuntu 11.10/12.04


Firstly, stop the network manager service by typing in terminal:

sudo service network-manager stop



Open nautilus in sudo mode by typing in terminal:

sudo nautilus

Goto etc/NetworkManager and open  NetworkManager.conf.
Change the managed value to true:


Restart the Network Manger service by typing in:

sudo service network-manager start

And after that your Network Manger should be back online.

Source: http://solancer.blogspot.in/2011/10/network-icon-disappeared-in-ubuntu-1110.html

Wednesday, May 23, 2012

Jquery Version conflict

 

I am trying to use the Nivo JQuery Slider (http://nivo.dev7studios.com/) and a Scrollable Gallery (http://flowplayer.org/tools/demos/scrollable/index.html).

Now I have run into a problem, basically the Nivo Slider uses this JQuery Library:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> 

and the Scrollable Gallery uses this one:

<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>

When both are enabled, only the thumbnail gallery works (because it's script import is done after the nivo's), when the 1.42 version is enabled only the Nivo works, and when only the 1.2.5 version is enabled only the Scrollable Gallery Works.

What should I do?

Solution:

up vote 5 down vote accepted

use this solution if you cannot use a single jQuery file for both the plugins:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
 
var jQuery_1_4_2 = jQuery.noConflict();
</script>
<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>

To use jQuery 1.4.2, put the code using it in a SEF (Self Executing Function) like this:

(function($){
   
//code using jQuery 1.4.2
   
//here the $variable will be the jQuery object of 1.4.2
})(jQuery_1_4_2)

For jQuery 1.2.5, you can use $ variable directly.

UPDATE: Based on your comment, following is the way to use it.

If you want to use jQuery 1.4.2, use jQuery_1_4_2 object
For example: jQuery_1_4_2("#abc").slider(options)

If you want to use jQuery 1.2.5 use $ or jQuery object
For example: $("#abc").scrollable(options)



Source: http://stackoverflow.com/questions/6332111/jquery-version-conflict


Friday, May 18, 2012

Reliance Netconnect Broadband+ on Ubuntu

Reliance datacard to work perfectly on Ubuntu 10.04

1. First of all open up the terminal and run the following command

sudo apt-get update

2. Now we need to install wvdial so run the following command

sudo apt-get install wvdial

3. Now we need to install libusb-dev so run the following command

sudo apt-get install libusb-dev

4. Now we need to download usb-modeswitch and usb-modeswitch-data so go to the following links

usb-modeswitch usb-modeswitch-data . Download both the files and save them on your computer .

5. Now extract both the files and and go to extracted directories on by one (first go to usb-modeswitch). and run the following command as root

sudo make install

6. Now run the following command

sudo gedit /etc/usb_modeswitch.conf

and it will open gedit and paste the following text in it and save the file

# Configuration for the usb-modeswitch package, a mode switching tool for
# USB devices providing multiple states or modes
# This file is evaluated by the wrapper script "usb_modeswitch" in /lib/udev
# To enable an option, set it to "1", "yes" or "true" (case doesn't matter)
# Everything else counts as "disable"
# Disable automatic mode switching globally (e.g. to access the original
# install storage)
DisableSwitching=0
# Enable logging (results in a extensive report file in /var/log, named
# "usb_modeswitch_"
EnableLogging=1
# Huawei, newer modems
DefaultVendor= 0x12d1
DefaultProduct=0x1446
TargetVendor= 0x12d1
TargetProduct=140b
CheckSuccess=5

Now run the following command and it will again open gedit and paste the above text in it again and save it

sudo gedit /etc/usb-modeswitch.conf

7. Now run the following commands

sudo gedit /etc/wvdial.conf

it will again open gedit and you need to paste the following text in it.

[Dialer netconnect]
New PPPD = yes
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Username = 93********
Password = 93*********
Phone = #777
Stupid Mode = 1
Auto DNS = 1
Check Def Route = 1

change the username and password with your 10 digit MDN number given on the box of datacard.
8. Now Save the file and reboot the computer. After reboot plugin your datacard and wait for 5 to 6 seconds . Now run the following command

sudo wvdial netconnect

you should see something like below after running the above command

--> Using interface ppp0
--> local IP address 115.242.127.250
--> remote IP address 220.224.141.129
--> primary DNS address 202.138.97.193


Source: http://harbhag.wordpress.com/2010/09/14/reliance-netconnect-broadband-on-ubuntu/

sudo: must be setuid root

This error means: permissions of the sudoers file has been changed.

Solution:

Boot into Recovery Mode and enter a shell prompt. Then run these two commands.
    chown root:root /usr/bin/sudo  chmod 4755 /usr/bin/sudo


To boot in recovery mode :
Hold the shift key down as soon as you poweron the computer. Silly grub2 hides menu by default unless it detects multiple OS.

Check permissions on this:

Code:
ls -la /etc/sudoers  -r--r----- 1 root root 828 2010-08-03 11:19 /etc/sudoers
To modify if permissions are wrong:
Code:
chown root:root /etc/sudoers
Code:
chmod 440 /etc/sudoers
Source: http://ubuntuforums.org/showthread.php?t=1548164

Tuesday, May 15, 2012

How to Install firefox 12 in ubuntu linux


A. Install Firefox 12 in 5 easy steps

1. Download

Download the release from the official channels page:
www.mozilla.com/firefox/channels/
A 64 bit build is also available in the x86_64 directory of Mozilla's FTP.

This how-to supposes that the downloaded file is saved in the "Downloads" directory situated in your home directory.

2. Extract

The downloaded file is a compressed .tar.bz2 archive. In case you want to Learn more on these extensions: tar, bzip2. To extract this juicy archive, open the Downloads directory. Look for a file named firefox-12.0.tar.bz2, right-click on it and select "extract here".

Alternatively, you can extract the archive from the command line:
cd ~/Downloads/
tar xjf firefox-12.0.tar.bz2

For those interested, here are the tar arguments used in the command:
x : eXtract
j : deal with bzipped file
f : read from a file (rather than a tape device)

The firefox-12.0.tar.bz2 archive can now be deleted.

3. Move to /opt

External programs like LibreOffice, Google Chrome, Adobe reader, ... are all installed in the /opt directory. If you want more info about why /opt, check out these two links:
Where to install my products on linux?
Filesystem Hierarchy Standard

If you already had a previous Firefox version installed in the /opt directory, remove it with the following command:
sudo rm -r /opt/firefox

Now move the firefox directory (which was created in your Downloads folder during extraction) to /opt:
sudo mv firefox /opt/firefox12

4. Set up symbolic links

Depending on you usage pattern, follow the instructions for case 1 OR for case 2.

Case 1: you want to use Firefox 12 as you default browser:

"Backup" the old Firefox launcher:
sudo mv /usr/bin/firefox /usr/bin/firefox-old

Create a symbolic link pointing to the new Firefox version:
sudo ln -s /opt/firefox12/firefox /usr/bin/firefox

No need to update your icons/shortcuts, they should now launch the new version of Firefox.

Your old Firefox version is still installed. If you want to use it, run firefox-old in a terminal or create shortcuts/icons referring to firefox-old.

Case 2: you want to keep using your "old" Firefox by default:

Create a symbolic link pointing to the new Firefox version:
sudo ln -s /opt/firefox12/firefox /usr/bin/firefox12

Launch the newly installed Firefox by running firefox12 in a terminal, or create shortcuts/icons referring to firefox12.

5. Updates & Final

Firefox 12 will manage its own updates independently of your system's package manager, an download subsequent releases. There will be no need to repeat the whole "procedure"... Enjoy Firefox 12!


Monday, April 16, 2012

How to restrict website using firestarter

Qs. Can we restrict website access using firestarter. The requirement is
as follows:
We are using a internet shared system using firestarter. This system
is kept for public use in a museum. The administrator over there wants
only access to 2-3 websites which is related to the museum rest site
should be accessible. Can we do it through firestarter?

Ans: To restrict all websites except few, provide the websites in "Outbound traffic policy" -> Restrivticve by default" -> "Allow connectiosn to host"
The websites listed under this site only will be allowed now and all other websites are restricted

Thursday, April 12, 2012

Backing Up and Restoring A MySQL Database

This tutorial explains the how to backup and restore the MySQL Database. Databases are used to store large amount of precious data and it becomes very important to Backup your data. In case case of some hardware or software failures  backup data can be used to restore the Database.

Backing Up MySQL Database

MySQL database backup can be accomplished in two ways:

a) Copying the raw mysql database files &
b) Exporting tables to text files

Copying the MySQL database files

MySQL uses the same table format on different platforms, so it's possible to copy MySQL table and index files from one platform and use them on another without any difficulties (assuming, of course, that you're using the same version of MySQL on both platforms).

Exporting tables to text files

The MySQLDump is handy utility that can be used to quickly backup the MySQL Database to the text files. To use the MySQLDump utility it is required to logon to the System running the MySQL Databse. You can use Telnet to remotely logon to the system if you don't have the physical access to the machine.

The syntax for the command is as follows.

mysqldump -u [Username] -p [password] [databasename] > [backupfile.sql]
[username] - this is your database username
[password]- this is the password for your database
[databasename] - the name of your database
[backupfile.sql] - the filename for your database backup

Let's discuss the example of backing up MySQL Database named "accounts" into text file accounts.sql. Here are the scenarios of taking the backup assuming that both user name and password of the database is "admin".

a) Taking the full backup of all the tables including the data.
Use the following command to accomplish this:
mysqldump -u admin -p admin accounts > accounts.sql

b) Taking the backup of table structures only.
Use the following command to accomplish this:
mysqldump -u admin -p admin --no-data accounts > accounts.sql

c) Taking the backup data only.
Use the following command to accomplish this:
mysqldump -u admin -p admin --no-create-info accounts > accounts.sql

Restoring MySQL Database

Restoring the MySQL is very easy job. You can use the following to command to restore the accounts database from accounts.sql backup file.

mysql - u admin -p admin accounts < accounts.sql

In this tutorial you learned how to take the backup of your MySQL Database and restore the same in the event of some database crash or on some other machine.


Source: http://www.roseindia.net/mysql/mysql_backup_restore.shtml

How to get mysql Database dump and restore database


1.You can use following commands for taking mysql dump in .sql format
go to /var/lib/mysql

search for the database whose dump you want.

ls -l | grep database_name

mysqldump database_name > database.sql

2. If the mysql dumpis available and you want to restore that you need to use following command for that

cd /var/lib/mysql

check the database name where you want to restore the mysqldump
ls -l | grep database_name

mysql database_name < database.sql


Tuesday, April 10, 2012

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


First: Make sure that the owner of /var/lib/mysql and its files and subdirectories is mysql user of mysql group

to do that run the following command:

chown mysql.mysql -R /var/lib/mysql/*

Second: change write permissions to rwxr-xr-x (755) for mysql directory, and all its files and subdirectories, by running the following command:

chmod 755 -R /var/lib/mysql/*

now start mysql service by running the following command (Red Hat and may fedora):

service mysql start


the error message should disappear and should output:
Starting MySQL. [ OK ]

Source: http://forums.mysql.com/read.php?11,27769,213014

Sunday, April 1, 2012

how to checkout file/folder from svn


1. In svn is not installed, install it by following command

     sudo apt-get install subversion
2. Now to download file/folder user following command
   
 $svn checkout url_path_of_file/folder

eg to download speech_tools from 
svn://svn.berlios.de/festlang/trunk/speech_tools  use following command 

$svn checkout
svn://svn.berlios.de/festlang/trunk/speech_tools
  

Friday, March 16, 2012

How to restore MySQL database from sql dump file?

There are 2 ways to restore your MySQL database from sql dump file.

1st way to restore mysql database from sql dump file is using mysql web control panel – phpMyAdmin
- Log into phpMyAdmin.
- Select your preference database on the left database navigation drop down list.

- Click on Import tab on the top.
- Select your sql dumb file at File to import
- Then select your mysql database charset (ex: Latin1, utf-8)
- and click GO and it's done!

Do not use phpMyAdmin to import or restore your MySQL database if your MySQL database file is large. This is because, phpMyAdmin has limit on total upload size which depend on php setting. Besides, there is also maximum execution time which may cause browser to time out.

The solution to restore large mysql database from sql dump file is using unix/linux shell command.
To restore mysql database from a dump file, just type the command below:-

mysql -u #username# -p #database# < #dump_file#

Of course you need to replace #username# to your database username and #database# to your target database. and rename #dump_file# to your dump file file name (Ex: dump.sql) Once you enter the command, the linux/unix shell will prompt you for your database user password, just key in your database password and you are done.

Source: http://www.techiecorner.com/31/how-to-restore-mysql-database-from-sql-dump-file/

Enabling .htaccess file in Linux

Enabling .htaccess file

.htaccess file is a powerful file that can be used to control and customize a site server behavior without editing the core Apache module. By default, the .htaccess functionality is turned off and all instances of .htaccess files are completely ignored. The server will not even attempt to read .htaccess files in the filesystem.

To enable .htaccess file, open up the settings file that you have created earlier:

gksu gedit /etc/apache2/sites-available/default

Scroll down the file until you see the part "<Directory /home/user/public_html/>". Underneath that line of code, change AllowOverride None to AllowOverride All.

apache-allowoverride

Save and exit the file.

In case of local host you may found above section of code as follows:


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
#RedirectMatch ^/$ /apache2-default/

Also, if you need to use rewrite rules you need to enable them first. You do that with the following command.

sudo a2enmod rewrite
Prior to running that command you may get an error similar to the following.
[Tue Apr 14 14:23:34 2009] [alert] [client 127.0.0.1] /var/www/wiki/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Finally, don't forget to restart Apache.

sudo /etc/init.d/apache2 restart

Friday, February 17, 2012

Restore point in Linux

Do we have any feature in BOSS O.S.such that we can make some restore point of the system and all the installed softwares come automatically such as Recovery point in windows?

Ans: You can get some idea from here 

http://superuser.com/questions/163716/is-there-a-restore-point-in-linux-debian-ubuntu-like-windows


Wednesday, February 8, 2012