среда, 21 марта 2012 г.

Как скопировать группу файлов в определенном порядке ?

Я являюсь счастливым обладателем mp3-плеера iRiver T60.
А у него, как оказалось (несколько лет пользовался и не знал!) есть такая особенность, что он воспроизводит файлы в том порядке, в котором они были записаны, а не как-либо еще.
Это важно, если вы слушаете аудио-книги.

Решением проблема стала команда подобного типа:

find . -type f |sort|xargs -L 1 cp --parents --target-directory=/media/T60/Music/Books/ErikBern

В данном примере я копирую рекурсивно все файлы из текущей директории в директорию /media/T60/Music/Books/ErikBern строго в порядке, в котором файлы были отсортированы с помощью команды sort.

P.S.: I like Linux.

пятница, 9 марта 2012 г.

Very useful "core.sharedRepository" property in config file of Git repository for sharing repository with another users

The quote from 'git help config':


core.sharedRepository
When group (or true), the repository is made shareable between several users in a group (making sure all the files and objects are group-writable). When all (or world or everybody), the repository will be readable by all users, additionally to being group-shareable. When umask (or false), git will use permissions reported by umask(2). When 0xxx, where 0xxx is an octal number, files in the repository will have this mode value.  0xxx will override user’s umask value (whereas the other options will only override requested parts of the user’s umask value). Examples: 0660 will make the repo read/write-able for the owner and group, but inaccessible to others (equivalent to group unless umask is e.g.  0022). 0640 is a repository that is group-readable but not group-writable. See git-init(1). False by default.