Wednesday, July 18, 2012

htaccess sample code for url redirection

This is following simple .htcacces sample  redirects the url to the complaints folder, If the url starts from complains

RewriteEngine On
RewriteRule ^complaints/(.*)$ complaints/index.php?tag=$1 [QSA,L]

3 Interview Questions


Interviewing job candidates is tough, especially because some candidates are a lot better at interviewing than they are at working.
To get the core info you need about the candidates you interview, here's a simple but incredibly effective interview technique I learned from John Younger, the CEO ofAccolo, a cloud recruiting solutions provider. (If you think you've conducted a lot of interviews, think again: Younger has interviewed thousands of people.)
Here's how it works. Just start from the beginning of the candidate's work history and work your way through each subsequent job. Move quickly, and don't ask for detail. And don't ask follow-up questions, at least not yet.
Go through each job and ask the same three questions:
1. How did you find out about the job?
2. What did you like about the job before you started?
3. Why did you leave?
"What's amazing," Younger says, "is that after a few minutes, you will always have learned something about the candidate--whether positive or negative--that you would never have learned otherwise."
Here's why:
How did you find out about the job?
Job boards, general postings, online listings, job fairs--most people find their first few jobs that way, so that's certainly not a red flag.
But a candidate who continues to find each successive job from general postings probably hasn't figured out what he or she wants to do--and where he or she would like to do it.
He or she is just looking for a job; often, any job.
And that probably means he or she isn't particularly eager to work for you. He or she just wants a job. Yours will do--until something else comes along.
"Plus, by the time you get to Job Three, Four, or Five in your career, and you haven't been pulled into a job by someone you previously worked for, that's a red flag," Younger says. "That shows you didn't build relationships, develop trust, and show a level of competence that made someone go out of their way to bring you into their organization."
On the flip side, being pulled in is like a great reference--without the letter.
What did you like about the job before you started?
In time, interviewees should describe the reason they took a particular job for more specific reasons than "great opportunity," "chance to learn about the industry," or "next step in my career."
Great employees don't work hard because of lofty titles or huge salaries. They work hard because they appreciate their work environment and enjoy what they do. (Titles and salary are just icing on the fulfillment cake.)
That means they know the kind of environment they will thrive in, and they know the type of work that motivates and challenges them--and not only can they describe it, they actively seek it.
Why did you leave?
Sometimes people leave for a better opportunity. Sometimes they leave for more money.
Often, though, they leave because an employer is too demanding. Or the employee doesn't get along with his or her boss. Or the employee doesn't get along with co-workers.

When that is the case, don't be judgmental. Resist the temptation to ask for detail. Hang on to follow-ups. Stick to the rhythm of the three questions. That makes it natural for candidates to be more open and candid.
In the process, many candidates will describe issues with management or disagreements with other employees or with taking responsibility--issues they otherwise would not have shared.
Then follow up on patterns that concern you.
"It's a quick way to get to get to the heart of a candidate's sense of teamwork and responsibility," Younger says. "Some people never take ownership and always see problems as someone else's problem. And some candidates have consistently had problems with their bosses--which means they'll also have issues with you."
And a bonus question:
How many people have you hired, and where did you find them?
Say you're interviewing candidates for a leadership position. Want to know how their direct reports feel about them?
Don't look only for candidates who were brought into an organization by someone else; look for candidates who brought employees into their organization.
"Great employees go out of their way to work with great leaders," Younger says. "If you're tough but fair, and you treat people well, they will go out of their way to work with you. The fact that employees changed jobs just so they could work for you speaks volumes to your leadership and people skills."

Source:
http://www.inc.com/jeff-haden/3-interview-questions-that-reveal-everything.html

linux create zip command

The zip and unzip Commands

The zip and unzip programs work almost exactly like their cousins PKZIP and PKUNZIP in the DOS environment. You can squash a bunch of files together into a zip file like this: zip squash.zip file1 file2 file3
Then you can extract the original files like this:
unzip squash.zip
Most of the flags are the same as for PKZIP and PKUNZIP, but there are a few differences, so you might like to view the help with zip -h or unzip -h if you need anything fancier than the basic commands shown here.
If you use the -k flag when you zip a file under Linux, you can apply PKUNZIP to it under DOS. This flag tells zip to translate the Unix file and directory names into something that fits the more restrictive DOS naming conventions.
For example, if you have Linux files named another.longunix.filename and wontwork.withDOS, the -k flag will cause these files to be stored in the zip file as another.lon and wontwork.wit. If you don't use the -k flag, the PKUNZIP command under DOS will give you an error message and refuse to create the files with the invalid names.

Tuesday, July 17, 2012

