Here is the list of all posts of the “Usefull Commands” theme. If you don’t know what this is all about, please read the introduction.
Monthly Archive for December, 2006
I’ve build a new RPM of Rugg 0.2.3 for Mandriva 2007. You can find it in my Mandriva repository.
I’ve updated my website-backup python script.
Change log:
- Use
set ftp:list-options -acommand to force lftp to download hidden files (like.htaccessand so on). - Use
--forceparameter to allow auto-deletion of multiple outdated rdiff-backup increments. - Defensive incremental backup policy: keep 32 last backups instead of 32 days of backup.
I also added a debug mode as suggested by Sacha.
- Text replacement:
sed 's/string to replace/replacement string/g' original-file.txt > new-file.txt
- Replace all occurrences of
str1bystr2in all files below the/folderpath:find /folder -xdev -type f -print -exec sed -i 's/str1/str2/g' "{}" \; - Same as above but ignore all content of
.svnfolders and.zipfiles:find /folder -xdev -type f -not -regex ".*\/\.svn\/.*" -not -iname "*\.zip" -print -exec sed -i 's/str1/str2/g' "{}" \; - In place charset transcoding:
recode utf-8..latin-1 utf8text.txt
- Remove all accented characters in a string (thanks to Matthieu for the tip):
echo "éÈça-$" | iconv -t ASCII//translit
- Get the date of last week:
date +"%Y-%m-%d" -d last-week
- Get the current date in english:
env LC_TIME=en date +"%a %b %d %Y"
- Get the number of seconds since epoch:
date +%s
- Convert back epoch time to human-readable date:
date --date=@1234567890
- Merge 2 PDF documents:
pdftk doc1.pdf doc2.pdf cat output newdoc.pdf
- Same as above, but for all PDFs of the current folder. This also have the nice side effect of removing all DRMs
:
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=bigfile.pdf ./*
- VIM: no autoindent on paste.
- a list of
sedone-liners.
Latest blog activity
unixland, kdeldycke
kev, kev, kev, kev, Dom, kev [...]
menega, PooLP, Hrr, bhanu, Amor, Miller [...]
Mark Tomich, tartanandsnarly, mjs, Porch, phil, Stubbs [...]
kev, James, djib, kev, djib, kev [...]