Kontakty

Aktuality

5. 2. 2012 Vyšel Firefox s jubilejním číslem 10.

Nabízí kompatibilní rozšíření ve výchozím nastavení a rozšířenou podporu. Více na Mozilla.cz.

15. 12. 2011 Mapy.cz – fotky pohledem ze strany

Mapy.cz nabízejí detailní letecký pohled 140 míst ČR Více.

27. 9. 2011 Google spustil Google+

Google spustil konkurenční službu k Facebooku s názvem Google+.

28. 2. 2011 Google připravuje nové prohledávání profilů uživatelů

Nová podoba je integrovaná do vyhledávače Google.com a k profilům poskytuje i odkazy na sociální sítě, s nimiž mají uživatelé svůj profil u Googlu propojen. Více.

5. 3. 2010 Youtube – titulkování videí

YouTube přichází se službou pro neslyšící. Bude on-line titulkovat videa. Více .

UNIX příkazová řádka

Linux or UNIX command line reference

Find files

-mtime +30 means file modified 30 days ago,
-mtime -30 means less than 30 days,
-mtime 30 means exactly 30 days.



$ find /home/myhome -iname "*.html" -mtime -30 -print

find html files last modified 30 days ago.



Truncate multiple filenames to 40 characters

for f in *; do mv $f ${f:0:40}; done 

Rename multiple files

Upper to lower case:

'y/A-Z/a-z/' *

Strip spaces:

rename 's/ //' *.JPG

file-01.jpg to file-1.jpg
file-02.jpg to file-2.jpg
rename 's/-0(.)\.jpg/-$1\.jpg/' *

Find text in files

grep -lr --include=*.html MyText .

find MyText in html files in current directory and subdirectories and list files containing MyText.

Check broken links
linklint -error -warn -xref -forward -out linklint.out -net -http -host <site> /@

Replace text in multiple files
perl -pi -e 's/old/new/' *.html

Backup and restore mysql database
mysqldump db_name -u root -p > file.sql
mysql -u root -p db_name < file.sql

Adding db user:
mysql> create database db_name;
mysql> grant all on db_name.* to 'user'@'localhost' identified by 'password';
mysql> flush privileges;

VI Editor
Delete blank lines:


:g/^$/d
:g/^ *$/d

Remove duplicate rows (must be sorted)


:%s/^\(.*\)\n\1$/\1/


Replace string:
Every occurrence in file:


:%s/OLD/NEW/g 

Between two lines #,#:


:#,#s/OLD/NEW/g

Globally (all) on current line:


:s/OLD/NEW/g

First occurrence on current line:


:s/OLD/NEW

Downloading an Entire Web Site

wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains website.cz --no-parent www.website.cz


without pictures:
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains website.cz --no-parent -R jpg,jpeg,png,gif www.website.cz


Convert pdf to swf - separate pages

pdf2swf -p 1-10 -o %.swf file.pdf 

Converts file.pdf pages from 1 to 10 into separated swf files named 1.swf, 2.swf ... 10.swf

Recursively remove all .svn directories

find . -name .svn -print0 | xargs -0 rm -rf

Rename multiple files

Upper case to lower case

for f in `find`; do mv -v $f `echo $f | tr '[A-Z]' '[a-z]'`; done

Replace with regular expressions

for i in `find`; do j=`echo $i | sed 's/-0/-/g'`; mv "$i" "$j"; done