How to dry-run svn update?
Answer:
In your working directory, type
svn status -u
It will check the diff of your contents with the data in the current svn's HEAD
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to dry-run svn update?
Answer:
In your working directory, type
svn status -u
It will check the diff of your contents with the data in the current svn's HEAD
How to pretty print my.cnf with a one-liner?
Answer:
A very cool command.
perl -ne 'm/^([^#][^\s=]+)\s*(=.*|)/ && printf("%-35s%s\n", $1, $2)' /etc/my.cnf
Reference: http://www.mysqlperformanceblog.com/2009/06/15/how-to-pretty-print-mycnf-with-a-one-liner/
How to avoid SQL injection in PHP?
Answer:
The easiest method is to use the mysql_real_escape_string function
Example:
$query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'",
mysql_real_escape_string($user),
mysql_real_escape_string($password));
Reference: http://php.net/manual/en/function.mysql-real-escape-string.php
How to check if a Perl module is already installed?
Answer:
For example, to check if the DBI module is installed or not, use
perl -e 'use DBI;'
You will see error if not installed.
How to remove BOM from UTF-8?
Answer:
# awk '{if(NR==1)sub(/^\xef\xbb\xbf/,"");print}' text.txt
Source: http://stackoverflow.com/questions/1068650/using-awk-to-remove-the-byte-order-mark
Updated: (Suggested by Van Overveldt Peter)
# tail --bytes=+4 text.txt