'gnu' Category
-
jul232011
avoid typos with dd wrapper
When using dd it’s very common typos that f*ck your important data. I create this 5-minutes python code do wrapper dd and make my life more safe. The usage is simple, just a config file with partition(s) you should avoid. Suppose that you have 2 disks in your computer and want avoid playing both with [...]
-
out162010
spliting files with dd
It’s just in case that you don’t have* want use split… (that is much easy). Suppose that you have a 20MB ogv movie and you want split in four parts of 5MB. You can just do:
dd if=MOVIE.ogv of=pt1 bs=1M count=5
dd if=MOVIE.ogv of=pt2 bs=1M skip=5 count=5
dd if=MOVIE.ogv of=pt3 bs=1M skip=10 count=5
dd if=MOVIE.ogv of=pt4 bs=1M skip=15
To merge [...] -
set092010
unnamed files
I’m a heavy user of command line interface and often named files without extension. This behavior forces me to use file utility every time I have doubts.
$ file stick-note1
stick-note1: ASCII text
When organizing my home/ I came across with many files like that, so I decided make this script to walk throughout files and check if it’s text file [...] -
jan162010
Convertendo videos do Youtube para audio (MP3)
Programas necessários:
Alguma distribuição GNU/Linux
mplayer
lame (caso queria converter para mp3)
vorbis-tools (caso queira converter para ogg)Os videos do YouTube, normalmente qualquer conteúdo Flash, fica armazenados na pasta /tmp do sistema operacional na forma FlashXXXX (exemplo: FlashaOiW6k). Para cada arquivo flash existirá um arquivo correspondente, para descobrir de qual se trata utilize o mplayer, no console (cd /tmp):
mplayer FlashaOiW6k
Após [...] -
nov112009
Acessando o Gmail pelo Mutt
Para acessar seus emails da conta do GMAIL no modo texto, utilizando o mutt, adicione ao arquivo ~/.muttrc
set imap_user = “USERNAME@gmail.com”
set imap_pass = “PASSWORD”
set spoolfile = imaps://imap.gmail.com:993/INBOX
set folder = imaps://imap.gmail.com:993
set record=”imaps://imap.gmail.com/[Gmail]/Sent Mail”
set postponed=”imaps://imap.gmail.com/[Gmail]/Drafts”
set header_cache=”~/.mutt/cache/headers”
set message_cachedir=”~/.mutt/cache/bodies”
set certificate_file=~/.mutt/certificatesset move = no
set sort = ‘threads’
set sort_aux = ‘last-date-received’
set imap_check_subscribedignore “Authentication-Results:”
ignore “DomainKey-Signature:”
ignore “DKIM-Signature:”
ignore “Received:”
ignore “Return-Path”
ignore “MIME-Version”
ignore “X-Spam-Details”
ignore “Received-SPF”
ignore “List-Id”
ignore [...] -
out252009
Busca textual em arquivos
Como resolver o problema de arquivos com espaço em branco na hora de fazer uma busca textual?
Qualquer uma das três formas funciona:1. find PATH -iname FILTRO -exec grep -n PALAVRA ‘{}’ \; -print
2. find PATH -iname FILTRO -exec grep -n PALAVRA /dev/null ‘{}’ \;
3. find PATH [...]