Quantcast
Channel: Just for fun ;-)
Browsing latest articles
Browse All 33 View Live

Показывать прогресс при запущеной 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 Article


Get 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 Article


rsync 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 Article

Quickest 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 Article


Restore 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 Article

android 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 Article


Find file by content in linux

grep -rIn 'what' where

View Article

Split 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 Article

Create 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 Article

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 latest articles
Browse All 33 View Live