Skip to content
The beaver is a proud and noble animal

The beaver is a proud and noble animal

Notes from a bemused canuck

  • Home
  • About
  • Bookmarks
  • Pictures
  • Resume
  • Wine
  • Random Recipe
  • Toggle search form

I love unix one-liners

Posted on August 14, 2013August 14, 2013 By admin

The software that I use to generate the photo albums has started being annoying and inserts javascript that generates a “Built with XXX, Click here to buy a license” soft-popup in the album pages. It’s annoying as feck. I set about to do something geeky about it and came up with this:

find . -name "*.html" -execdir sed -i -n '1h;1!H;${;g;s/<script type.*CDATA*</script>//g;p;}' {} +

This little snippet checks the thousand of HTML picture slide files that I have and just removes the offending bit of HTML, all in one line that takes about 30 seconds to execute.

I love linux.

  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Facebook (Opens in new window) Facebook
  • Share on Threads (Opens in new window) Threads
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Email a link to a friend (Opens in new window) Email
uncategorized Tags:geek

Post navigation

Previous Post: Lavaux Vineyards
Next Post: More naked sushi

Related Posts

  • Name that font? geek
  • Data overload much? geek
  • Hits close to home geek
  • Computers can sometimes be evil piles of shite computers are evil
  • Peel the layer. Blockchain. Responsive design. Break the paradigm… dilbert
  • Fireworks, with music geek

Power to the beaver!

Show me the beaver!
August 2013
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Jul   Sep »

Quote of the day

Sam Vimes could parallel process. Most husbands can. They learn to follow their own line of thought while at the same time listening to what their wives say. And the listening is important, because at any time they could be challenged and must be ready to quote the last sentence in full. A vital additional skill is being able to scan the dialogue for telltale phrases such as "and they can deliver it tomorrow" or "so I've invited them for dinner?" or "they can do it in blue, really quite cheaply."
--(Terry Pratchett, The Fifth Elephant)

Random Posts

  • I fucking hate fucking 4 o’clock in the fucking morning
  • Jules Verne, writing the sea
  • An exercise in pain
  • Happy Canada Flag Day
  • Someting new
reading leopard

Tags

bobble the little blue owl boobies brought to you by the fda cats chonk christmas comics computers are evil covid-19 dealing with idiots dilbert dog ducks galleries geek god bless the land of the free holidays house I am Canadian land of cheese and chocolate linked news lolcat london news from the stupid not my dog nsfw pets pictures potd2014 qotd random shit re-member recipes relationship shrill slice of life stress Tao the british way The Peanut things i miss travel video wine work

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2026 The beaver is a proud and noble animal.

Powered by PressBook Premium theme