Tuesday, February 27, 2007

Blogging from Google Docs and Spreadsheets

Up until now, all my blogs have been done in gmail and then sent to my blog account via e-mail. A further trip is then necessary to check the formatting, fix any broken links and generally check things over.

This posting is different. I am using Google Docs and Spreadsheets to write this and then publish it directly to the blog. Hopefully this will allow me to sort out the formatting and the links in situ, and have the completed post arrive without need of further assistance.

I have used the spreadsheet side of Docs and Spreadsheets before with much success. The collaboration aspect is fantastic for myself and my accountant to work out my tax finances together, on the same doc, at the same time. As changes are made, they are visible to the other person immediately. This makes pointing things out and working through problems remotely as easy as working next to each other.

I can see how companies have taken the Google application suite on-board. Combine the collaboration aspects of this tool with the functionality it offers, and the integration with mail and calendar, and I really can't see a compelling reason to use Office in 80% of scenarios. There will always be a need for complex macros in Excel, but the vast majority of the stuff I do is already available in Google's offering.

Now, to publish and see if this works...

Thursday, February 01, 2007

Some command line shortcuts

I know it's been a while, and this is only a short one, but I wanted to get these down.

I've been experimenting with the command line strengths of Linux, combining commands to perform powerful statements. The first is:

find -name "*.JPG" -exec rename 's/\.JPG$/\.jpg/' {} \;

This command will find every file within a tree structure from the point the command is run that has .JPG as it's extension and then rename it to .jpg. Linux automatically recognises .jpg to be a picture but not .JPG. For someone like me with over 3000 pictures in numerous subdirectories this was a huge productivity help. It is simple to modify it for other file types too. Obvious ones spring to mind like .AVI, .BMP, .MPG etc.

Another thing I wanted to do was increase the rights on a tree structure for all files whilst removing execute. I know from painful past experience that chmod -R 0664 * has disastrous results with directories! However, combining find and chmod allowed me to produce these 2 commands:

find -type f -exec chmod 0664 {} \;
find -type d -exec chmod 2775 {} \;

The first only finds files and then changes the permissions to give the user and group read and write, allow everyone read, and removes execute across the board.

The second finds directories and changes the permissions as above (whilst allowing execute because they are directories), and also changes the permissions on the directory to ensure that every new file is given the group ownership of the directory, and not the user creating it.

As I continue to play with regular expressions and the command line I'm sure I'll find more of these gems. I'll probably put them here too.

For now, one more:

find -name "*.zip" -exec unzip -o {} \;

OK, one more:

rename 's/^\d+_//' *

This will remove the leading number and underscore from files or directories such as those that have been downloaded using .nzb files from newsgroups. Useful for tidying up your downloaded directory structure. (Or at least useful for tidying up mine!)

Top Tracks of 2012

Well, it's that time of year. Once again I can abuse my html knowledge and shove a few YouTube videos into a blog post to illustrate wha...