I sometimes have difficulty getting grep to do what I want it to do. Today I wanted to search all files in a directory and sub-directories for instances of a string. After having difficulty with grep, I went looking for a tool named 'ack' which was written in Perl and intended as a replacement for grep. This search somehow led me to the home page of a smilar tool written in Python. The tool is named 'grin' and can be found at http://pypi.python.org/pypi/grin.
grin was easy to install and very easy to use. I particularly found it useful to have the 'hits' highlighted.
Perhaps I could have done this all with grep but grin has done exactly what I wanted it to do, so I think I will continue using it. Those who disagree with just have to grin and bear it. Bah boom, tish! :D
Tuesday, 5 February 2013
One-line text editor in your web browser
A colleague of mine gave me a tip for a basic, in-browser text editor. In a modern browser, enter the following in the address bar:
At first it seems that nothing's happened. The browser pane is one large text entry field. It's a great way of being able to quickly copy snippets of text from a web page, or keep temporary notes. You can even bookmark the address so that you can quickly have a scratchpad available.
When I first saw this I was amazed! OK, maybe I'm easily impressed. :) I wanted to share it, so asked if I could mention it on G+. My colleague suggested that instead I link to the original page. When I searched for this, I had many hits returned, with the first being a blog post titled "One line browser notepad". The blog post's author described the method I mentioned above. I then went on to read some of the comments made in reply to the post and was amazed to see that there were at least 10 further enhancements and improvements suggested. I highly recommending you visit this blog post and try some of the methods.
For my purposes I settled on the example below. It goes a few steps further than the basic example, giving the tab a title, adding a [Save] button, increasing the text size, adding a favicon and setting the focus on the editing pane. One advantage of this solution over other solutions suggested is the ability to save the contents of the text box. It's not a fully-blown editor but you can at least save your notes if you want to do that. All credit for the code below goes to those who commented to the blog entry. It is entirely the result of cut-and-paste-ing some of their contributions.
data:text/html, <html contenteditable>
At first it seems that nothing's happened. The browser pane is one large text entry field. It's a great way of being able to quickly copy snippets of text from a web page, or keep temporary notes. You can even bookmark the address so that you can quickly have a scratchpad available.
When I first saw this I was amazed! OK, maybe I'm easily impressed. :) I wanted to share it, so asked if I could mention it on G+. My colleague suggested that instead I link to the original page. When I searched for this, I had many hits returned, with the first being a blog post titled "One line browser notepad". The blog post's author described the method I mentioned above. I then went on to read some of the comments made in reply to the post and was amazed to see that there were at least 10 further enhancements and improvements suggested. I highly recommending you visit this blog post and try some of the methods.
For my purposes I settled on the example below. It goes a few steps further than the basic example, giving the tab a title, adding a [Save] button, increasing the text size, adding a favicon and setting the focus on the editing pane. One advantage of this solution over other solutions suggested is the ability to save the contents of the text box. It's not a fully-blown editor but you can at least save your notes if you want to do that. All credit for the code below goes to those who commented to the blog entry. It is entirely the result of cut-and-paste-ing some of their contributions.
data:text/html;charset=utf-8,<link%20rel="shortcut%20icon"%20href="http://g.etfv.co/http://www.sublimetext.com"/><title>Scratchpad</title><button%20onClick="SaveTextArea()">Save</button>%20<script%20language="javascript"%20type="text/javascript">%20function%20SaveTextArea()%20{%20window.location%20=%20"data:application/octet-stream,"%20+%20escape(txtBody.value);%20}%20</script>%20<textarea%20id="txtBody"%20style="font-size:%201.5em;%20width:%20100%;%20height:%20100%;%20border:%20none;%20outline:%20none"%20autofocus>%20</textarea>
Thursday, 3 January 2013
Firefox plugin: Markdown Editor
In my ongoing saga to assemble a method of storing personal notes in a way that best suits me, I stumbled across a Firefox plugin named Markdown Editor. As its name suggests, it is a Markdown editor which can be used to edit locally-stored text files in Markdown markup.
It provides a split-pane view, with one pane being the editing pane and the other an automatically-refreshed HTML view. The editor is quite basic with undo, save and save as features.
If you use Markdown markup but don't want to use a standalone application, try Markdown Editor. It makes a very useful addition to Firefox. It's quite basic in its functionality at the moment and could perhaps benefit from some enhancements and new features.
Try it and see for yourself. If you do try it, please write a review on its Mozilla Firefox plugins page as so far there it has had very few reviews.
It provides a split-pane view, with one pane being the editing pane and the other an automatically-refreshed HTML view. The editor is quite basic with undo, save and save as features.
If you use Markdown markup but don't want to use a standalone application, try Markdown Editor. It makes a very useful addition to Firefox. It's quite basic in its functionality at the moment and could perhaps benefit from some enhancements and new features.
Try it and see for yourself. If you do try it, please write a review on its Mozilla Firefox plugins page as so far there it has had very few reviews.
Firefox's recent changes have impressed me
I am impressed by recent changes and changes in progress to Firefox, namely:
Note: I am well aware that these features have been available in Chrome for some time. I give Google credit for the excellent browser that is Chrome but my preference is for Firefox.
- an optional PDF viewer written in Javascript;
- a new Downloads dialog box, with a matching Navigation bar button to show/hide the dialog. I definitely prefer this to having an entirely separate window opened (available only in the Nightly build at the moment);
- an option to open links in a Private Window. This is an improvement over the previous option, which was to switch the entire browser into Private Browsing mode (OK - I may have the name of that feature wrong) (available only in the Nightly build at the moment).
Note: I am well aware that these features have been available in Chrome for some time. I give Google credit for the excellent browser that is Chrome but my preference is for Firefox.
Thursday, 13 December 2012
HOWTO: Search Pidgin's logs for a regular expression
I wanted to search all of Pidgin's logs for mention of a subject I remembered was discussed a few months ago.
From within the directory for Pidgin's log files - ~/.purple - I tried the following command:
grep -R <regex> *.txt"
Sadly this failed miserably so I asked for help. Immediately someone came up with the answer:
grep -R <regex> **/*.txt
From within the directory for Pidgin's log files - ~/.purple - I tried the following command:
grep -R <regex> *.txt"
Sadly this failed miserably so I asked for help. Immediately someone came up with the answer:
grep -R <regex> **/*.txt
Thursday, 29 November 2012
Android app focus: Link2SD
Link2SD
Category: Utility
Cost: Free
Requires root access?: Yes
I have decided to highlight Android applications I think are useful, interesting or fun. First on the list is Link2SD.
https://play.google.com/store/apps/details?id=com.buak.Link2SD&feature=nav_result#?t=W251bGwsMSwxLDMsImNvbS5idWFrLkxpbmsyU0QiXQ..
Its main goal is to alleviate the problem of limited internal storage of an Android phone by allowing you to move user applications and their data to a micro SD card. Although there are several scripts to do the same for custom ROMs, they can be very ROM-specific and Link2SD is easy to use and has wider ROM compatibility. Link2SD's features also include the ability to freeze apps and automatically move them to SD storage.
If you find the internal storage of your phone is getting low, try Link2SD.
Category: Utility
Cost: Free
Requires root access?: Yes
I have decided to highlight Android applications I think are useful, interesting or fun. First on the list is Link2SD.
https://play.google.com/store/apps/details?id=com.buak.Link2SD&feature=nav_result#?t=W251bGwsMSwxLDMsImNvbS5idWFrLkxpbmsyU0QiXQ..
Its main goal is to alleviate the problem of limited internal storage of an Android phone by allowing you to move user applications and their data to a micro SD card. Although there are several scripts to do the same for custom ROMs, they can be very ROM-specific and Link2SD is easy to use and has wider ROM compatibility. Link2SD's features also include the ability to freeze apps and automatically move them to SD storage.
If you find the internal storage of your phone is getting low, try Link2SD.
Sunday, 25 November 2012
Google Hangout hints and tips
Overview
Google Hangouts are a free service provided by Google, which allow for video chats between up to 10 people.Installing the required bits and pieces
When you participate in a Hangout for the first time, the required plug-ins will be installed.Microphone/Headset
If you are using the Gnome 3 desktop environment, setting your USB headset or microphone as the default device can sometimes be difficult.Installing the Pulse Audio Shortcuts Extension
- Visit https://extensions.gnome.org/extension/109/pulse-audio-shortcuts/
- Install the Extension.
- Install the suggested packages in the description of the extension (not doing this will make the extesion useless).
- If the extension does not appear in the task bar, restart your Gnome 3 session
Alt+F2, then type restart or r. - Plug in your USB headset or mic.
Setting your input/output device
- Open the Volume Control menu in the task bar.
- Select Pulse Audio Shortcuts, and then click Volume Control.
- Click Volume Control.
- In the volume control window, select Configuraton.
Your Internal Audio and <Headset/Mic Name> will display. - Select the "OFF" profile for the Internal Audio device.
- The USB headset is now the only device that will playback and send audio on your PC.
Hints and Tips
Wired vs Wireless
If possible, use a wired network connection because you're likely to get better video quality.Testing... testing... Is this thing on?
Since a Google Hangout uses both audio and video sources, you need to check the audio settings of your desktop environment (DE) AND those of the Google Hangout.- Before starting the Hangout, check your DE's audio setting, making sure that the volume settings are OK and that your microphone is on;
- Once the Hangout is started, click on the Settings icon and again confirm that your microphone is on.
Add your national flag and screen name to your Hangout window
When you start a Hangout, there are many add-ons (called Apps) that will enhance your experience, particulary when talking with international folk, or in a full room.- In a hangout session, select Add Apps from the left hand list.
- From the list of available apps, select Hangout Toolbox and install.
- Hangout Toolbox will display in your left pane apps list.
- Click to open the menu.
- The first menu is the "lower third" menu.
- Set the following
- User Name
- Role (in the second field)
- Select Country (your flag)
- Set the slider to ON.
Talk to the camera, not the screen
- The configured options will display the info like you see in news broadcasts. Very cool.
Use Events to make fancy meeting invitations
Google Plus has an Events tab, and it is simply awesome for making meeting invites for work meetings.
If you are the organizer, you can not start the Hangout earlier from the invite. You must wait until the start time ticks over before you can launch the Hangout. Otherwise you get an "Untitled" hangout, which none of the other participants will know about.
Talk to the camera, not the screen
When you are the one talking in a Hangout, it is natural to want to talk to the person you see on the screen. This has a weird side-effect: you appear to be looking "somewhere else", not at the person.
Subscribe to:
Posts (Atom)