| « A message I sent Yahoo re. their toolbar | Twitter on trial » |
Tue, Aug 24, 2010
![[Icon]](rsc/img/chain_link.gif)
Pretty much everything I do is command-line based these days. So I thought I'd post a few of the things I've found useful lately.
cp .mozilla/firefox/profile/chrome/{userChrome-example.css,userChrome.css} - much better!function vai {
found=`find . -path *$1`
vi $found
}So, having created your userChrome file, instead of vi .mozilla/firefox/xvuz3pf5.default/chrome/userChrome.cssyou can use the above and simply vai userChrome.css
vim scp://user@host.name/path/to/file
DSC001.JPEG DSC002.JPEG DSC003.JPEG DSC004.JPEGand change them into
photo_001.jpg photo_002.jpg photo_003.jpg photo_004.jpgThe command would be:
:%s/^.\{3\}\([0-9]\{3\}\).*/photo_\1.jpg/g which, broken down, means:: - ex command
% - every line
s - find & replace
/ - beginning of first term
^ - Start at the first character of the line
. - any character
\{3\} - Three repetitions of the previous character
(so in this case, any three characters at the start of the line)
\( - Opening parentheses of a part of the search that we want to be able
to use in the replace text
[0-9] - match any number, from 0-9
\{3\} - Three repetitions of previous character - here, any three numbers
\) - closing parentheses
.* - any number of any characters
/ - End of search term, beginning of replace
photo_ - replacement text
\1 - First parenthesised text in the search term, i.e. first \(text\)
.jpg - replacement text
/ - End of replacement termHopefully, something or other in there might be useful to the geeks amongst you who use the CLI (or a decent text editor ;o). For anyone else, this post was a baffling waste of time.
Such is life!
ls | while read file; do new_name=(replace using regex or whatever); mv "$file" "$new_name"; done ![[Links]](http://geekblog.oneandoneis2.org/skins/112/rsc/img/chain_link.gif)
Hmm.. new look for twitter? I hope it gets less "Ick! Change! Put it back!" nonsense than Facebook..
08/02/12
Facebook Syndication Error
11/02/12
![]()
I last listened to:
Johann Pachelbel - Canon in D major
Most recent photo:
Submersible houseboat