how to trim spaces in bash variable

result=' text text '
 resultnosp="$(echo -e "${result}" | tr -d '[[:space:]]')"

flags to use for making rsync faster than cp

which flags to use for making rsync faster than cp ,

rsync -a -W --inplace

how to search in google cache

How to avoid the problem with XmlHTTPrequest headers

set $cors "";
if ($http_origin ~* (.*\ { set $cors "true"; }
location / {
if ($cors = "true") {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'User-Agent,Keep-Alive,Content-Type'; }

if ($request_method = OPTIONS) { return 204; } } }

Change vim default colorscheme

just create ~/.vimrc

" color scheme of the moment:
syntax on
colorscheme koehler

how to find files newer than exact data?

 find ./ -type f -newer somfiles | xargs ls -rtlh

How to transfer data much faster than RSYNC ?

On the server (receiver)

 socat TCP-LISTEN:4444 - | tar xvf - 

On the client (sender)

 tar cvf - /mnt/somefolder | socat - TCP:a0032n1:4444    

mysqldump to another host

 mysqldump dbanme | ssh user@  'cat > /tmp/dbname.sql'

Shell. negative in FIND

 find . ! -user www

How to get particular database from mysqldump which was made with –all-database option ?

Assume, you made a mysqldump which consists all databases (with –all-database option), how to restore from that mysqldump the necessary database?
Solution is really simple!

mysql --one-database db_name < alldatabases.sql