Thursday, January 5, 2012

print urls in a css file

Print the URLs in a css file:

sed -rn 's/^.*url\((.+\.[a-z]+)\).*$/\1/p' file.css

I had a css file that referenced a some images in a directory that contained lots of images and wanted to move just the images referenced in the css file to a new directory, so ended doing something along the lines of:

for p in $(sed -rn 's/^.*url\((.+\.[a-z]+)\).*$/\1/p' file.css); do cp ~/old_path/css/$p new_path/$p; done

Tuesday, January 3, 2012

ubuntu chromium flash killing tabs

So sometimes when flash dies, like any good gift, it continues giving in the form of freezing any subsequent page that has flash. I tried killing the flash plugin process via the browser but that didn't seem to help; however, when killing the process from a terminal my browser was back to normal! Huzzah!

ps -ef | grep chromium-browser | grep flashplugin | awk '{print $2}' | xargs kill