TinyApps.Org
Small is beautiful


 HOME

  0. Internet
  1. Text
  2. Graphics
  3. System
  4. File
  5. Misc
  6. Palm
  7. OS X

 BLOG

 DOCS

 FAQ

 RSS (?)





sed - convert regex pattern matches to lowercase #
In this example, we'll convert text within bold tags to lowercase. Let's have a look first to make sure our search pattern returns the desired results:
$ grep '<b>.*<\/b>' foo.html
<p><a href="/">tinyapps.org</a> / <b>Graphics</b></p>
<p><b>Viewing & Editing</b></p>
<p><b>Measuring</b></p>
<p><b>Optimizing</b></p>
<p><b>Screen Capture</b></p>
<p><b>Fonts</b></p>
<p><b>Other</b></p>
Next, a test run, sending output to stdout:
$ sed 's/<b>.*</b>/\L&/g' foo.html
As expected, all characters between bold tags were converted to lowercase. (In the replacement pattern, "&" corresponds to the pattern found, and "\L" converts the text to lowercase.) Now let's use -i to write the changes in place (apparently introduced around GNU sed version 4):
$ sed -i 's/<b>.*</b>/\L&/g' foo.html
For batch processing multiple files:
$ grep '<b>.*<\/b>' *.html
...
$ for i in '*.html'; do sed -i "s/<b>.*</b>/\L&/g" $i; done
Two related tips by Karoly: 1. Use double quotes so the shell can substitute variables. 2. If your search or replace string contains special characters you need to escape them.

/nix | May 19, 2013

Tiny database #
"KISSDB is about the simplest key/value store you'll ever see, anywhere. It's written in plain vanilla C using only the standard string and FILE I/O functions, and should port to just about anything with a disk or something that acts like one." Code generously released into the public domain.

/nix | Apr 23, 2013

Newly added to Docs #
SCO OpenServer P2V; or, How to Virtualize a SCO Box. Virtualizing a physical SCO OpenServer 5 box turns out to be quite straightforward thanks to VirtualBox.

/nix | Apr 14, 2013

View ddrescue log files graphically #
ddrescueview displays ddrescue log files as a colored grid of blocks. Pascal source code available, as well as binaries from Linux and Windows. See ddrescue binary for OS X and Imaging a corrupt drive for more on ddrescue.

ddrescueview

/nix | Apr 10, 2013

Changing text mode resolution in Knoppix #
For larger console text when booting Knoppix Linux into runlevel 2 (text mode), disable graphics acceleration modules:
boot: knoppix 2 nodrm
(Thank you don999!)

/nix | Apr 02, 2013

A lightweight IMAP email client #
that resembles OS X's Mail 5.x app, Geary integrates tightly with popular webmail services and IMAP servers like Dovecot. Features include desktop notifications, fast search, offline mode, and more.

/nix | Feb 04, 2013

Backing up IMAP email accounts #
NoPriv.py backs up IMAP email accounts to browsable HTML archives. Additional features include incremental backups, Maildir creation (for easy restoring), and more.

/nix | Jan 19, 2013

Download videos from YouTube, Metacafe, Daily Motion, Vimeo, #
and many more with Movgrab. It's written in straight C with no dependencies; building is as simple as ./configure && make. Usage example:
$ movgrab -T 'http://www.youtube.com/watch?v=7XEujPG7Zjw'
Formats available for this Movie:webm:640x360 (8.4M), flv-h264:640x360 (8.3M), mp4:480x360 (9.9M), flv:400x240 (8.0M), 3gp (2.1M),
...
$ movgrab -f webm:640x360 'http://www.youtube.com/watch?v=7XEujPG7Zjw'
...
Selected format item:webm:640x360
    Progress: 3.12% 254.9k of 8.0M 41.0k/s

Related: Batch download YouTube videos from the command line

/nix | Oct 23, 2012

Tiny web browser #
reminiscent of the QNX Demo Disk and OffByOne: NetSurf 2.9. Key features include speed, lean system requirements, portability, and standards compliancy. In addition to C source code (which compiles nicely under Linux and other *nixes), binaries are available for AmigaOS, Atari, Haiku / BeOS, OS X, and RISC OS. (via Seth Fulton)

/nix | Jul 31, 2012

Effortlessly build a custom Linux Live CD #
and boot it instantly from a cloud-based virtual machine with SUSE Studio. Share your results with the world in one click. I put together a bare-bones 32-bit openSUSE 12.1 image for data recovery that includes:
  • GNOME 3 / Nautilus
  • Chromium
  • TestDisk
  • PhotoRec
  • ddrescue
  • hdparm
  • GParted
  • dc3dd
  • safecopy
  • kpartx (multipath-tools)
  • mmls (The Sleuth Kit)
  • make/gcc/gcc-c++
  • mc (Midnight Commander)
  • Wget
  • vsftpd
  • ftp
  • nc (Netcat)
Additional info:

/nix | Jul 10, 2012



Categories
/blosxom
/eink
/mac
/misc
/nix
/palm
/windows

Blosxom Archive
2013: 5 4 3 2 1
2012: 12 11 10 9 8 7 6 5 4 3 2 1
2011: 12 11 10 9 8 7 6 5 4 3 2 1
2010: 12 11 10 9 8 7 6 5 4 3 2 1
2009: 12 11 10 9 8 7 6 5 4 3 2 1
2008: 12 11 10 9 8 7 6 5 4 3 2 1
2007: 12 11 10 9 8 7 6 5 4 3 2 1
2006: 12 11 10 9 8 7 6 5 4 3 2 1
2005: 12 11 10

Blogger Archive
2005: 10 9 8 7 6 5 4 3 2 1
2004: 12 11 10 9 8 7 6 5 4 3 2 1
2003: 12 11 10 9 8 7 6

Ezine Archive
2004: 4 3 2 1
2003: 12 9 8 7 6 5 4 2 1
2002: 12 10 9 8 7 6 5 3 2 1
2001: 12 11 10