Today I spent about three hours to play with “extremely practical and user friendly” interface of WinXP. The problem was that Windows is too smart (at least for me). It tries to foresee your desires. But as result you wast your time to switch off next “intelligent” feature. In my case I heed to download CSV file from site supported IE only. But IE opens that file in browser window with Excel, corrupted its data. Finally I found solution:
- Open Control Panel
- Open Folder Options
- Click File Types
- Locate “CSV” and click the Advanced button
- Check the box that says “Confirm open after download”
- Do the same for “XLS Microsoft Excel Worksheet” as well
- Click Ok
It was amazing. I checked Alan Simpson’s Windows XP Bible and O’Reilly – Fixing Windows XP Annoyances but without luck. Maybe that issue so trivial that everybody knows how to solve it. Anyway, once again I saw that Windows is not my choice!
Recently I needed to send a script to one of my co-workers from the server. One way to do that is copy the script using scp to my PC and send it as usual. But there is a more efficient way to do that with mutt:
$ mutt -s "Subject" -a /tmp/file.tar.gz firstname.lastname@example.org < /tmp/message-body.txt
I hope that all parameters are understandable. So, having mutt and using that command you can easily send email with attached file from command line.
Once Alexey suggested me to use online service Mobical to store info from my mobile phone. I didn’t start use it immediately. But recently I decided to try it. It’s really cool and useful service. Once registered there you can synchronize phone book, calendar, tasks and other stuff from your mobile phone with your online account. Moreover, it’s possible to export your contacts as vCard-file and calendar as vCard-file or iCalendar-file for backup or for some other reason.
Recently I’ve had a little problem. I’ve needed to create an archive from some source directories but I’ve not needed to add in the archive some subdirectorives. I’ve made a quick search in Google and found an article “Telling tar Which Files to Exclude or Include”. Here is a short example:
$ find videoguide/ ! -type d -print | egrep '/,|%$|~$|.jpg$|.gif$|.png$' > /tmp/exclude_files
That command forms a list of excluded files and store it into temporary file.
$ tar vcfX ~/projects/arc/vg-19012004.tar /tmp/exclude_files
will remove files which listed into excluded_files from archive.
Updated: There is a more simple way to exclude file/dir from the archive. You can define a pattern in the command line instead of creation a file. Let’s image that we need to exclude Subversion directories from the archive:
tar vzcf my-project.tar.gz --exclude='.svn' ProjectDir
Note: you should always wrap the pattern by quotes!