Gary Matthew Rogers

August 24, 2005

Less is not more

Filed under: Linux — Administrator @ 1:05 am

To aide one’s quest for godhood in the Linux world, might I suggest an extremely handy application called “less�. Less is somewhat similar to the program “more�, but extends and adds some additional features such as:

  • forward and backward movement within a file
  • searching (including regular expressions) and highlighting
  • watches on the end of the file (similar to tail)
  • line numbers
  • toggle line wrapping (useful for large log files)
  • open simultaneous file
  • many more (see )

To run less, simply type the following command (prompt$ = your shell prompt):

prompt$ less helloWorld.txt

Below you will find some tips on how to use less once it is up and running.

Navigation:
You can then navigate up and down through the file with the arrows, or the page-up and page-down keys.

Searching:
To initiate a search, simply press the “/� to bring up search prompt. Then either enter a string or regular expression and hit enter. Less will then highlight all matches. To keep searching through the file, simply press “/� and hit enter once more to look further for the previous phrase. HINT: Use the search feature in conjunction with the file watch command to highlight your search phrase in incoming data.

Watches:
To initiate a watch, you can issue the command “F� while running less. This will tell less to start examining the end of the file for incoming data. This can be very useful to keep an eye on raw web access or error logs, as well as system and mail logs.

Wrapping:
To toggle line wrapping, issue the command “-S� while running less. Note that once line wrapping is disabled, you can scroll left and right with the arrow keys to see the extended data.

For more information on using less, please refer to their website at: http://www.greenwoodsoftware.com/less/)

NOTE: If you don’t have less installed, see your specific distribution docs or download it from here.

Take my word for it and add the program “less� to your bag of tricks, right away.

August 18, 2005

Flash Remoting: HTTPS & Internet Explorer

Filed under: Programming — Administrator @ 5:04 pm

My initial experience with HTTPS Flash Remoting in Microsoft Internet Explorer was an absolute disaster! I was so frustrated as to why my remoting connection was working flawlessly in Mozilla Firefox and the MS Windows stand-alone Flash player, while not working at all in Internet Explorer. After hours of Google searches and digging through forum posts (which is probably where you are if you are reading this text), I decided to take matters into my own hands.

Let me preface my conclusion with a brief discussion on how Flash implements HTTP(S) connections. If your Flash application is loaded within a browser window, it actually uses the browser as an API of sorts for making HTTP(S) connections. If it is loaded within the stand-alone player, I am not certain, but I believe it uses a Flash specific browser built into that player.

Therefore, if connection problems are occurring only in Internet Explorer, then most likely it is a problem with either the communication with Flash and Internet Explorer, or Internet Explorer itself.

I have concluded that this problem is caused by the way that Internet Explorer handles the caching of HTTPS data. It appears as though Internet Explorer, if instructed to by the server, will cache all HTTP(S) data before giving it to Flash (if Flash initiated the request). For reasons that are unknown, the amount of time Internet Explorer takes to generate the cache on HTTPS data and hand it off to Flash causes Flash to timeout and fail on the connection. Therefore, this problem can be remedied by simply having your web server instruct browsers to not cache the HTTPS result for your remoting data.

There are many posts out there on how to disable caching. You can even use PHP and other scripting languages to output custom headers. However, I am confident that this solution is the easiest and most stable. Here are two simple steps that you can use to disable caching in Apache (1.x & 2):

  1. Install mod_headers. For those who are familiar with Apache modules, this should be a fairly easy step. Mod_headers is a very handy tool for generating custom headers for your web pages. (See http://httpd.apache.org/docs/1.3/mod/mod_headers.html for further info).
  2. Place the following commands in your apache conf file or an .htaccess file within the scope of your remoting gateway:

    Header unset "Expires"
    Header unset "Pragma"
    Header set "Cache-Control" "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"

That’s it, you are done, and now IE can connect to your HTTPS remoting gateway with ease!

NOTE:
There is a security setting in Internet Explorer that can completely disable Flash Remoting over HTTPS. Users need to be certain that they have the following advanced security setting disabled for things to work properly.

Go to: “Tools� => “Internet Options� => Click on the “Advanced� tab. Make sure “Do not save encrypted pages to disk� is disabled or not checked.

ie settings example

August 6, 2005

The quick brown fox…

Filed under: General — Administrator @ 12:18 am

After sitting on a domain registration for two years and saying to myself for nearly as long “I need to put up my blog”, I have finally done so! More to follow… and this time I mean it.

~Gary

Powered by WordPress