Thursday, September 27, 2012

Create Own Command in Linux

write

#!/bin/bash

after writing above line write your script and save it and give any name,
give the permission of execute.

now copy your script in /bin directory or /usr/bin directory.

now your are done. open the terminal and type command, name you have given to your script.
own linux command,own command,create own command,create command,create command in linux

Wednesday, September 26, 2012

Remote ROOT access to MySQL

login to mysql

mysql -u username -p password

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'passwd';

now exit from mysql and restart the service of mysql.

remote root for mysql,remote root access to mysql,mysql remote root

Saturday, September 22, 2012

Mysql Database Import/Export Command Line

Export mysql database

          mysql -u username -p database name > filename.sql


Import mysql database

          mysql -u username -p database name < filename.sql


Export all databases from remote server to local machine

          mysqldump -u username -p -h hostname --all-databases > filename.sql
import command for mysql,export command for mysql,import mysql,export mysql,mysql import,mysql export,command line import mysql database,command line export mysql database,mysql database export,mysql database import

Thursday, September 20, 2012

How to run C program in ubuntu

sudo apt-get install build-essential

now open gedit or any other text editor
type your program and save with .c extension.

if your program name is sample.c, type below command

gcc -o sample sample.c

it will create executable file with the name sample.

now, to run the program just type

./sample

it will run your program.
c program ubuntu,ubuntu c program,run c program in ubuntu,run c program

Tuesday, September 18, 2012

Share Ubuntu Printer with Windows

Install Samba and smbfs
          sudo apt-get install samba smbfs

after installation of samba and smbfs open smb.conf
          sudo gedit /etc/samba/smb.conf

find the section
########## Printing ##########


find below lines and do changes as below

# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
    printing = cups
    printcap name = cups

    security = share

after doing above changes now make changes in [printers] section with

          browsable = yes
          guest ok = yes

Save the file and restart the service of samba. Now, go to windows and find the printer.


share printer in ubuntu,share ubuntu printer with windows,share printer with windows,share printer in linux,linux printer sharing,ubuntu printer sharing

Friday, July 13, 2012

Scheduled Backup of Mails in Linux

Majority Linux Users are using Thunderbird Mail Client. now if they need to take auto scheduled back up of mails just need to write the below script and set a cron job for that.

#!/bin/sh
## Script to backup Thunderbird email
## Backup needs a date (stamp)

set -x
x=`date +%d%m%y.%H%M`

## Save space by making sure backup is archived
tar zcf thunderb-mail-${x}.tgz /home/user directory/.thunderbird

## Save the compressed backup to mybackup folder
cp thunderb-mail-${x}.tgz /path to store your backup

## Clean up after, we don't need two copies of the backup
sudo rm ~/thunderb-mail-${x}.tgz



schedule mail backup,mail backup in linux,schedule mail backup in linux,scheduled backup for thunderbird,scheduled backup thunderbird linux,linux scheduled backup in thunderbird

Auto Screenshot in Linux

copy and paste below code and save the file as any name you would like with the extension .sh

#!/bin/sh

import -window root -display :0 -crop 1024x768+25+25 \
   "/path to store screenshot/$(date +%m.%d.%y_at_%H.%M.%S).png"

now move this file in /bin directory and set the scheduled task using cron. if you are using ubuntu you can use scheduled task application also.


auto screenshot,linux auto screenshot,linux screenshot,screenshot script linux,screenshot script