Показывать прогресс при запущеной dd
dd is a generic command-line tool for copying files from 1 location to another. It is often used to copy entire disk images.Like many Linux command line tools, it operates silently unless something...
View ArticleGet Directory Path of an executing Batch file (win)
Most people probably know that can use the variable %0 in a batch file to get the name of the executing batch file. However if you use that in conjunction with some batch parameter modifiers you can...
View Articlersync usage
rsync --include-from=/tmp/include.txt --exclude-from=/tmp/exclude.txt -aRv ./src /tmp/destinclude.txt>>*.pdfexclude.txt>>*.*команда копирует из источника все файлы с расширением pdf.
View ArticleЛегко прибить процесс (win)
taskkill /F /IM прога /T/F Принудительное завершение процесса./IM <образ>Имя образа процесса, который требуетсязавершить. Для указания всех процессовможно использовать символ шаблона '*'./T...
View ArticleQuickest way to send files on local network
On the receiving end:Code:nc -vv -l -p 1234 > filenameon the sending machine:Code:cat myfile | nc -c 192.168.1.22 1234Change IP and port (1234) if needed.
View ArticleRestore files by grep
Шустро восстановить удаленные/потерянные/случайно_измененные текстовые файлы можно и грепомgrep -i -a -B10 -A100 'Строка или текст из файла, который потерпел катастрофу' /dev/sda1 > result.txt...
View ArticleКак погасить питание на USB программно?
echo "suspend" > /sys/bus/usb/devices/usb2/power/levelecho "auto" > /sys/bus/usb/devices/usb2/power/level
View Articleandroid vibrator
To make vibrator works you need make few steps:1. in sources:Vibrator vb = ( Vibrator )getApplication().getSystemService( Service.VIBRATOR_SERVICE );vb.vibrate( 1000 );2. in application manifest:...
View ArticleПереименовать группу файлов
Often over time, we will want to reorganize a group of files by renaming them.To rename *.txt to *.bak (e.g. to rename ham.txt to ham.bak)for f in *.txt; do mv "$f" "${f%.txt}.bak"; doneTo remove...
View ArticleSplit large file
Have you ever want to split a large file into several small files? I’ve face this problem few days ago. I need to split a large file (3GB log file) into several smaller file where i can read it using...
View ArticleCreate bootable USB key with Windows 7 from Linux
1. dd if=/w7.iso of=/dev/sdx2. ms-sys -7 /dev/sdxLink to ms-sys in AUR (archlinux)
View ArticleDetermine 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 ArticleSend html POST command from console
curl --data "param1=value1¶m2=value2" http://hostname/resource
View ArticleHow 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Работа с русскими именами файлов в ZIP и UNZIP под *nix
Увидеть имена файлов путём перекодировки ls -N | iconv -f cp1252 -t cp850 | iconv -f cp866Перекодировать распакованные файлы в utf-8 можно следующей командой: find . -type f -exec sh -c 'np=`echo...
View ArticleHow 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