Saturday, June 25, 2011

Using patch and diff commands

Creating patches with diff

Using diff is simple when you are working with single files. To create a patch for a single .
diff -u file1.txt  new.txt  > new_file.patch

For  the directory, use following command:
diff -rupN  directory1/   directory2/   >  dir.patch




Apply  patch  

To apply a patch to a single file, change to the directory where the file is located and call patch:
patch  < dir.patch

you can specify the file on the command line:
patch  file.txt < dir.patch

To remove a patch, use the -R flag, 
patch -R file.txt < file.patch



Thursday, June 9, 2011

Network Manager Error : Device not managed (ubuntu)


I am facing the problem with Network Manager shows  error, with Wired and Wireless connection. When I click on  tetwork connection, It show "device not managed".

Problem Solve :

> First run command on terminal to see the connection status  sudo  lshw -C Network 
 This show ouput like :

sudo lshw -C network
[sudo] password for jagdeep: 
  *-network DISABLED               
       description: Wireless interface
       product: Centrino Wireless-N 1000
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlan0
       version: 00
       serial: 8c:a9:82:5e:e4:e2
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlagn driverversion=2.6.38-8-generic firmware=128.50.3.1 build 13488 ip=192.168.1.34 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn

Tuesday, February 15, 2011

PHP/MySql : Store file path or name in database, file in folder.

Create a file : form.html

<form action=addmembers.php method=post enctype="multipart/form-data">
<table border="0" cellspacing="0" align=center cellpadding="3" bordercolor="#cccccc">
<tr>
<td>File:</td>
<td><input type="file" name="filep" size=45></td>
</tr>
<tr>
<td colspan=2><p align=center>
<input type=submit name=action value="Load">
</td>
</tr>
</table>
</form>


Create another file : addmembers.php
<?

if ($_POST["action"] == "Load")
{
$folder = "images/";

Tuesday, December 14, 2010

Comparison of Oracle, MySQL and Postgres DBMS


Comparison are given below with include all the basic concept :-
Category Problem Assessment
MySQL Oracle8 Postgres
Elementary features Basic data types B C A
SQL C B B
Declarative constraints C A A
Programming abstractions D A C
Generation of ids C A A
National chars B A B
Transactions Transactions D A A
Locks D A A
Multiuser access C A C
Programming in DB

Sunday, November 28, 2010

TMUX – The Terminal Multiplexer

tmux is similar to screen as it lets you run numerous TTY’s in the same terminal window. It enables a number of terminals to becreated, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.
Usecommand for attach after detached to reattached.
$ tmux attach

When tmux is started it creates a new session with a single window and displays it on screen. A status line at the bottom of the screen shows information on the current session and is used to enter interactive
commands.