General

Linux Grep Tips

by damonp on November 17, 2010

in General

Search for red OR green:

grep 'red\|green' files
Search for searchtext at the beginning of a line in files:

grep '^searchtext' files
Search for searchtext at the end of a line in files:

grep 'searchtext$' files
Search files for blank lines:

grep '^$' files
Search files for US formatted phone numbers (###-###-####):

grep '[0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]' files

or:

grep '[0-9]\{3\}-[0-9]\{3\}-[0-9]\{4\}' files
Search for e-commerce or ecommerce in files:

grep e-*commerce files
Search for searchtext case-insenstively in files:

grep -i searchtext files
Search for searchtext at the beginning of a line in files:

grep '^searchtext' files
Chain two grep commands together for more advanced searches. Search for lines in files that contain both partial_name and function:

grep partial_name files | grep function

That one is great for searching source directories for a function definition when you can’t remember the completely function name.

Popularity: 3%

{ 0 comments }

iPhone Goodreader and Email

by damonp on April 28, 2010

in General

Goodreader is simply the best PDF / document reader around for the iPad. It allows you to download documents in a dozen different ways and store them locally on your device. Another great feature is the ability to directly email these as attachments from inside Goodreader.

Unfortunately, said feature is limited somewhat by the limitations of the device. Trying to compose a message in the tiny popup box is a pain… especially when the box starts jumping around on every keypress as the tiny window tries to alternately flow the text and show the attachment.

Good thing there is a fix for any app using the iPhone/iPad built-in mail functionality. Simply type something in the text field to put something in the message body. I use a couple of returns or set the To: address. Then close the message. When the app asks if you would like to save the draft, hit Yes and the message along with attachment will be saved in your Mail Drafts folder. You can retrieve it there any time to finish writing your message and send the attachment.

If you fail to type something in the new message pop up, the mail app wont ask you if you want to save the draft. It will exit and trash your message.
Sending File Attachment in Goodreader

Popularity: 2%

{ 0 comments }

Back

29 August 2009

After nearly two years with not much to say, I decided to pick up the blog again. It was a long and winding journey, this time in between. Maybe more on that later. I should be updating the pages of the blog with current info about myself and my projects over the next few weeks. [...]

Read the full article →

Blattodephobia

10 September 2007

n. The fear of cockroaches

Read the full article →

Grep Replace and Word Processing

25 June 2007

I spend so much time in a text editor, its hard to get my head around a word processor sometimes. Text and formatting at the same time? Moving some content around I found myself with a ton of links formatted in an unordered list. I only needed the plaintext of the name and link separate [...]

Read the full article →

MySQL Saved Queries

12 June 2007

phpMyAdmin‘s SQL popup has an interesting bookmarking feature called SQL History. I have plenty of saved queries to produce different reports on many of the client databases that I administer. I was looking for a way to supply a variable to search on in some of the queries. A little trial and error with the [...]

Read the full article →

ValidRcptTo.cdb Patch for Qmailrocks

7 May 2007

Received a call from a client this morning about not receiving any email for the last few days. Viewing the queue on their server showed 50,000 messages in the local queue. Tailing the logs, showed dozens of messages being received every minute to non-existent addresses to valid domains on the server. Qmail was accepting the [...]

Read the full article →

Todo.txt – A Command Line Task Tracker

28 March 2007

I found Todo.txt by Gina Trapani, randomly last weekend and have been playing with it all week. Todo.txt is a todo list written in shell script. It should run fine under any system that supports a Unix like shell… Linux, OS X, Cygwin etc. At any given time I have a half dozen post-it pads [...]

Read the full article →

Advanced OSX Mail Searches

25 March 2007

When you live and breathe email for work and play, it can be quite important to keep messages around for reference. In my business, client and project specific correspondence is supremely important as a record of what has been done, what needs done and project cost quotes among other things. The important information usually gets [...]

Read the full article →

Google Code Search

9 March 2007

Bad code haunts you forever… Google Code Search

Read the full article →