Quantcast
Browsing all 33 articles
Browse latest View live

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-8set fileencoding=utf-8

View Article


Send html POST command from console

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

View Article


Convert file from utf8 to cp1251

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

View Article

Read CSV file

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

View Article

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/masterIf you want to accept the remote changes:...

View Article


Count lines in all files

wc -l *

View Article

Работа с русскими именами файлов в ZIP и UNZIP под *nix

Увидеть имена файлов путём перекодировки  ls -N | iconv -f cp1252 -t cp850 | iconv -f cp866Перекодировать распакованные файлы в utf-8 можно следующей командой:   find . -type f -exec sh -c 'np=`echo...

View Article

Linux check motherboard

sudo dmidecode --string baseboard-product-name

View Article


How to change pattern recursively

ack -l 'pattern' | xargs perl -pi -E 's/pattern/replacement/g'Explanationackack is an awesome command line tool that is a mix of grep, find, and full Perl regular expressions (not just the GNU subset)....

View Article


Запуск KOI8-R терминала SSH в UTF-8 окружении

luit -encoding "KOI8-R" ssh ip или xterm -en koi8-r (дальше обычный ssh) mc -S dark --stickchars

View Article

Перекодировка файла

enconv -x UTF-8 somefile.txt

View Article

Vim search for a pattern and if occurs delete to end of line

:%s/{pattern}.*//

View Article

wav из mp4

ffmpeg -i input.mp4 -vn -acodec pcm_s16le -ar 44100 -ac 2 output.wav

View Article

Browsing all 33 articles
Browse latest View live