четверг, 26 февраля 2015 г.

среда, 25 февраля 2015 г.

How to check for changes on remote (origin) git repository?

You could git fetch origin to update the remote branch in your repository to point to the latest version. For a diff against the remote:

 git diff origin/master

If you want to accept the remote changes:

 git merge origin/master

вторник, 7 октября 2014 г.

Read CSV file

sed "s/,/\t/g" filename.csv | less -S

вторник, 5 августа 2014 г.

Convert file from utf8 to cp1251

iconv -f utf8 -t cp1251 < index.php > index.php.1251

Send html POST command from console

curl --data "param1=value1&param2=value2" http://hostname/resource

четверг, 31 июля 2014 г.

Determine and change file character encoding

file -bi [filename]

Example output:

steph@localhost ~ $ file -bi test.txt text/plain; charset=us-ascii 
  
Use vim to change a file's encoding:

set encoding=utf-8
set fileencoding=utf-8

пятница, 1 ноября 2013 г.