Thursday, December 26, 2013

Rename DBName in MySQL

Wednesday, December 4, 2013

How to Share Files Between Windows and Linux

Saturday, August 17, 2013

Unix commands

Displaying The Contents of Files

To read or read the contents of files, enter:
$ cat /etc/passwd

The above command will display the contents of a file named /etc/passwd. By default cat will send output to the monitor screen. But, you can redirect from the screen to another command or file using redirection operator as follows:
$ cat /etc/passwd > /tmp/test.txt
In the above example, the output from cat command is written to /tmp/text.txt file instead of being displayed on the monitor screen. You can view /tmp/text.txt using cat command itself:
$ cat /tmp/test.txt

Concatenate files

Concatenation means putting multiple file contents together. The original file or files are not modified or deleted. In this example, cat will concatenate copies of the contents of the three files /etc/hosts, /etc/resolv.conf, and /etc/fstab:
$ cat /etc/hosts /etc/resolv.conf /etc/fstab
You can redirect the output as follows using shell standard output redirection:
$ cat /etc/hosts /etc/resolv.conf /etc/fstab > /tmp/outputs.txt
$ cat /tmp/outputs.txt

You can also use a pipe to filter data. In this example send output of cat to the less command using a shell pipe as the file is too large for all of the text to fit on the screen at a time:
$ cat /etc/passwd | less

How Do I Create a File?

You can use cat command for file creation. To create a file called foo.txt, enter:
$ cat > foo.txt
Sample outputs:
This is a test.
To save and exit press the CONTROL and d keys (CTRL+D). Please note that if a file named foo.txt already exists, it will be overwritten. You can append the output to the same file using >> operator:
$ cat >> bar.txt
The existing bar.txt file is preserved, and any new text is added to the end of the existing file called bar.txt. To save and exit press the CONTROL and d keys (CTRL+D).

How Do I Copy File?

The cat command can also be used to create a new file and transfer to it the data from an existing file. To make copy of
$ cat oldfile.txt > newfile.txt
To output file1's contents, then standard input, then file2's contents, enter:
$ cat file1 - file2
A hyphen indicates that input is taken from the keyboard. In this example, to create a new file file2 that consists of text typed in from the keyboard followed by the contents of file1, enter:
$ cat - file1 > file2

cat command options

To number non-blank output lines, enter (only works with GNU cat command version):
$ cat -b /etc/passwd
Sample outputs:
     1 root:x:0:0:root:/root:/bin/bash
     2 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
     3 bin:x:2:2:bin:/bin:/bin/sh
     4 sys:x:3:3:sys:/dev:/bin/sh
     5 sync:x:4:65534:sync:/bin:/bin/sync
     6 games:x:5:60:games:/usr/games:/bin/sh
     7 man:x:6:12:man:/var/cache/man:/bin/sh
     8 lp:x:7:7:lp:/var/spool/lpd:/bin/sh
     9 mail:x:8:8:mail:/var/mail:/bin/sh
    10 news:x:9:9:news:/var/spool/news:/bin/sh
To number all output lines, enter (GNU cat version only):
$ cat -n /etc/passwd
To squeeze multiple adjacent blank lines, enter (GNU cat version only):
$ cat -s /etc/passwd
To display all nonprinting characters as if they were visible, except for tabs and the end of line character, enter (GNU cat version only):
$ cat -v filename

cat Command Abuse

The main purpose of cat is to catenate files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process. For example,
$ cat /proc/cpuinfo | grep model
Can be used as follows:
$ grep model /proc/cpuinfo
Another example,
cat filename | sed -e 'commands' -e 'commands2'
Can be used as follows which is cheaper:
sed sed -e 'commands' -e 'commands2' filename

Copy files that did not exist in the destination directory or were newer than the versions in the destination directory?

 cp -u *.html destination

Friday, June 21, 2013

Error on SVN checkout: SSL handshake failed: SSL error: Key usage violation in certificate has been detected.

install libneon
$ sudo apt-get install libneon27

And then to remove the previous symbolic link by replacing it with a new one pointing to gnutls:

sudo mv /usr/lib/libneon-gnutls.so.27 /usr/lib/libneon-gnutls.so.27.old
sudo ln -s /usr/lib/libneon.so.27 /usr/lib/libneon-gnutls.so.27  

Monday, February 4, 2013

5 Questions Great Job Candidates Ask

Be honest. Raise your hand if you feel the part of the job interview where you ask the candidate, "Do you have any questions for me?" is almost always a waste of time.
Thought so.
The problem is most candidates don't actually care about your answers; they just hope to make themselves look good by asking "smart" questions. To them, what they ask is more important than how you answer.
Great candidates ask questions they want answered because they're evaluating you, your company--and whether they really want to work for you.
Here are five questions great candidates ask:

What do you expect me to accomplish in the first 60 to 90 days?
Great candidates want to hit the ground running. They don't want to spend weeks or months "getting to know the organization."
They want to make a difference--right away.

What are the common attributes of your top performers?
Great candidates also want to be great long-term employees. Every organization is different, and so are the key qualities of top performers in those organizations.
Maybe your top performers work longer hours. Maybe creativity is more important than methodology. Maybe constantly landing new customers in new markets is more important than building long-term customer relationships. Maybe it's a willingness to spend the same amount of time educating an entry-level customer as helping an enthusiast who wants high-end equipment.
Great candidates want to know, because 1) they want to know if they fit, and 2) if they do fit, they want to be a top performer.

What are a few things that really drive results for the company?
Employees are investments, and every employee should generate a positive return on his or her salary. (Otherwise why are they on the payroll?)
In every job some activities make a bigger difference than others. You need your HR folks to fill job openings... but what you really want is for HR to find the right candidates because that results in higher retention rates, lower training costs, and better overall productivity.
You need your service techs to perform effective repairs... but what you really want is for those techs to identify ways to solve problems and provide other benefits--in short, to generate additional sales.
Great candidates want to know what truly makes a difference. They know helping the company succeed means they succeed as well.

What do employees do in their spare time?
Happy employees 1) like what they do and 2) like the people they work with.
Granted this is a tough question to answer. Unless the company is really small, all any interviewer can do is speak in generalities.
What's important is that the candidate wants to make sure they have a reasonable chance of fitting in--because great job candidates usually have options.

How do you plan to deal with...?
Every business faces a major challenge: technological changes, competitors entering the market, shifting economic trends... there's rarely a Warren Buffett moat protecting a small business.
So while a candidate may see your company as a stepping-stone, they still hope for growth and advancement... and if they do eventually leave, they want it to be on their terms and not because you were forced out of business.
Say I'm interviewing for a position at your bike shop. Another shop is opening less than a mile away: How do you plan to deal with the new competitor? Or you run a poultry farm (a huge industry in my area): What will you do to deal with rising feed costs?
A great candidate doesn't just want to know what you think; they want to know what you plan to do--and how they will fit into those plans.

Tuesday, January 15, 2013

Implementing PSR-3 with log4php

Using SSH and SFTP with PHP

Creating E-Commerce Store with OpenCart

Adding Text Watermarks with Imagick