Basic linux useful commands

ou may or may not be versed in Linux. No worries. We all have to start somewhere! This article contains a number of useful Linux commands you will likely need to use when utilizing your VPS.

Server Administration

These are some basic commands to see the health of your VPS, check processes, etc.

w
The w command shows you a few things. First, it shows your server's current load. Secondly, it shows uptime. Finally, it shows you who is logged into shell and as what user. Handy!
ps
The ps commands shows your current running processes. A good set of flags to run with the command are aux, so the command would be ps aux. This will show all processes from all users on the server, plus some other vital information on them.
top
Top is a useful tool to see real time process information. It's different from ps as it updates the information and displays the biggest resource users on the top of the list. This is useful for seeing heavy memory and CPU users and processes. To quit top, simply press "q".
kill
Kill does exactly what it sounds like it does; kills things. Specifically, processes. If you have a process that isn't responsive, or, hung, you can use kill to run it. So, if I have a process I see from running ps and want to kill it, I'll grab the process ID (in the second column of the ps aux output) and run kill ID (replacing ID with the process ID). If it doesn't kill it, you may need to use the -9 switch to force it to close. So, kill -9 ID.
free
Free shows current memory usage. It displays the output in bytes, however, so you may want to use the  -m switch to show it in megabytes and make it more readable. You will see the total amount of memory, the used amount and the free amount, as well as memory swap usage. Note that Linux loves to cache things in memory, so having high memory usage doesn't necessarily indicate a problem.
df
The df command shows current disk usage. Check this article for more information.
du
The du command shows disk usage for a certain directory. The above article explains du as well as df.
netstat
The netstat command shows network status, specifically, all current connections. Try netstat -anp to see a great output for all connections!

Navigating and managing files and folders.

Navigating around on the command line can be intimidating. We'll try to make it less so here!

ls
The ls command lists the contents of the directory you're in. You can try the ls -alh command to show a list of files and folders, plus,
cd
The cd command stands for change directory. That allows you to change to a directory by typing in it's full path (so, cd /home/user/public_html) or, into a folder in the current directory you're in (so, if you're in /root and want to enter a directory called "files" that you've created in there, simply type cd files).
chown
The chown command stands for change owner and group. its basic usage is: chown user.group /path/to/file. You will want to replace user and group with the username you're changing the file to, plus, the group separated by a period as shown, or a colon.
chmod
chmod allows you to make permission changes to files. Files and folders have a set of permissions that allow users, groups and everyone to use or not use the file. You will need to chmod the binary settings for the file or folder. Basic usage is: chmod ### /path/to/file where ### is the binary permission. If you'd like a chmod calculator, try this page.
pwd
pwd shows the directory you're currently in. It stands for present working directory.
cp
The cp command is the command you can use to copy files and folders. It's general usage is: cp file1 file2 where file1 is the file name you're wanting to replicate. To copy directories, you need to use cp -r to recursively copy the directory.
mv
mv is similar to the copy command (cp), but instead of copying the file, it moves it from one place to another. Its general usage is: mv file1 newfile1 where file1 is the file you're moving the newfile1 is the file's new name, or, path to the directory you're moving it to.
rm
The rm command stands for remove. It deletes files and folders. Be careful with this command! There's no turning back! (well, there is a little! We do perform backups).
locate
The locate command uses a database that indexes all files and folders on your server. It's a quick and easy way to find files by name on your server. You may have to run the updatedb command, though, if the database that has your indexed files and folders hasn't been updated in a while.
find
find does exactly what you'd expect it to do. Finds stuff. Essentially, it's used similar to locate, but, it doesn't use a database. Instead, it searches the directory you're in (or, the one you specify in the search string). Say, for example, you wanted to find all files containing the word "index" in your current directory. You could use: find . -type f -exec fgrep -li index {} \;
The find command is pretty powerful! Try typing man find to see the manual for find.
stat
The stat command shows you detailed access, modify and change timestamps on a file. Its basic usage is: stat filename. This is useful to see when a file may have changed last.

Monday, July 16, 2012

Checked radio button value using jquery

Please find the following sample snippet to get checked radio button value.


$("input[name=cmdRd]:checked").val()

Sunday, July 15, 2012

CSS Round corner

I was searching in the web  for to make a box with round corner. After google investigation , I came to know that , this will done using css 3. This will work fine in all browsers except IE.


Please find the following  css example:


.roundCorner  {
   border: 3px solid #FF8855;
    border-radius: 10px 10px 10px 10px;
    margin-left: 4%;
    overflow: hidden;
    padding: 0 0 18px 15px;
    width: 90%;
    height: 50%;
    background-color: FF8855;
}